Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Ajax Post does not load the page, even though the log shows the call
I have two pages in my django app. (This is my first django app and I am new to javascript also.) first page - a table with a checkbox in each row and an edit button second page - input screen with save button issue: I am trying to get a list of row-ids from first page to second page So far: In the OnClick event of edit button, I collect all the Ids for the selected rows in an array. I use $.ajax call to send this array to second page through POST. $.ajax({ url: '/secondpage/', type: 'POST', headers: { "X-CSRFToken": csrftoken, 'Accept': 'application/json', 'Content-Type': 'application/json' }, data: {'idsList': JSON.stringify(selectedIds)}, success: function (response) { console.log('success'); }, error: function (xhr, ajaxOptions, thrownError) { alert("ERROR " + xhr.status + " - " + thrownError); } }); After selecting some rows in first page when I click the the Edit button, I see in the django log the following entry [13/Aug/2020 14:36:14] "POST /secondpage/ HTTP/1.1" 200 41403 but secondpage does not load. I still see the first page in the browser. And in the Dev. Tools I see 'success' as last console message. What am I missing? Can someone help me? Thanks … -
How can I create a remote database for my heroku application
I have created a web app using django and I have deployed that app on web using heroku.. But the problem is that I don't have any remote database so whenever I make new users on my local branch and add some other features and then merge this branch with the master branch(which i have set up to deploy on heroku) the users that i added on my localhost get added to heroku deployed website..I know that databases can be stored on AWS but I don't have a credit card to login..Please tell me some other tool using which I can keep my local database and online database separate.. -
ValueError the view didn't return an HttpResponse object. It returned None instead
I have created a decorator to check authentication before my view. I'm planning on putting this decorator on all views. I've determined that my code is getting executed. However I'm getting the above error. Here is my decorator: ''' def check_the_permissions(func): def wrap(request): soeid = request.GET.get('soeid') if not soeid: return HttpResponse("Please ..") is_allowed = getEEMSResponse(soeid, URL) if not is_allowed: return HttpResponse("You do not have ...") func(request) return wrap @check_the_permissions def LimitVsUsageTrend(request): scatterLimitVsUsage = plot(myfigure, output_type='div') return render(request, 'LimitVsUsageTrend.html", {'myplot': scatterLimitVsUsage}) ''' Here is my stack trace Traceback (most recent call last): File "C:\Users\opt\exeception.py" line 34 in inner response = get_response(request) File "C:\Users\opt\base.py", line 126 in _get_response "returned None instead." % (callback.module, view_name) ValueError: The view plots.views.wrap didn't return an HttpResponse object. It returned None instead. -
Django filtering database with .value and calling foreign key
Once again I'm asking for your help. I want to return data in Json format from database and I need 3 values temprature, date and sensor.description. With little to no problem I can querry and get 'temprature' and 'date' but I have hard time with getting that sensor description. This gives me temprature and date sen = S280000020E3120.objects.filter(date__range=[dateo, datee]).values('date', 'temprature') and this gives me description desc = S280000020E3120.objects.filter(date__range=[dateo, datee]).last().sensor.description And If I want to return json from that I have to do sen = list(sen) but when I try to append desc to sen by result = sen.append(desc) I got error NoneType object is not iterable. It is possible to get result in similar format? {"ds": [{"date": "2020-06-19T16:23:16", "temprature": "27.4"}, {"date": "2020-06-19T16:26:24", "temprature": "27.4"}, {..rest of data..}, sensor.description]} My view.py def chartData(request): fixm = datetime.min.time() fixd = datetime.max.time() dateo = '2020-06-19' datee = '2020-6-20' dateo = datetime.strptime(dateo, '%Y-%m-%d') datee = datetime.strptime(datee, '%Y-%m-%d') dateo = datetime.combine(dateo, fixm) datee = datetime.combine(datee, fixd) sen = S280000020E3120.objects.filter(date__range=[dateo, datee]) #date = sen.values('date', ) value = sen.values('date', 'temprature') lvalue=list(value) senName = sen.last().sensor.sensor_name #lvalue = lvalue.append(senName) result = { 'ds': list(lvalue), } return JsonResponse(result, safe=False) models.py class S280000020E3120(models.Model): sensor = models.ForeignKey('Sensors', models.DO_NOTHING) temprature = models.DecimalField(max_digits=4, decimal_places=1) date … -
How to get Web-hook data using Flask?
I am using Jotform which provide webhook service. For testing purpose I created a dummy endpoint URL requestbin, whenever someone filling a form, I am getting output on that endpoint URL as : Now, I created one flask API and want to receive the same data over POST API instead of on that dummy URL. My code looks like this : from flask import Flask,request,jsonify import json from flask_cors import CORS app = Flask(__name__) CORS(app) @app.route('/check',methods=['GET']) def check(): return {'output' : 'it"s working'} @app.route('/check_webhook',methods=['POST', 'GET']) def check_(): text = str(request.json) print("check",text) But I am getting None as output. How can I receive the same data on flask API as I am receiving on that dummy URL? -
How to resolve Django model form does not saving
Hello I am trying to implement a Django model form when I try to now submit the form it does not save my data can I please get help I do not know where I can be going wrong with this implementation: Code Below: models.py class Videos(models.Model): lecturer = models.CharField(max_length=100, blank=False, null=False) module = models.CharField(max_length=100, blank=False, null=False) video = models.FileField(upload_to='lectures/') date = models.DateField(default=datetime.datetime.now()) Code Below: form.py class LectureVideos(forms.ModelForm): class Meta: model= Videos fields = '__all__' Code Below:view.py def LectureVideoForm(request): form = LectureVideos() if form.is_valid(): form.save() return redirect('upload-success') return render(request, 'forms.html', {'form':form}) Code Below:forms.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Upload</title> </head> <body> <form action="" method="POST" enctype="multipart/form-data"> {% csrf_token %} {{form.as_p}} <input type="submit" value="Upload Video"> </form> </body> </html> -
Need suggestions on how to compare some data being rendered from django views, do some comparison and display the analysis?
I am using django framework to design a dashboard for data visualization. I am rendering some data from my views to the template and i want to do some comparison & display the analysis in a table. I am sending the two year's sales data from views. I want to display the sale in each month for both years, increment/decrement in sales in percentage and use a glyphicon-triangle to show top/bottom accordingly in a tabular format. I need suggestions on how can i achieve this. -
Why i am i encountering DrawingProfile.DoesNotExist Exception in Django?
I am trying to resolve a bug in the API from a code i inherited. I am new to Django and tastypie so i don't know how to resolved this. I have imported my model but i do not know why i am getting DoesNotExist exception. from erma_drawing import models as erma_drawing_models def hydrate(self, bundle): ''' Hydrate things ''' try: bundle.obj.profile = erma_drawing_models.DrawingProfile.objects.get(default_drawing=True) except DrawingProfile.DoesNotExist: logger.error("Drawing Profile does not exist") return super().hydrate(bundle) Model.py class DrawingProfile(models.Model): name = models.CharField( max_length=32, null=False, blank=False, unique=True) privilege = models.ForeignKey( 'erma_authorization.Privilege', on_delete=models.PROTECT, null=True, blank=True, help_text='The privilege required to' + ' create new drawings that use this profile') default_drawing = models.BooleanField( default=False, null=False, blank=False) def __init__(self, *args, **kwargs): super(DrawingProfile, self).__init__(*args, **kwargs) def clean(self, *arge, **kwargs): if self.privilege and self.privilege.type.lower() != 'drawing': raise ValidationError( 'Drawing profiles may only depend on privileges of type ' '"Drawing"') #For brevity def save:.. def clean:... def delete:... class Meta: db_table = 'drawing_profile' ordering = ['id'] -
How to Exclude Fields From Form Validation but Save the Cleaned Data
Let's say I have a ModelForm with the options to "save" and "Archive" (i.e. save for later) which only appear in the post_data if they are clicked. If the user clicks "save", the form would go through all the validation (including some custom logic in form.clean()) like normal. If the user clicks "archive" none of the custom validation in the form.clean() should run but the data should be saved. In forms.py, I tried defining my form.clean() method as something like this: def clean(self, full_clean=True): cleaned_data = super().clean() if full_clean: # All my validation ... ... return cleaned_data Then in my views.py: ... ... if request.method == "POST": post_data = request.POST if post_data.get('save') != None: # Do all validation if form.is_valid(): form.save() cleaned_form = form.cleaned_data ... ... else: # If not valid # Do something with the errors ... elif post_data.get('archive') != None: # Don't do any validation form.is_valid() cleaned_form = form.clean(full_clean=False) ... ... form.save() ... The problem is, the form.clean() method is called when form.is_valid() is called so all the custom validation is still executed. I've also tried making full_clean default to False instead but then it won't validate properly when I want it to. If I remove the second … -
Ceph with Django
I stuck in overriding storage for files in Django. I get xlsx file from api and need to save it in storage called CEPH.. I find that I need to change default_storage, but can't find what global variables in settings need to change. Can someone help me with it? -
Django Rest Framework Reverse() Method Fails
My main urls.py is located here ahlami -> ahlami -> urls.py urlpatterns = [ path('admin/', admin.site.urls), path('api/accounts/', include('accounts.api.urls')), ] My accounts app urls.py is located here ahlami -> accounts -> api -> urls.py urlpatterns = [ path('users/<int:pk>/', views.UserView.as_view(), name='user-detail') ] One of my accounts views.py returns token = Token.objects.create(......) return Response(data=AnonymousUserTokenResponseSerializer(instance=token).data) My token model has three fields only. For simplicity, I listed one field below class Token(rest_framework.authtoken.models.Token): user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE AnonymousUserTokenResponseSerializer is linked to the Token model and returns three json attributes class AnonymousUserTokenResponseSerializer(serializers.ModelSerializer): user_id = serializers.ReadOnlyField(source='user.id') user_url = reverse(viewname='user-detail') class Meta: model = Token fields = ('key', 'user_id', 'user_url') AnonymousUserTokenResponseSerializer fails because it can't identify reverse() user_url = reverse(viewname='user-detail') python manage.py runserver throws the error below because of the line above django.core.exceptions.ImproperlyConfigured: The included URLconf 'ahlami.urls' does not appear to have any patterns in it. If you see valid patterns in the file then the issue is probably caused by a circular import. My settings is located here ahlami -> ahlami -> settings -> base.py and base.py has this ROOT_URLCONF = 'ahlami.urls' I expect to get an output that looks like but couldn't because of the error above. { "key": "891e388399f2fcae016fe6887107034239041478", "user_id": 29, "user_url": http://localhost/api/accounts/users/29 } How can … -
how to redirect to a page in django
I am creating a webapp where i have sections like home,profile,and on home page there are several posts which are written by users. But when i go to the posts and from there if i have to return back to home page,it says page not found. it takes me to the following link "http://127.0.0.1:8000/post/4/home". but i want to go to http://127.0.0.1:8000/home. How to do this <li> <a href="profile">Profile </a></li> <li> <a href="logout">Logout</a> </li> <li> <a href="password_change">Password change</a> </li> <li> <a href="home">home </a> </li> my views.py of homepage def homep(request): context = { 'posts':post.objects.all() } return render (request,'welcome.html',context) my urls.py path('',views.index,name='index'), path('login',views.login_view,name='login'), path('register',views.register,name="Login now"), path('logout',views.logout_view,name='logout'), path('profile', views.profile,name='profile'), path('home',PostListView.as_view(),name='home'), path('edit_profile',views.profile_change,name='profile_change'), path('post/<int:pk>/',PostDetailView.as_view(),name ='post-detail'), -
Need advice for free file storage for heroku hosting
I am currently developing a website in django which i am going to host on heroku but images didnt persist in heroku.So i need a file storage server to save my image and video files. It would be great if you help me with code. Its Urgent plz reply fast if You know. -
Docker Django Nginx Gunicorn ajax post 400
I am trying to dockerize my django app. I am using this docker template: https://github.com/testdrivenio/django-on-docker The template works perfectly for serving static and media files, but whenever I try to upload files using ajax, then I receive a 400 error. I manually checked and the file is located on the machine. My allowed host is set to ["*"]. I'm not sure why it would serve the static files and media files, but then not handle the ajax requests. error msg: nginx_1 | 172.31.0.1 - - [13/Aug/2020:18:04:08 +0000] "POST /uploads/progress-bar-upload/ HTTP/1.1" 400 143 "http://127.0.0.1:1337/uploads/mydrive/" nginx.conf upstream hello_django { server web:8000; } server { listen 80; location / { proxy_pass http://hello_django; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $host; proxy_set_header X-Forwarded-Host $server_name; proxy_set_header X-Real-IP $remote_addr; add_header P3P 'CP="ALL DSP COR PSAa PSDa OUR NOR ONL UNI COM NAV"'; proxy_redirect off; } location /staticfiles/ { alias /home/app/web/staticfiles/; } location /mediafiles/ { alias /home/app/web/mediafiles/; } } -
How to check if one function was called inside Django form save method?
What i Have Within the save method of the form are called two functions: generate_random_password and send_email, I need to know if these functions were called because generate_random_password assigns a password randomly to each new created user and send_email sends a email notification to the user with the credentials, the password generated and the user to login. It is important to know if these functions were executed correctly within save. class UserAdminCreationForm(forms.ModelForm): class Meta: model = User fields = () def save(self, commit: bool = True) -> U: user = super(UserAdminCreationForm, self).save(commit=False) data = self.cleaned_data # Set random password for every new user random_password = generate_random_password() user.set_password(random_password) # Send email confirmation with credentials to login email = data.get("email") html_message = render_to_string( template_name="mails/user_creation_notification.html", context={"email": email, "password": random_password}, ) # Strip the html tag. So people can see the pure text at least. plain_message = strip_tags(html_message) send_mail( subject="Bienvenido a TodoTránsito", message=plain_message, recipient_list=[email], html_message=html_message, ) # Save into the DB the new user if commit: user.save() return user The problem I'm using pytest to test my Django code, but I don't know how to assert if these function was called or if this approach its correct to test this save function. -
How to use Rich as django shell?
Django allows to replace its default shell with more capable ones like ipython and bpython. https://docs.djangoproject.com/en/3.0/ref/django-admin/#shell Is there a way to replace/extend default django shell with Rich? https://github.com/willmcgugan/rich -
Django: How can I filter based on a value in a one-to-many child
I'm developing an auction site. I have a model that represents items being auctioned and a model representing bids. An item may have zero, one or more bids. The bid model includes a User object representing the bidder. The bidder may bid for more than one item. Using the ListView class based view, I'd like to list all items that a particular user is bidding for. The following sample code represents the problem: # models.py class Item(models.Model): seller = models.ForeignKey( User, on_delete=models.PROTECT, ) description = models.CharField(max_length=128, blank=True) def __str__(self): return f'{self.description}' # A car can have zero, one or many paints class AuctionBid(models.Model): item = models.ForeignKey( Item, on_delete = models.DO_NOTHING, ) buyer = models.ForeignKey( User, on_delete=models.PROTECT, ) bid = models.DecimalField(max_digits=9, decimal_places=2, default=0) def __str__(self): return f'{self.item} - {self.buyer} - {self.bid}' # views.py from .models import Item, AuctionBid class AuctionListView(ListView): model = Item template_name = 'listing/item_list.html' # change from default template name def get_queryset(self): return Item.objects.order_by('description').filter(?????) What do I need to put in the AuctionListView get_queryset() so that I can return only items where a certain user has made a bid? -
Django file not uploading. get <MultiValueDict: {}> while printing. (django 3.1)
I try to upload a file using Django but not able to do it.can anyone tell me what is wrong with this code files? All code files are here, views.py @method_decorator(login_required, name='dispatch') class CreatePost(View): def post(self, request,boardId): postTitle = request.POST.get('postTitle') postDescription = request.POST.get('postDescription') print(postTitle ) print(postDescription) createdOn = datetime.now() createdBy = request.user boardId = BoardModel.objects.get(boardId = boardId) newPost = Post( postTitle = postTitle, postDescription = postDescription, createdOn = createdOn, createdBy = createdBy, boardId = boardId, ) newPost.save() postId = newPost.postId request_file = request.FILES['postAttachment'] if 'postAttachment' in request.FILES else None print(request.FILES) if request_file: print(request.POST['postAttachment']) storeAt = settings.STATIC_DIR fs = FileSystemStorage(storeAt) filename = request.POST['postAttachment'] file = fs.save(filename, request_file) print("boardId in create post" + str(boardId)) return redirect(request.META['HTTP_REFERER']) template <form action="{% url 'create_post' boardId=board.boardId %}" method="POST" enctype="multiple/form-data"> {% csrf_token %} <input type="text" name="postTitle" id="id_postTitle" placeholder="Enter The Post Title" class="form-control form-input" required> <be> <textarea name="postDescription" id="postForm" cols="3" class="form-control" style="resize: vertical; height: 100px;" placeholder="Enter Post Description" cols="5" required></textarea> <br> <span id="attachedFilesList" class="row"></span> <br> <button type="submit" class="btn btn-login btn-green" id="postBtn"><span>Post</span></button> <input type="file" name="postAttachment" id="fileUpload" onchange="previewFiles(event);"> &nbsp;&nbsp; while printing request.FILES I got <MultiValueDict: {}> output (cmd): C:\Users\PATEL JANVI\Envs\post\lib\site-packages\django\db\models\fields\__init__.py:1370: RuntimeWarning: DateTimeField Post.createdOn received a naive datetime (2020-08-13 22:22:53.036403) while time zone support is active. RuntimeWarning) <MultiValueDict: {}> boardId in … -
SerializerMethodField not showing up - Django Rest Framework
So im trying to add a new field to my serializer by using SerializerMethodField(), but it is not showing. How come? models.py: class Post(models.Model): author = models.ForeignKey(User, on_delete=models.CASCADE) ## content = models.TextField(max_length=400, blank=False) date_posted = models.DateTimeField(auto_now_add=True) @property def username(self): return self.author.username def __int__(self): return self.id serializers.py: class PostSerializer(serializers.ModelSerializer): username = serializers.SerializerMethodField() class Meta: model = Post fields = '__all__' def get_username(self, obj): return obj.username #return obj.author.username dooesnt work either view.py where i go to see the details of a post; @api_view(['GET']) def postDetail(request, pk): post = Post.objects.get(id=pk) serializer = PostSerializer(post, many=False) return Response(serializer.data) and this is what turns up, username field is missing: { "id": 2, "content": "6", "date_posted": "08/12/2020 18:33:55", "author": 1 } -
Django Restframework Serilaizer, data only saves whenusername is passed in the request
I have created a serializer using modelserializer in django rest. class UserSerializer(serializers.ModelSerializer): photo_url = serializers.SerializerMethodField() member_from = serializers.SerializerMethodField() class Meta: model = models.UserProfile fields = ['username', 'first_name', 'last_name', 'photo_url', 'github_link', 'linkedin_link', 'points', 'has_badge', 'bio', 'member_from'] def get_photo_url(self, user): request = self.context.get('request') photo_url = user.profile_pic.url return request.build_absolute_uri(photo_url) def get_member_from(self, user): request = self.context.get('request') now = datetime.datetime.now() date_mem = user.date_joined.replace(tzinfo=None) print(now, date_mem) return timeago.format(date_mem, now) While using postman whenever username is passed in the request only then and then the data gets saved in the database otherwise it does not save. eg: when i pass first_name, it does not save but when i pass first_name and username, it works my view code: def put(self, request): serilaized_user = serializers.UserSerializer(request.user, context={"request": request}, data=request.data) if serilaized_user.is_valid(): serilaized_user.save() return Response(serilaized_user.data) -
Importing existing Django project onto windows - missing file
I'm a complete beginner to Django and web development and I'm having a ton of trouble trying to import an existing django project to a new server. Here's what I've done: Installed Python/Django pip install requirements.txt Tried to run manage.py throws an error that "No such file or directory: /etc/config.json". Am I missing something? -
Django CheckboxSelectMultiple not displaying in ModelForm
I'm trying to use CheckboxSelectMultiple in a form, instead of the SelectMultiple default. I tried two different ways to make it display as checkboxes, but they both display the default SelectMultiple on my local webpage. Everything else renders correctly ( {{ form.as_table }} ). Would someone point me in the right direction? Thanks, Django version 3.0.2 Python 3.6.9 models.py class MyModel(models.Model): m2m = models.ManyToManyField('OtherModel', blank=True) [...] forms.py from django.forms import ModelForm from myapp.models import MyModel class MyModelModelForm(ModelForm): [...] # I tried this... m2m = forms.MultipleChoiceField(widget=forms.CheckboxSelectMultiple) class Meta: model = MyModel fields = '__all__' # or this... widgets = { 'm2m': forms.CheckboxSelectMultiple, } views.py from django.views.generic.edit import CreateView from myapp.models import MyModel class MyModelCreate(CreateView): model = MyModel fields = '__all__' template_name = 'MyApp/mymodel_form.html' -
Show highest bid on auction
I want to show just the latest bid that someone makes on the auction listing but instead it shows me every Bid that has been made. I also want to do a function that doesn't allow bids lower than the actual highest bid. models.py class Bid(models.Model): auction = models.ForeignKey(Auction, on_delete=models.CASCADE, related_name="bids") user = models.ForeignKey(User, on_delete=models.CASCADE, default=1) new_bid = models.IntegerField() views.py (I have the new_bid form already on the page of the auction) @login_required(login_url="login") def auction(request, id=id): auction = Auction.objects.get(pk=id) new_bid = Bid.objects.last() if request.method == "POST": form = PlaceNewBid(request.POST or None, request.FILES or None) if form.is_valid(): user = request.user new_bid = form.cleaned_data["new_bid"] comment = Bid(auction=auction, user=user, new_bid=new_bid) comment.save() else: form = Lcreate() return render(request, "auctions/listing.html", { "form": PlaceNewBid, "comments": auction.comments.all(), "auction": auction, "bids": auction.bids.all(), "new_bid": new_bid }) forms.py class PlaceNewBid(forms.ModelForm): class Meta: model = Bid fields = ('new_bid',) html <form method="POST" enctype="multipart/form-data"> {%csrf_token%} <button type="submit" class="btn btn-primary">Place a New Bid</button> {{form.as_p}} </form> {%for bid in bids%} <h3>${{ bid.new_bid}}</h3> {%empty%} No offers yet. {%endfor%} {{auction.description}} ``` I hope everything is understandable, thanks -
Getting IntegrityError in django
I want to make post in my website. In this website only particular user can update it. I am using this method but getting integrityerror. Can somebody help me with this. models.py from django.contrib.auth.models import User class HrReferal(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE, related_name="user") name = models.CharField(max_length=150) designation = models.CharField(max_length=30) yrs_of_exp = models.IntegerField() referal_code = models.IntegerField(unique=True,blank=True,null=True) views.py def hrreferalview(request): if not request.user.is_authenticated: return redirect('/login/') else: if request.method == "POST": fm = HrReferalForm(request.POST) if fm.is_valid(): referal = fm.save(commit=False) referal.fm = request.user referal.save() return redirect('/profile/') else: fm = HrReferalForm() return render(request,'hrreferalapp/form.html',{'form':fm}) forms.py class HrReferalForm(forms.ModelForm): class Meta: model = HrReferal fields = ['name','designation','yrs_of_exp'] -
Why am I getting ImportError on render_to_response method if it's not included anywhere?
I'm working on a Django project, and when I want to run it locally, I get the following: ImportError: cannot import name 'render_to_response' from 'django.shortcuts' However, I'm not including render_to_response method anywhere in the project, as I checked. I believe it's probably something like an incompatibility issue between any library, although I can't tell. My python version is 3.7, my Django version is 3.1, my pip version is 20.2.2. My pip freeze returns this: allauth-django==0.42.6 asgiref==3.2.10 certifi==2020.6.20 chardet==3.0.4 defusedxml==0.6.0 Django==3.1 django-crispy-forms==1.9.2 django-filter==2.3.0 django-tables2==2.3.1 idna==2.10 mysqlclient==2.0.1 oauthlib==3.1.0 python3-openid==3.2.0 pytz==2020.1 requests==2.24.0 requests-oauthlib==1.3.0 sqlparse==0.3.1 tablib==2.0.0 urllib3==1.25.10 Any help would be appreciated. The full stack trace is this: Exception in thread django-main-thread: Traceback (most recent call last): File "C:\Users\IvanH\AppData\Local\Programs\Python\Python37\lib\threading.py", line 926, in _bootstrap_inner self.run() File "C:\Users\IvanH\AppData\Local\Programs\Python\Python37\lib\threading.py", line 870, in run self._target(*self._args, **self._kwargs) File "C:\Users\IvanH\PycharmProjects\sare_project\venv\lib\site-packages\django\utils\autoreload.py", line 53, in wrapper fn(*args, **kwargs) File "C:\Users\IvanH\PycharmProjects\sare_project\venv\lib\site-packages\django\core\management\commands\runserver.py", line 118, in inner_run self.check(display_num_errors=True) File "C:\Users\IvanH\PycharmProjects\sare_project\venv\lib\site-packages\django\core\management\base.py", line 396, in check databases=databases, File "C:\Users\IvanH\PycharmProjects\sare_project\venv\lib\site-packages\django\core\checks\registry.py", line 70, in run_checks new_errors = check(app_configs=app_configs, databases=databases) File "C:\Users\IvanH\PycharmProjects\sare_project\venv\lib\site-packages\django\core\checks\urls.py", line 13, in check_url_config return check_resolver(resolver) File "C:\Users\IvanH\PycharmProjects\sare_project\venv\lib\site-packages\django\core\checks\urls.py", line 23, in check_resolver return check_method() File "C:\Users\IvanH\PycharmProjects\sare_project\venv\lib\site-packages\django\urls\resolvers.py", line 408, in check for pattern in self.url_patterns: File "C:\Users\IvanH\PycharmProjects\sare_project\venv\lib\site-packages\django\utils\functional.py", line 48, in __get__ res = instance.__dict__[self.name] = self.func(instance) File "C:\Users\IvanH\PycharmProjects\sare_project\venv\lib\site-packages\django\urls\resolvers.py", line …