Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
_clone() got an unexpected keyword argument 'klass' Django
I've tried to overwrite get_queryset method in order to customise count method but when I'm trying to call it I'm receiving a typo: "TypeError: _clone() got an unexpected keyword argument 'klass", I ve google it a little bit but I didn't find anything relatable. admin.py: def get_queryset(self, request): qs = super(MyAdminModel, self).get_queryset(request) return qs._clone(klass=FastCountQuerySet) Any thoughts on this topic? Thx in advance! -
Django: Get latest record before certain date for all given users
So I have table the looks something like this user_id value date_created 1 10 2022-8-14 2 11 2022-8-14 3 12 2022-8-14 1 13 2022-8-15 2 14 2022-8-15 3 15 2022-8-15 1 10 2022-8-16 2 11 2022-8-16 3 12 2022-8-16 I want to find latest record before a certain date for given users. Following query filters all records for given users before a certain date. UserData.objects.filter(user_id__in=user_list, date_created__lte=start_date) How do I modify this query to get only the latest rows before the start date for each user. For example if the start date is 15 August it should give rows 4 to 6 from the table. PS: Date created is a simplification, it should be datetime and there can be multiple values on each day by same users. -
How to I change the order of my columns so it doesn't break an import with pg_restore
I'm trying to export data from a live Postgres DB into a local Postgres DB and have used pg_dump (via DataGrip) to dump the database into a tar file. I am using the INSERT option from the DataGrip dialogue which is giving the following. --dbname="XXX" --format=t --file="XXX/DataGrip Backup/{timestamp}" --inserts When I try and import the tar file using pg_restore (once again through DataGrip), one of my tables (the most important one!) won't import. The error I'm getting is: pg_restore: error: could not execute query: ERROR: invalid input syntax for type numeric: "AUD" The table has a numeric field and a varchar field. One for the discount and one for the currency being used. This is from a model (Django) using the MoneyField: coupon_discount = MoneyField( decimal_places=2, max_digits=10, null=True, default_currency="AUD", default=0.00 ) An example of the data I am importing is: Command was: INSERT INTO public.customers_customer VALUES (2557, '', NULL, 3, NULL, NULL, NULL, NULL, '2022-08-14 08:45:50.466306+00', '2022-08-14 08:45:50.466454+00', '2022-08-14 08:45:50.466459+00', 2559, '90h0nbJgDU', 0, 0.00, 'AUD', false, false, NULL, 1); pg_restore: error: could not execute query: ERROR: invalid input syntax for type numeric: "AUD" LINE 1: ...10:31:35.347403+00', 2560, 'o4VxTmqlOa', 0, 0.00, 'AUD', fal... When I look at the external Postgres DB … -
Can't customize the choice of autocomplete_field with TabularInline Django
I'm trying to limit the choice in autocomplete_field within TabularInline Django but I can't. I can do this within a ModelAdmin via get_search_results. But within TabularInline, it seems that the funtion get_search_results isn't called. Someone has any idea to do this with TabularInline? class BarInline(admin.TabularInline): model = models.Bar extra = 0 search_files = ('bar',) autocomplete_fields = ('bar',) def get_search_results(self, request, queryset, search_term): # I want to do something here to limit the choice of autocomplete_fields 'bar'. # But this function is never called within TabularInline # For exemple, I want to ... queryset = models.Bar.objects.filter(bar__name__contains="Only") ... @admin.register(models.Foo) class FooAdmin(ModelAdmin): inlines = (BarInline,) -
Update values in jsonfield for particular keys
Good morning everyone. I have JSONField in my model with following structure: { "1": { ... "is_disabled": false }, "2": { ... "is_disabled": false }, "3": { ... "is_disabled": false } } And i have set of pks like: pk_set = {1, 2} How can i update "is_disabled" key to true only for pks in pk_set? -
Use the django contains query with multiple objects
I want to use the Django contains query with multiple search objects. Currently, the way it's mentioned on the documentation is as follows: Entry.objects.get(headline__contains='Lennon') This basically returns all those headlines which contain the word 'Lennon'. Instead I want to filter it by a list of strings. Let's say my strings are names = ['McCartney', 'Lennon', 'Starr', 'Harrison'] Now, I want all those headlines which contain any of the words from the list above. Additionally, the list is dynamic so I can't exactly make hard-coded queries. So, I need a dynamic method of searching through my database using the contains keyword for multiple objects. How do I write a query for this? -
vHost config in cyberpanel
I want to host my django website on cyberpanel vps.I have done all the things and uploaded project to file manager of website on cyberpanel. here is my vHost config docRoot /home/fastrefer.online/public_html vhDomain fastrefer.online vhAliases www.fastrefer.online adminEmails jackgaming967@gmail.com enableGzip 1 enableIpGeo 1 index { useServer 0 indexFiles index.php, index.html } errorlog $VH_ROOT/logs/$VH_NAME.error_log { useServer 0 logLevel WARN rollingSize 10M } accesslog $VH_ROOT/logs/$VH_NAME.access_log { useServer 0 logFormat "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i"" logHeaders 5 rollingSize 10M keepDays 10 compressArchive 1 } scripthandler { add lsapi:fastr9279 php } extprocessor fastr9279 { type lsapi address UDS://tmp/lshttpd/fastr9279.sock maxConns 10 env LSAPI_CHILDREN=10 initTimeout 600 retryTimeout 0 persistConn 1 pcKeepAliveTimeout 1 respBuffer 0 autoStart 1 path /usr/local/lsws/lsphp81/bin/lsphp extUser fastr9279 extGroup fastr9279 memSoftLimit 2047M memHardLimit 2047M procSoftLimit 400 procHardLimit 500 } phpIniOverride { } module cache { storagePath /usr/local/lsws/cachedata/$VH_NAME } rewrite { enable 1 autoLoadHtaccess 1 } context / { type appserver location /home/fastrefer.online/public_html/refer_and_earn binPath /usr/local/lsws/fcgi-bin/lswsgi appType wsgi startupFile refer_and_earn/wsgi.py envType 1 env LS_PYTHONBIN=/home/fastrefer.online/public_html/bin/pyhton env PYTHONHOME=/home/fastrefer.online/public_html/ } context /.well-known/acme-challenge { location /usr/local/lsws/Example/html/.well-known/acme-challenge allowBrowse 1 rewrite { } addDefaultCharset off phpIniOverride { } } vhssl { keyFile /etc/letsencrypt/live/fastrefer.online/privkey.pem certFile /etc/letsencrypt/live/fastrefer.online/fullchain.pem certChain 1 sslProtocol 24 enableECDHE 1 renegProtection 1 sslSessionCache 1 enableSpdy 15 enableStapling 1 … -
Not Found: /topics [16/Aug/2022 13:32:34] "GET /topics HTTP/1.1" 404 2202
Page not found (404) Request Method: GET Request URL: http://localhost:8000/topics Using the URLconf defined in learning_log.urls, Django tried these URL patterns, in this order: admin/ The current path, topics, didn’t match any of these. You’re seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page. -
How to check and get the data in database using django template and api, if its not there then post new data.(rest_framework)
I have the code for django api to display the exist data in postman. But I need is at First I need to verify the email_id is exist if it exist I want to display the data, if it not there I need to create the data using that email_id. I am using form.py, from socket import fromshare from newappapi.models import example from django import forms from rest_framework import status from django.http.response import JsonResponse from rest_framework.parsers import JSONParser from newappapi.serializers import exampleSerializer class VenueForm(forms.ModelForm): class Meta: model = example fields = ['email_id'] def save(request,self, commit=True): email_id = forms.EmailField(max_length = 200) venue = super(VenueForm, self).save(commit=False) email_id = self.cleaned_data['email_id'] if request.method == 'GET': email_id = request.GET.get('email_id', None) values = example.objects.filter(email_id=email_id) if values.exists(): tutorials_serializer = exampleSerializer(values, many=True) return JsonResponse(tutorials_serializer.data, safe=False) return JsonResponse({'message': 'The email_id does not exist'}, status=status.HTTP_404_NOT_FOUND) if commit: venue.save() return venue I am using the template, {% block content %} <center> <h1>Email Verification</h1> <br/><br/> <form action="" method="POST , GET"> {% csrf_token %} {{form}} <label>Email-id</label> <input type="text" id="id" class="form-control"/><br/><br/> <input type="submit" value="Verify" class="btn btn primary"> <input type="submit" value="Post" class="btn btn primary"> </form> </center> {% endblock %} And i have Two buttons(verify, Post), if we click verify it want to show the data … -
How to add input values to database using click button in django
I have a code for display the values as a datatables from mongodb, Now how to add new data to database and also it show to us using submit. Actually I want query for submit button it can store new datas to database <form action="submit" method="POST"> {% csrf_token %} <div class="mb-3"> <label>Id</label> <input type="text" id="id" class="form-control"/> </div> <div class="mb-3"> <label>Code</label> <input type="text" id="code" class="form-control"/> </div> <div class="mb-3"> <label>Created</label> <input type="number" id="created" class="form-control"/> </div> <div class="mb-3"> <label>Email_id</label> <input type="email" id="email_id" class="form-control"/> </div> <div class="mb-3"> <label>modified</label> <input type="number" id="modified" class="form-control"/> </div> <div class="mb-3"> <label>Name</label> <input type="text" id="name" class="form-control"/> </div> <div class="mb-3"> <label>Picture_Url</label> <input type="url" id="picture_url" class="form-control"/> </div> <div class="mb-3"> <label>Rank</label> <input type="number" id="ranking" class="form-control"/> </div> <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button> <button type="submit" class="btn btn-primary btn-sm pull-right" id="submit">Submit</button> </div> </form> I am using nosql database(MongoDB) in Django framework -
why my submit input isn´t working in django?
I have a form so an user can ask for a loan and it will tell them if it´s approved or not. The problem is not the logic, it´s the submit input that doesn't work. It will not save the form in the database or show me the errors because of the submit input. Maybe is something wrong with the succes_url? I don't know, but here's my code: views.py: #don't worry about the logic part of the form, it's just to show how it´s supposed to work class LoanRequest(LoginRequiredMixin, generic.CreateView): form_class = LoanForm success_url = reverse_lazy('Prestamos') template_name = 'Prestamos/template/Prestamos/prestamos.html' def form_valid(self, form): user = self.request.user cliente = Cliente.objects.get(user_id = user.id) if not cliente.approve_loan(form.cleaned_data.get('loan_total')): form.add_error(field=None, error='loan not approved') return self.form_invalid(form) else: form.instance.customer_id = cliente super(LoanRequest, self).form_valid(form) return render(self.request, 'Prestamos/template/Prestamos/prestamos.html', context={'form': form, 'success_msg': 'loan approved!'}) urls.py: urlpatterns = [ path('prestamos/', views.LoanRequest.as_view(), name = 'prestamos'), ] forms.py: class LoanForm(forms.ModelForm): class Meta: model = Prestamo #loan in English fields = ['loan_type', 'loan_total', 'loan_date'] and the template: <div class="container"> {%if success_msg%} <p class="alert alert-success">{{success_msg}}</p> {%endif%} <form action="" method="POST"> {%csrf_token%} {%for field in form%} <div class="form-group"> <label for="{{field.label}}">{{field.label}}</label> {{field}} </div> {%for error in field.errors%} <p>{{error}}</p> {%endfor%} {%endfor%} <input type="submit" value="request"></input> </form> </div> -
Django Rest Framework: Create Related Object or Find by ID
Problem We are developing an API using DRF to create a Membership record that includes a related Entity record w/ all the personal information and a related Address record w/ all the address information. On this API we want to include behavior in way that allows the API to receive an Entity ID to reuse an existing entity or all the other attributes of the entity to create a new one. The same goes for the address. When we post all the required information, with the goal of creating the related Entity and Address, everything works fine, but when we just post the IDs we are facing a problem. The issue we are facing is that if we send the ID w/o all the other related fields we are getting validator errors and we cannot proceed with the get of the related objects and create main record. What we have tried What we have done so far is: Created the Serializers for Membership, Entity and Address. Configured the Serializer for Membership to have the related Entity and Address serializers. Overwritten the .create method on the Membership serializer to create the nested objects. The closest problem / answer we could find … -
'str' object is not callable in django models
I am using using pre-save signal in jdangp. When I change the title for resource model then I got the error below. 'str' object is not callable model.py class resource(models.Model): title=models.CharField(max_length=100) size=models.CharField( max_length=20, default="") desc=models.TextField(default="") file=models.FileField(default="", blank=True) url= models.URLField(max_length=200, blank=True) varient=models.CharField(max_length=100, default="") Brand = models.ForeignKey(brand,on_delete=models.CASCADE, default="") Model = models.ForeignKey(model,on_delete=models.CASCADE, default="") Categories = models.ForeignKey(category,on_delete=models.CASCADE, default="") update_at=models.DateField(auto_now=True) slug=models.SlugField(default="", unique=True, blank=True) Tags = TaggableManager(blank=True) pre-save signal function is def tag_set(sender, instance, **kwargs): instance.title('change title') pre_save.connect(tag_set, sender=resource) When I change title in pre-save I got error. -
In django admin panel, how can I autocomplete input?
In django admin panel, I want to add event listner so that while writing in field 1 same content must be filled in field 2 and if user want to change the field 2 he can change the input of field 2. -
How do I configure aws:elasticbeanstalk:container:python:staticfiles in Elastic Beanstalk?
I'm trying to run eb create to deploy my Django project to AWS. The error I'm getting is ERROR: ServiceError - Configuration validation exception: Invalid option specification (Namespace: 'aws:elasticbeanstalk:container:python:staticfiles', OptionName: '/static/'): Unknown configuration setting. I'm unsure what this error means and there's not much I can find on it. I've tried to define this variable in .ebextensions/django.config. option_settings: aws:elasticbeanstalk:container:python: WSGIPath: ebdjango.wsgi:application aws:elasticbeanstalk:container:python:staticfiles: /static/: 'frontend/views/build/static/' My settings.py is configured with the following vars: STATIC_URL = '/static/' STATICFILES_DIRS = [ os.path.join(BASE_DIR, 'frontend/views/build/static') ] STATIC_ROOT = os.path.join(BASE_DIR, 'static') I'm trying to run this ebs instance on Amazon Linux 2 -
How to upload an image to django backend using react and fetch
I am trying to make a PUT request to my django backend to update an image. But whenever I make the request, it returns the image that is already in the database. It does not update with the new image i uploaded. views.py @api_view(['PUT']) def UserPageCreateView(request, pk): if request.method == "PUT": page = UserPage.objects.get(id=pk) serializer = UserPageSerializer(instance=page, data=request.data, many=False, partial="True") if serializer.is_valid(): serializer.save() return Response(serializer.data) models.py class UserPage(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) slug = models.SlugField() title = models.CharField(max_length=100, default="") description = models.TextField(max_length=100, default="") profile_photo = models.ImageField(upload_to="images", default="media/images/apple_atgqt1") def save(self, *args, **kwargs): self.slug = self.user.username super().save(*args, **kwargs) def __str__(self): return self.user.username def get_absolute_url(self): return reverse("page_detail", kwargs={"slug": self.slug}) React FETCH REQUEST const PageUpdate = async (e) => { const response = await fetch(`http://127.0.0.1:8000/page-create/${id}`,{ method: "PUT", credentials: "include", headers: { "Content-Type": "multipart/form-data" }, body:JSON.stringify({ "profile_photo": profile_photo, }) }) let data = await response.json() console.log(data) } Modal for choosing a new image to upload <Modal.Body> <Form> <Form.Group className="mb-3" controlId="exampleForm.ControlInput1"> <Form.Label>Email address</Form.Label> <Form.Control type="file" value={profile_photo} onChange={(e) => setProfilePhoto(e.target.value)} /> </Form.Group> <Form.Group className="mb-3" controlId="exampleForm.ControlTextarea1" > </Form.Group> <Button variant="secondary" onClick={handleClose}> Cancel </Button> </Form> </Modal.Body> Browser [form and console image][1] From the above image, you can see the the image i uploaded is not the image that is … -
Django: Add a new value to ModelChoiceField
I have a ModelChoiceField in a form that uses a TextInput widget. I want to be able to select a value from the database or add new entries to the database with this input. If the value is not already in the database, I get an error on the form that says "Select a valid choice. That choice is not one of the available choices." Model class FeedCategory(models.Model): category = models.CharField(max_length=255, unique=True) class RssFeed(models.Model): category = models.ForeignKey(FeedCategory, null=True, on_delete=models.SET_NULL) name = models.CharField(max_length=255) feed = models.URLField() Form class RssForm(forms.Form): name = forms.CharField() feed = forms.URLField() category = forms.ModelChoiceField(queryset=FeedCategory.objects.all(), to_field_name='category', widget=forms.TextInput()) def clean(self): cleaned_data = super().clean() ???? Views class RssCreateView(FormView): template_name = 'dashboard/rss_feed_form.html' form_class = RssForm success_url = '/dashboard/' def form_valid(self, form): name = form.cleaned_data['name'] feed = form.cleaned_data['feed'] category = form.cleaned_data['category'] rss_obj = RssFeed(category=category, name=name, feed=feed) rss_obj.save() return super().form_valid(form) Template <form method="post"> {%csrf_token%} {{form|crispy}} <button type="submit">Save</button> </form> -
nested data get request Django
Hi everyone I would like to Know hot to get data when i am using forenkey, i mean i have a many to one relarion but when i get data i don´t recive the responde how i would like. class AsigManager(models.Manager): def get_by_natural_key(self, Nom_Asig, horario): return self.get(Nom_Asig=Nom_Asig, horario=horario) class ProfManager(models.Manager): def get_by_natural_key(self, Nombre, profesion): return self.get(Nombre=Nombre, profesion=profesion) class Asignatura(models.Model): Nom_Asig = models.CharField(max_length=200) horario = models.CharField(max_length=200) objects = AsigManager() class Meta: unique_together = [['Nom_Asig', 'horario']] class Profesor(models.Model): asignatura = models.ForeignKey(Asignatura, on_delete=models.CASCADE) Nombre = models.CharField(max_length=200) profesion = models.CharField(max_length=200) objects = AsigManager() class Meta: unique_together = [['Nombre', 'profesion']] class ProfesorView(View): def get(self, request): profe = list(Profesor.objects.values()) if len(profe)>0: datos = {'message':'Succes','Profesores: ':profe} else: datos = {'message':'Profesor Not Found...'} return JsonResponse(datos) but i Woudl like to get de Asignatura data when i get de Profesor data such as a object or list inside the Profesor request enter image description here -
elasticsearch in django rest framework in virtualenvironment
I tried to use elasticsearch in virtual environment in django rest framework. I am not using docker. When I use the port 127.0.0.1:8000, I got following error. NewConnectionError(<urllib3.connection.HTTPConnection object at 0x06B3EC40>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it) When I use the port :9200 or :9300 and call the api in postman, it doesnt connect and nothing happens. My elasticsearch.yml network: host: 0.0.0.0 :http: port: 9300 My setting.py ELASTICSEARCH_DSL={ 'default': { 'hosts': 'localhost:9300'}, } I even tried using curl to call the api from cmd but it says the connection failed. I have written all the views for search and also all documents class, but I dont think I need to post these here because the main problem is how to run the api. I am using virtual environment. -
Nested for Loop in django template
{% for i in some_dict %} {% for value in some_dict.i %} {% endfor %} {% endfor %} as i understended python try to find value with 'i' key, but i want to find value with the key that contains in i Сan i make something like this? How if i can? Maybe there is another more correct way for unpucking dicts? Dict example: {a: [val1, val2, val3], b: [val1, val2, val3]} -
giving different related names for a foreign key for the children in django multitable inheritance
I have these models: class Theme(models.Model): name = models.charfield() class Product(models.Model): theme = models.ForeignKey(Theme) class PhysicalProduct(Product) class Course(Product): ........ class Book(Product): ........ and I want to is to fetch only the courses and the books related to a specific theme, with prefetch_related method but the problem is that I don't think there's a way to do that but to add the theme field to each child of the Product model and give each one a specifically related name: class Theme(models.Model): name = models.charfield() class Product(models.Model): ....... class PhysicalProduct(Product): theme = models.ForeignKey(Theme) class Course(Product): theme = models.ForeignKey(Theme) ........ class Book(Product): theme = models.ForeignKey(Theme) ........ is there a way that I can keep the theme field in the Product model and be able differentiate between specific types of products that I only wanna fetch with prefetch_related -
Can't create model field automatically error in querystring
I have: class ZipCode(models.Field): def __init__(self, *args, **kwargs): kwargs['verbose_name'] = "Cep" super().__init__(*args, **kwargs) def deconstruct(self): name, path, args, kwargs = super().deconstruct() del kwargs["verbose_name"] return name, path, args, kwargs def db_type(self, connection): return 'char(8)' class Address(models.Model) : zip = ZipCode() it works fine and make a verbose correctly in the field Now, i would like of implementand a automatic parameteres for lenght and verbose_name I did like follow: class ZipCode(models.Field): def __init__(self, length=None, verbose=None, *args, **kwargs): self.length = length self.verbose = verbose kwargs['verbose_name'] = self.verbose super().__init__(*args, **kwargs) def deconstruct(self): name, path, args, kwargs = super().deconstruct() return name, path, args, kwargs def db_type(self, connection): print (F"char({self.length})") return F"char({self.length})" class Address(models.Model) : zip = ZipCode(16, 'cep') .... The expression print (F"char({self.length})") returns char(16). as expected But it gear the error on mysql query **return self.cursor.execute(sql) File "C:\Users\Carlos\AppData\Roaming\Python\Python310\site-packages\MySQLdb\cursors.py", line 319, in _query db.query(q) File "C:\Users\Carlos\AppData\Roaming\Python\Python310\site-packages\MySQLdb\connections.py", line 254, in query _mysql.connection.query(self, query) django.db.utils.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'None) NOT NULL, `address` varchar(200) NOT NULL, `number` varchar(10) NOT NULL, ' at line 1") PS D:\Softwares\python\dj\hotplateprensas> * Histórico restaurado** How i can fixed it? -
I am facing this problem continuosully whats error in my code
Im facing the above problem while training my models. Some of the datas in my dataset are float numbers. but i want to keep them as float. How can i solve this issue -
Why am I getting Unsupported media type "application/json" in request error?
I'm using Postman to test an api. My local unit tests pass. But when I use the same request in Postman, I get { "errors": [ { "detail": "Unsupported media type \"application/json\" in request.", "status": "415", "source": { "pointer": "/data" }, "code": "unsupported_media_type" } ] } Using a breakpoint, get that result when unpacking request.data in the View. I made sure to set application/json in the Content-Type header, and even specified it as a parser. I still get the error. Can you see why? Part of the code where things break: class ProvisionCustomerView(APIView): permission_classes = [IsAuthenticated] serializer_class = ProvisionCustomerSerializer def post(self, request): customer_data = request.data When using postman, request.data returns: *** rest_framework.exceptions.UnsupportedMediaType: Unsupported media type "application/json" in request. Although it works fine in a unit test. -
How is my list_display and list_editable clashing?
When I started building this project, it went pretty smoothly. But when I reached the admin, list_display and list_editable clashed: admin.py Code: from django.contrib import admin from .models import Article, Author # Register your models here. @admin.register(Article) class ArticleAdmin(admin.ModelAdmin): list_display = ['title', 'main_txt', 'date_of_publication'] list_editable = ['title', 'main_txt'] def __str__(self): return self.title @admin.register(Author) class AuthorAdmin(admin.ModelAdmin): list_display = ['first_name', 'last_name', 'join_date', 'email'] def __str__(self): return f"{self.first_name} {self.last_name[0]}" models.py: from django.db import models # Create your models here. class Author(models.Model): first_name = models.CharField(max_length=100) last_name = models.CharField(max_length=100) date_of_birth = models.DateField() email = models.CharField(max_length=300) phone_num = models.CharField(max_length=15) join_date = models.DateField() participated_art = models.ManyToManyField('Article', blank=True) class Article(models.Model): title = models.CharField(max_length=500) date_of_publication = models.DateField() creaters = models.ManyToManyField('Author', blank=False) main_txt = models.TextField() notes = models.TextField() Error Code: Exception in thread Django-main-thread: Traceback (most recent call last): File "C:\Users\Zhiyue\AppData\Local\Programs\Python\Python39\lib\threading.py", line 980, in _bootstrap_inner self.run() File "C:\Users\Zhiyue\AppData\Local\Programs\Python\Python39\lib\threading.py", line 917, in run self._target(*self._args, **self._kwargs) File "C:\Users\Zhiyue\PycharmProjects\djangoProject1\venv\lib\site-packages\django\utils\autoreload.py", line 64, in wrapper fn(*args, **kwargs) File "C:\Users\Zhiyue\PycharmProjects\djangoProject1\venv\lib\site-packages\django\core\management\commands\runserver.py", line 134, in inner_run self.check(display_num_errors=True) File "C:\Users\Zhiyue\PycharmProjects\djangoProject1\venv\lib\site-packages\django\core\management\base.py", line 546, in check raise SystemCheckError(msg) django.core.management.base.SystemCheckError: SystemCheckError: System check identified some issues: ERRORS: <class 'CodeJangoHome.admin.ArticleAdmin'>: (admin.E124) The value of 'list_editable[0]' refers to the first field in 'list_display' ('title'), which cannot be used unless 'list_display_links' is set. System check …