Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Show all the items in admin site (something interferes with the queryset)
Django 3.5.2 models, managers and mixins class ActiveManager(models.Manager): """ Select objects that are not archived. Ref.: omnibus.model_mixins.general.ArchivedMixin """ def get_queryset(self): result = super().get_queryset().filter(archived=False) return result class ArchivedMixin(models.Model): archived = models.BooleanField(verbose_name=gettext_lazy("Archived"), null=False, default=False, db_index=True, ) objects = models.Manager() active = ActiveManager() class Meta: abstract = True class ToSendManager(models.Manager): """ Select contacts to whom emails can be sent. """ def get_queryset(self): result = super().get_queryset().filter(archived=False).\ filter(bad_email=False).\ filter(being_actively_contacted=False).\ filter(paused=False) return result class Contact(CreatedMixin, FlagMixin, ModifiedMixin, CommentMixin, ArchivedMixin, models.Model): category = models.ForeignKey(Category, on_delete=models.PROTECT, ) region = models.ForeignKey(Region, on_delete=models.PROTECT, ) email = models.CharField(max_length=255, blank=True, default="", null=False, db_index=True, unique=True, ) bad_email = models.BooleanField(default=False) # Sent but Mailer Daemon announced an error, # or MX record is unproven or something else. being_actively_contacted = models.BooleanField(default=False) # If we are contacting actively by phone or somehow, # there is no need to send them mass emails. paused = models.BooleanField(default=False) # In this case a comment is neccessary. to_send = ToSendManager() def __str__(self): return self.email admin.py @admin.register(Contact) class AddressListAdmin(admin.ModelAdmin): exclude = [] list_display = ["email", "created", "modified", "archived", "bad_email", ] list_filter = ['email', "archived", "bad_email", ] Problem In the Admin site I have 528 objects. But in reality there are 576 of them. >>> len(Contact.objects.all()) 576 I believe that managers are … -
How to Django ORM update() multiple values nested inside a JSONField?
I have a Django JSONField on PostgreSQL which contains a dictionary, and I would like to use the queryset.update() to bulk update several keys with values. I know how to do it for one value: from django.db.models import Func, Value, CharField, FloatField, F, IntegerField class JSONBSet(Func): """ Update the value of a JSONField for a specific key. """ function = 'JSONB_SET' arity = 4 output_field = CharField() def __init__(self, field, path, value, create: bool = True): path = Value('{{{0}}}'.format(','.join(path))) create = Value(create) super().__init__(field, path, value, create) This seems to work - with some gaps as per my other question - like this: # This example sets the 'nestedkey' to numeric 199. queryset.update(inputs=JSONBSet('inputs', ['nestedkey_1'], Value("199"), False)) But if I now wanted to update a second nestedkey_2 inside the same inputs, I obviously cannot use the inputs argument twice like this: queryset.update(inputs=JSONBSet(...'nestedkey_1'...), inputs=JSONBSet(...'nestedkey_2'...) Is there a way to do this? -
django.core.exceptions.ImproperlyConfigured: WSGI application 'newsletterAPI.wsgi.application' could not be loaded; Error importing module
project name: newsletterAPI app name: newsletterApp after running python3 manage.py runserver getting the above error -
How to Django ORM update() a value nested inside a JSONField with a numeric value?
I have a Django JSONField on PostgreSQL which contains a dictionary, and I would like to use the queryset.update() to bulk update one (eventually, several) keys with a numeric (eventually, computed) values. I see there is discussion about adding better support for this and an old extension, but for now it seems I need a DIY approach. Relying on those references, this is what I came up with: from django.db.models import Func, Value, CharField, FloatField, F, IntegerField class JSONBSet(Func): """ Update the value of a JSONField for a specific key. """ function = 'JSONB_SET' arity = 4 output_field = CharField() def __init__(self, field, path, value, create: bool = True): path = Value('{{{0}}}'.format(','.join(path))) create = Value(create) super().__init__(field, path, value, create) This seems to work fine for non-computed "numeric string" values like this: # This example sets the 'nestedkey' to numeric 199. queryset.update(inputs=JSONBSet('inputs', ['nestedkey'], Value("199"), False)) and for carefully quoted strings: # This example sets the 'nestedkey' to 'some string'. queryset.update(inputs=JSONBSet('inputs', ['nestedkey'], Value('"some string"'), False)) But it does not work for a number: queryset.update(inputs=JSONBSet('inputs', ['nestedkey'], Value(1), False)) {ProgrammingError}function jsonb_set(jsonb, unknown, integer, boolean) does not exist LINE 1: UPDATE "paiyroll_payitem" SET "inputs" = JSONB_SET("paiyroll... ^ HINT: No function matches the given name and … -
Django - how do i save a generated pdf file into a FileField table automatically
I have the following code snippet: c.drawString(140, 160, 'Hello') c.setFont('Arial', 38) c.drawString(110, 260, 'Goodbye') c.showPage() c.save() buffer.seek(0) return FileResponse(buffer, as_attachment=True, filename='Hello.pdf') This seems to work fine and my browser downloads the pdf to my PC What i want to do is to automatically create the above pdf file and then save it into this model: class test_pdf(models.Model): date = models.DateField() file = models.FileField(upload_to='test/') I tried: c.drawString(140, 160, 'Hello') c.setFont('Arial', 38) c.drawString(110, 260, 'Goodbye') c.showPage() c.save() buffer.seek(0) tt = FileResponse(buffer, as_attachment=True, filename='Hello.pdf') aa = test_pdf(date=dat, file=tt) aa.save() But this didn't work. Also tried c.drawString(140, 160, 'Hello') c.setFont('Arial', 38) c.drawString(110, 260, 'Goodbye') c.showPage() c.save() buffer.seek(0) aa = test_pdf(date=dat, file=c) aa.save() Again didn't work, btw 'dat' was generated earlier in my code and works fine Any help much appreciated -
Application labels aren't unique, duplicates: rest_framework
on running, python3 manage.py runserver, getting folowing error app name is 'newsletterApp' raise ImproperlyConfigured( django.core.exceptions.ImproperlyConfigured: Application labels aren't unique, duplicates: rest_framework what is the reason -
After React + Django integration href is not working i used href instead of react router
I am integrating react js with django react framework i used href for navigating inside react but if integrate it with django the href are not working properly it is showing like this Page not found (404) Request URL: http://localhost:8000/costumercollection Using the URLconf defined in fin.urls, Django tried these URL patterns, in this order In react is used href like this <a href='/page2'> Get Records </a> -
Django MemcacheUnexpectedCloseError and [WinError 10061] No connection could be made because the target machine actively refused it
Hi I am new at django and trying to use django-cache to speed up page load that will list out 100 companies and their details per page but I am constantly running into errors. When I use the IP and Port from the django doc 127.0.0.1:11211 I get this error: Environment: Request Method: GET Request URL: http://127.0.0.1:8000/ Django Version: 3.2.4 Python Version: 3.9.1 Installed Applications: ('django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'debug_toolbar', 'mailer') Installed Middleware: ('django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'debug_toolbar.middleware.DebugToolbarMiddleware') Traceback (most recent call last): File "C:\Users\Rafin\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\handlers\exception.py", line 47, in inner response = get_response(request) File "C:\Users\Rafin\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\handlers\base.py", line 181, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "C:\Users\Rafin\AppData\Local\Programs\Python\Python39\lib\site-packages\django\utils\decorators.py", line 122, in _wrapped_view result = middleware.process_request(request) File "C:\Users\Rafin\AppData\Local\Programs\Python\Python39\lib\site-packages\django\middleware\cache.py", line 145, in process_request cache_key = get_cache_key(request, self.key_prefix, 'GET', cache=self.cache) File "C:\Users\Rafin\AppData\Local\Programs\Python\Python39\lib\site-packages\django\utils\cache.py", line 362, in get_cache_key headerlist = cache.get(cache_key) File "C:\Users\Rafin\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\cache\backends\memcached.py", line 77, in get return self._cache.get(key, default) File "C:\Users\Rafin\AppData\Local\Programs\Python\Python39\lib\site-packages\pymemcache\client\hash.py", line 361, in get return self._run_cmd('get', key, None, *args, **kwargs) File "C:\Users\Rafin\AppData\Local\Programs\Python\Python39\lib\site-packages\pymemcache\client\hash.py", line 334, in _run_cmd return self._safely_run_func( File "C:\Users\Rafin\AppData\Local\Programs\Python\Python39\lib\site-packages\pymemcache\client\hash.py", line 214, in _safely_run_func result = func(*args, **kwargs) File "C:\Users\Rafin\AppData\Local\Programs\Python\Python39\lib\site-packages\pymemcache\client\base.py", line 619, in get return self._fetch_cmd(b'get', [key], False).get(key, default) File "C:\Users\Rafin\AppData\Local\Programs\Python\Python39\lib\site-packages\pymemcache\client\base.py", line 1018, in _fetch_cmd self._connect() File "C:\Users\Rafin\AppData\Local\Programs\Python\Python39\lib\site-packages\pymemcache\client\base.py", line 420, in _connect … -
Can ngx_http_auth_basic_module be used for backends on different ports?
I can't add authentication system for the new backend for some reasons, so I want to check user authentication status from the old backend and give access for the new backend new endpoints if this user logged. So, can ngx_http_auth_basic_module be used for backends on different ports? Or is there a better practice? -
Getting an error while using bulk_create() method of Django
I'm trying to bulk create some entries using bulk_create() method of Django in the DB table. On the final step where I'm passing the created list over there getting an error TypeError: int() argument must be a string, a bytes-like object or a number, not 'tuple' and due to this obviously no records are getting saved. Below is the code through which I'm trying to save the records in the DB table. Class method @classmethod def mark_all_added(cls, id: int, spec_id: int) -> None: spec_ids = set( cls.objects.filter(spec_id=spec_id) .values_list("id") ) through_objects = [ cls.added_by.through(id=id, spec_id=sid) for sid in spec_ids ] cls.added_by.through.objects.bulk_create(through_objects) # getting error on this line Could someone please help in highlighting my mistake or tell me how to resolve this issue while saving bulk records. I know I have a done a silly mistake but am unable to trace it. Any kind of would be much appreciated. Thanks in advance. -
Why django throwing error like " 'function' object has no attribute 'order_set' "?
I have edited views.py and after that it is throwing error like the screenshot below. Here are the codes. /apps/views.py contains from django.shortcuts import render from django.http import HttpResponse from .models import * def customer(request, pk): customers = Customer.objects.get(id=pk) order = customer.order_set.all() context={'customers':customers, 'order':order} return render(request, 'accounts/customer.html',context) and /templates/apps/name.html contains this code to render data from models to templates. {% for i in order %} <tr> <td>{{i.product}}</td> <td>{{i.product.category}}</td> <td>{{i.date_created}}</td> <td>{{i.status}}</td> <td><a href="">Update</a></td> <td><a href="">Remove</a></td> </tr> {% endfor %} I think this error has something to do with order_ser in views.py but i am not sure how to fix it. -
How to host Django project using FTP or cPanel on Hostgator
I want to host a my django website on hostgator but i don't know how to host a website in hostgator How to host Django project using FTP or cPanel on Hostgator can you please me -
Giving error 500 instead of 404 when debug is False Django
myapp/urls.py: handler404 = 'blog.views.not_found' handler500 = 'blog.views.server_error' views: def not_found(request, exceptions): return render(request, 'error/404.html') def server_error(request): return render(request, 'error/500.html') settings.py: DEBUG = False ALLOWED_HOSTS = ['*'] TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [os.path.join(BASE_DIR, 'templates')], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ 'django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', 'staff.context_processors.staff_base', 'blog.context_processors.cart', 'blog.context_processors.setting', ], }, }, ] WSGI_APPLICATION = 'config.wsgi.application' 404.html: {% extends 'blog/base.html' %} {% load static %} {% block title %}400{% endblock title %} {% block content %} <p>404 Error</p> {% endblock content %} in DEBUG = True show me regular 404 error, but in DEBUG = False show me 500 instead of 404 I saw other topics about this issue but i couldn't find any thing to help me. -
Django sub template not appearing in outputted html
I'm working with django 1.10 and python 3.6 in win 10. In my main template (index.html) I have: <div class="col-lg-5 col-sm-6"> <div class="clearfix"></div> <h2 class="section-heading">We can help:</h2> {% block 'body' %} {% endblock %} </div> need3.html template: {% extends 'index.html' %} {% block 'body' %} <p><big>Hello, ...... {% endblock %} my code has: def index(request): form = MyForm() return render(request, 'index.html', {'form': form, 'hero_phrase': 'Would you be interested in x?','body':'need3.html'}) However as you can see in the screenshot need3 template does not show up. What am I doing wrong? -
mod_wsgi: ModuleNotFoundError: No module named "xxx"
There's about a hundred posts on this subject and none of them seem to have much rhyme or reason. My configuration: Trying to build a container via Podman with Apache + mod_wsgi (4.6.4) + Django, there is no virtualenv. Install of compiled libs via CentOS package repo binaries. Python 3.6 via CentOS repo binary. Install of pure python libs via pip, to --user (/home/user/.local) Project folders are in /home/apache, no need for anything static I'll push all of that to a CDN. The test file example from the docs works fine. Migrations and post-migration signals work fine. The dev server works fine with the current config. The only environment variable I have specified Django and base-Python related is DJANGO_SETTINGS_MODULE which is set correctly to my base settings file. Apache config, straight from the Django 3.2 docs: WSGIPythonPath /home/apache <VirtualHost *:8080> ServerName localhost WSGIScriptAlias / /home/apache/base/wsgi.py <Directory /home/apache/base> <Files wsgi.py> Require all granted </Files> </Directory> </VirtualHost> And the result: [ 09:20:57.757787 2021] [wsgi:error] [pid 5:tid 140007184484096] Traceback (most recent call last): [ 09:20:57.758173 2021] [wsgi:error] [pid 5:tid 140007184484096] File "/home/apache/base/wsgi.py", line 16, in <module> [ 09:20:57.758542 2021] [wsgi:error] [pid 5:tid 140007184484096] application = get_wsgi_application() [ 09:20:57.758740 2021] [wsgi:error] [pid 5:tid 140007184484096] … -
Why extra_kwargs is used if it can be replaced?
I am writing a project using django-rest-framework and while using serializers, I realized that most of the keywords in extra_kwargs like "required, read_only, write_only, etc." can be substituted by read_only_fields, write_only_fields, "required" in serializer fields, etc. Does extra_kwargs have some feature that is unique? -
Json Response's innerHTML is showing multiple times every time save button is clicked in browser
I am building a BlogApp and I am trying to save form without refresh the page, So i am using ajax and Everything is working fine - Form is submitting fine. I am showing user a success message using innerHTML when form is submit BUT when i click submit button multiple time then innerHTML is also showing multiple times. views.py def blog_post_form(request): if request.is_ajax and request.method == 'POST': form = BlogPostForm(request.POST) if form.is_valid(): instance = form.save(commit=False) instance.save() ser_instance = serializers.serialize('json',[ instance, ]) return JsonResponse({"instance": ser_instance}, status=200) else: return JsonResponse({"error": form.errors}, status=400) return JsonResponse({"error":""}, status=400) template.html <form id="blogpost-form"> {% csrf_token %} {{ form|crispy }} <input type="submit" class="btn btn-primary" value="Submit" /> <form> <div class="container-fluid"> <table class="table table-striped table-sm" id="success"> <tbody> </tbody> </table> </div> <script> $(document).ready(function () { $("#blogpost-form").submit(function (e) { e.preventDefault(); var serializedData = $(this).serialize(); $.ajax({ type: 'POST', url: "{% url 'blog_post_form' %}", data: serializedData, success: function (response) { var instance = JSON.parse(response["instance"]); var fields = instance[0]["fields"]; $("#success tbody").prepend( `<h2>SuccessFully Saved</h2>` ) }, error: function (response) { alert(response["responseJSON"]["error"]); } }) }) }) </script> I tried multiple times by changing div data but it is still showing multiple times. Any help would be Much Appreciated. Thank You in Advance. -
pick color by evaluating string condition
I Have a data like below, using python I need to check criteria key and update the color any possible easy way to do that ? where criteria might come with more conditions like < > = != etc. { "data":{ "data1"{ "p1"{ "pre":"x", "post":"y", "delta:"", "color":"z", "criteria""if X < 2 then Z='#FF0011' else Z='#00FF00'" }, "p2"{ "pre":"x", "post":"y", "delta:"", "color":"z", "criteria""if X <= 10 then Z='#FF0000' else Z='#00FF00'" }, "p2"{ "pre":"x", "post":"y", "delta:"", "color":"z", "criteria""if X < 10, y > 5 then Z='#FF0000' else Z='#00FF00'" }, "p2"{ "pre":"x", "post":"y", "delta:"", "color":"z", "criteria""if X =0, y >5 then Z='#FF0000' else Z='#00FF00'" }, } } } -
How to display one <ul> list into unlimited columns?
I'm using Django for backend and I want to display the below ul in unlimited columns with overflow-x : auto. <ul class="list"> {% for i in skills %} <li>{{i}}</li> {% endfor %} </ul> sample output: 1 7 . . . 2 8 . . . 3 9 . . . 4 10 . . . 5 11 . . . 6 12 . . . -
Delay Kubernetes Deployment from Python Client
I have a Django software that, using Kubernetes Official Client to interface with my kubernetes cluster and deploy pods. These pods are dockerized Scala SBT apps, and as soon as I launch them all together, it takes a lot of time to compile. Putting some time.sleep() will actually optimize the releases, but it will also delay the response.. And i have to avoid this. I'm trying to see about multiprocessing and actually works on a test file, which is: import time from multiprocessing import Pool def test1(): time.sleep(1) print("before test1: " + str(time.time())) time.sleep(3) print("after test1: " + str(time.time())) def test2(): print("before test2: " + str(time.time())) time.sleep(4) print("after test2: " + str(time.time())) def main(): print(time.time()) pool = Pool() result1 = pool.apply_async(test1) result2 = pool.apply_async(test2) result1.get() result2.get() main() Infact, the "after test1" and "after test2" will be executed at the same time. But when i transfer these statements where it's needed, it stops parallelizing. the structure of the test file is the same of where i need it. a def with the pool instanciating defs inside, and a sleep inside these defs. I also tried using other libraries, like threading, asyncio etc.. all worked fine in the test file. I was … -
Fields of QuerySet are not accessible from views.py in Django
I am trying to create a track report since past two weeks in which I'm constantly failing. I have 3 models, Student, Course and Fee. I want to create a report which will bring all the data contained by these 3 models, together, with an ID of its own. The models: class Student(models.Model): roll_number=models.IntegerField(primary_key=True) name=models.CharField(max_length=50) email=models.EmailField(max_length=60) city=models.CharField(max_length=20) class CourseChoices(models.Model): courses=models.CharField(max_length=30, blank=True) def __str__(self): return self.courses class Course(models.Model): roll_number=models.ForeignKey(Student, on_delete=CASCADE) course=models.ForeignKey(CourseChoices, on_delete=CASCADE) class Fee(models.Model): roll_number=models.ForeignKey(Student, on_delete=CASCADE) amount_to_be_paid=models.DecimalField(max_digits=7, decimal_places=2, default=0) discount=models.DecimalField(max_digits=5, decimal_places=2, default=0) Final_amount_to_be_paid=models.DecimalField(max_digits=5, decimal_places=2, default=0) Amount_received=models.DecimalField(max_digits=5, decimal_places=2, default=0) Balance=models.DecimalField(max_digits=5, decimal_places=2, default=0) batch=models.IntegerField() Now, a student may pay his/her fee in installments, so that will create multiple instances in the track report. I want the user to track each transaction with the primary key/id. Below is an example: One member here suggested me to create another model named Report: class Report(models.Model): id = models.CharField(max_length=7, primary_key=True) student = models.ForeignKey(Student, on_delete=models.CASCADE) course = models.ForeignKey(Course, on_delete=models.CASCADE) fee = models.ForeignKey(Fee, on_delete=models.CASCADE) def _get_next_id(self): last = self.objects.aggregate(max_id=models.Max('id'))['max_id'] if last is None: last = 1 self.id = "{}{:04d}".format('HB', last) def save(self, *args, **kwargs): if not self.id: self.id = self._get_next_id() super().save(*args, **kwargs) And then when the transaction happens - I save an additional instance of Report that contains links … -
python requests json argument not converted to URL parameters
I have a Django backend and can receive and respond to query parameters such when in URL: http://localhost:8000/stac_management/stac/search?bbox=115.378418,5.375398,127.199707,19.352611 When using python requests to send a POST, using the params argument also respond well since the query parameters are converted and passed into the url same as above. import requests import json #URL='https://api.ops.dev.phl-microsat.upd.edu.ph/stac_management/stac/search' URL='http://localhost:8000/stac_management/stac/search' payload = {'bbox': '115.378418,5.375398,127.199707,19.352611'} response = requests.post(URL, params=payload) print('url:', response.url) # url: http://localhost:8000/stac_management/stac/search?bbox=115.378418,5.375398,127.199707,19.352611 However, when I use the json argument for request the payload does not convert to query parameters. Thus my backend cannot receive a query parameter. response = requests.post(URL, json=payload) print('url:', response.url) # url: http://localhost:8000/stac_management/stac/search I am using a library that will POST to my backend and it is using the json argument for requests. I am having problem receiving the query parameters since what I get is None. I am using Django Viewset and expecting the bbox using: class SearchViewSet(viewsets.ViewSet): permission_classes = [AllowAny] def list(self, request): ... bbox = request.query_params.get('bbox', None) How can I receive a query parameter when using the json argument from requests into my Django app? Also the fix is should be within my backend since I cannot change the library for using json argument. -
Django and DevOps roadmap [closed]
Hey everybody I've been searching the whole internet for help in finding the roadmap for Django framework and DevOps engineer. I already read some docs and find some roadmaps like https://roadmap.sh/ but these documents are so general. in my case, I want to Grouping developers by their skill like when someone comes to our team I show them the learning roadmap and tell them due to this roadmap you are junior if you want to be a senior developer you must learn these things too. I know this method is not so good for measuring developers levels but this is the begging of my journey. I need your comments, sources, articles, or every other thing that can help me. in general, I want to make a roadmap for those who want to see their progress and can help themselves. by this you know if you learn other things it will help you be a better developer or DevOps and can find better job offers. thank you, all. -
OSError: [WinError 123] while installing allauth in django
The problem is so simple. I've installed django all auth, all based on documentation: Running pip install django-allauth on cmd Changing settings.py installed apps to: INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.sites', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'allauth', 'allauth.account', 'allauth.socialaccount', 'allauth.socialaccount.providers.google', 'allauth.socialaccount.providers.facebook', # Third party apps 'rest_framework', 'api', 'management', ] And then I cannot run the server, getting the below error: OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: '<frozen importlib._bootstrap>' What I have done to solve the problem: I searched several questions and realized there can be two reasons for this error: When the package is not installed. For this, I checked my virtual env packages using pip list and well, django-allauth is installed. When we got misspelling. For this one, I've just copied and pasted all required options directly from the documentations. There cannot be any misspelling. Any help is appreciated! -
How to resolve ValueError while deploying Django project on IIS?
On begining, i dont have experience in deploy on production, so please forgive my stupid question. What i have done: all steps from toturial https://www.youtube.com/watch?v=APCQ15YqqQ0&t=882s , it's call Default Web Site, and it works, by analogy i deploy my project called SLK but on port 81 on second web site, and tree looks like this: i change web.config for project SLK, moved it to main catalog C:\inetpub\wwwroot (at toturial was web.config maid for toturial project, i changed all entries for my project) turn off Default Web Site, turn on my and got this masage on IIS, on localhost:81: When i start project manualy in 127.0.0.1:8000 on Debug mode it's works. Please for sugestions and ideas Django ver 3.2 Python ver 3.9 Windows 10