Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Django Model class app.models.tasks doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS
I have this view and model setup for my Django site. When I run my page, I get the below error, and I have no idea why! If anyone can recommend what I can do to fix this, I will be very grateful! Can anyone help?? 'Model class app.models.tasks doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS. Here is the code from __future__ import unicode_literals from django.shortcuts import render, redirect from django.http import HttpResponse from django.contrib.auth import authenticate, login, logout from django.contrib import messages from django.http import * from django.shortcuts import render_to_response,redirect from django.template import RequestContext from django.contrib.auth.decorators import login_required from django.contrib.auth import authenticate, login, logout from django.contrib.auth.models import User from django.contrib.auth.forms import UserChangeForm from django.db.models import Q from django.db.models import Count from datetime import datetime from django.contrib.auth.forms import UserCreationForm from django.contrib.auth import update_session_auth_hash from django.contrib.auth.forms import PasswordChangeForm from datetime import date from .models import tasks def create_task(request): if request.method == 'POST': creator = request.user job_title = request.POST.get('job_title') skill_name = request.POST.get('skill_name') starting = request.POST.get('starting') description = request.POST.get('description') target_date = request.POST.get('target_date') i = tasks.objects.create(creator=creator, job_title=job_title, skill_name=skill_name, starting=starting, current=starting, description=description, target_date=target_date) messages.success(request, ('Skill created')) return redirect('index') I have this model: from django.db import models class tasks(models.Model): job_title = β¦ -
Why django update is not working in production server?
actually i updated the code for django version 1.11, but in server(azure), django version 1.9 was installed. so while running the application django 1.11 function throws error, says 'QuerySet' object has no attribute 'union', which is a django 1.11 function. installed the django 1.11 in virtualenv, but changes not reflected in code, while searching for a solution found some answers which says to restart the uwsgi and appache2(not for) service, restarted uwsgi and nginx for my case, still no change, and installed django 1.11 in outside the virtualenv, thats too not accepting.. below line is written in crontab for running the application... /usr/local/bin/lockrun --lockfile /tmp/np_prod.lock -- uwsgi --close-on-exec -s /tmp/uwsgi_np_prod.sock --chdir /var/www/html/nextpulse/NextPulse/backend/backend/ --pp .. -w backend.wsgi_prod -C666 -p 32 -H /var/www/html/nextpulse/NextPulse/backend/venv/ 1>> /tmp/np_log_prod 2>> /tmp/np_err_prod i expect the django 1.11 function works fine -
Database Schema Postgresql and django
How to design database with the following: - having one superadmin with multiple dept.'s - each dept. has its own admin but only superadmin has the right to make amyone admin and provide access privileges to add, edit and delete users in any dept - I want the schema design for the same using Postgresql as database and django rest framework as backend. Please comment if anyone knows how to implement this. -
I am unable to deploy my django 2.2 project due to a static files error
I am trying to deploy my Django 2.2 project with Keroku to see what it looks like during production, but it does not seem to work and I am finding it hard to debug the issue as there isn't solid instructions on static files settings. To give an understanding of my files and file structure here is a tree: . βββ apps β βββ __pycache__ β βββ cart β β βββ __pycache__ β β βββ migrations β β β βββ __pycache__ β β βββ static β β β βββ cart β β β βββ css β β β βββ img β β β βββ js β β β βββ scss β β βββ templates β β βββ cart β βββ products β β βββ __pycache__ β β βββ migrations β β β βββ __pycache__ β β βββ static β β β βββ products β β β βββ css β β β βββ img β β β βββ js β β β β βββ tools β β β βββ scss β β β βββ mixins β β β βββ utilities β β β βββ vendor β β βββ templates β β βββ products β βββ users β βββ __pycache__ β βββ β¦ -
How to return Django form validation errors via Ajax
I have been trying for weeks to see how I return validation errors defined in my forms.py and pass it to Ajax, I saw a couple of solutions online and thier Django versions are either too old or the Django and JS codes are too complicated. I want someone to help me out using code samples to demonstrate how this is achievable. I want both error messages coming from Django to displayed in my webpage as well as success message. Below is what I have done so far. forms.py from django import forms from django.contrib.auth.models import User from django.contrib.auth.forms import UserCreationForm class UserCreateForm(UserCreationForm): class Meta: model = User fields = ('username', 'first_name', 'last_name', 'email') def clean_email(self): email = self.cleaned_data['email'] if User.objects.filter(email=email).exists(): raise forms.ValidationError("Email already exists.") return email def clean(self): cleaned_data = super().clean() email = cleaned_data.get('email') vmail = cleaned_data.get('vemail') if email != vmail: raise forms.ValidationError('Your first email and second email must match') elif not email.endswith('@alabiansolutions.com'): raise forms.ValidationError('Please we need alabiansolution email') views.py from django.shortcuts import render from django.views.generic import ListView, View, CreateView from ajax_app.forms import UserCreateForm from django.urls import reverse_lazy # Create your views here. def user_create_view(request): if request.method == 'POST': user_form = UserCreateForm(request.POST) if user_form.is_valid(): user_form.save() else: user_form = UserCreateForm() β¦ -
Django save image data to database
I am new to Django. Default behavior of Django is to save images to "media" and only save image path to database. Is there any way to change this behavior and save the image data itself to an sql-server database? I have found some solutions but none of theme worked for me, like: 1) django-storages: I cannot find a complete example on how to implement this. I tried different things but I was not successful in making it work 2) use a binaryField: how can I have a custom field with a button to upload images from selected folder like for imageField and FileField? -
facing error in django admin inline with djongo db connector
I'm using the ArrayReferenceField instead of ManyToManyField because I'm using djongo as my database connector. I want this field to be shown as inline model in the django admin site. But I'm getting the error AttributeError: 'ArrayReferenceDescriptor' object has no attribute 'through'. I know that ArrayReferenceField does not create an intermediate model in the database. So how can I successfully show this field as inline in the django admin? My models: class Synonym(models.Model): base_name = models.CharField( blank=False, max_length=5000, verbose_name='Base Entity Value', help_text='The entity value for which you want to provide the synonym.', ) extra_name = models.CharField( blank=False, max_length=5000, verbose_name='A synonym', help_text='Synonyms of the base entity value.', ) class Meta: # abstract = True ordering = ['base_name'] def __str__(self): return self.base_name class qa(DirtyFieldsMixin, models.Model): synonyms = models.ArrayReferenceField( blank=True, null=True, to=Synonym, on_delete=models.SET_NULL, help_text='Synonyms of the entities of the question.', ) In admin.py: class SynonymInline(admin.TabularInline): model = qa.synonyms.through class SynonymAdmin(admin.ModelAdmin): inlines = [ SynonymInline, ] @admin.register(qa) class qaAdmin(admin.ModelAdmin): # form = qaModelForm list_display = ('question', 'answer', 'module', 'intent', 'display_entities_name') list_filter = ('module', 'intent', 'username',) inlines = [ SynonymInline, ] -
django-dynamic-formset shows "add" and "remove" buttons in the wrong place
My app was working fine yesterday. After I started playing with the .css properties in the browser , suddenly the django-dynamic-formset script is not working properly anymore. It shows "Add" and "Remove" buttons for each input in the form, instead of for each row. Please see the photo attached. {% load crispy_forms_tags %} {% load staticfiles %} {% load static %} <table> {{ formset.management_form|crispy }} {% for form in formset.forms %} <tr class="{% cycle 'row1' 'row2' %} formset_row-{{ formset.prefix }}"> {% for field in form.visible_fields %} <td> {# Include the hidden fields in the form #} {% if forloop.first %} {% for hidden in form.hidden_fields %} {{ hidden }} {% endfor %} {% endif %} {{ field.errors.as_ul }} {{ field|as_crispy_field }} </td> {% endfor %} </tr> {% endfor %} </table> <!-- <p class='btn btn-warning' id='agregar'>Agregar PosiciΓ³n</p> --> <br> <script type="text/javascript" src="{% static 'admin/js/vendor/jquery/jquery.js' %}"></script> {{formset.media}} <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> <script src="{% static 'dynamic_formsets/jquery.formset.js' %}"></script> <script type="text/javascript" src="http://dal-yourlabs.rhcloud.com/static/collected/admin/js/vendor/jquery/jquery.js"></script> <!-- <script type="text/javascript"> $('#agregar').on('click',function(){ $('.formset-test').append() }); </script> --> <script type="text/javascript"> $('.formset_row-{{ formset.prefix }}').formset({ addText: 'Agregar posiciΓ³n', deleteText: 'Borrar posiciΓ³n', prefix: '{{ formset.prefix }}', }); </script>` Also, its not respecting the renaming I gave (see script at the end of the code). Instead of the "Agregar β¦ -
optional field with path django
I've created this url with re_path in django 2.2. This way the v1/ part of the url would be optional. how can I achieve this using path? re_path( r'^(v1/)?invoices/$', api.InvoicesAPIView.as_view(), name='invoices' ), -
Not able to connect mysql with django
I am not able to connect mysql with django. Each time i unistall mysql i face this problem and i stuck there for 2,3 hours becuse of two things one solved and i want this one to be solved. I have to google a lot then only i found the answer. Please someone tell me how to solve this because this is so irritating sometime. How to solve this folllowing **super(Connection, self).init(*args, **kwargs2) django.db.utils.OperationalError: (1698, "Access denied for user 'root'@'localhost'") ** -
Javascript CSS DarkMode Script for Django Website with HTML UI KIT Template
I'm absolutely frustrated right now I don't understand the world anymore... I have a Button in HTML that triggers a Javascript code that should add the CSS Tag ".dark" to given HTML tags. But it's curiously only working for the background on all sites. And even more curiously the h2 text tag on the start page changes to white but the h1 text tag on a subsite doe not change to white as I switch on dark mode. And then even if I delete another tag hardcoded in the HTML and even if I close and reopen 2 different browsers after that and then reopen the website in a new incognito window, the hard deleted code is still there, how is this even possible? Button <li class="nav-item"> <a class="nav-link icon d-flex align-items-center" href="#" onclick="DarkMode()"><i class="ion-ios-contrast mr-2"></i></a> </li> Javascript <script> document.addEventListener('DOMContentLoaded', (event) => { ((localStorage.getItem('mode') || 'dark') === 'dark') ? document.querySelector('body').classList.add('dark') : document.querySelector('body').classList.remove('dark') ((localStorage.getItem('mode') || 'dark') === 'dark') ? document.querySelector('h1').classList.add('dark') : document.querySelector('h1').classList.remove('dark') ((localStorage.getItem('mode') || 'dark') === 'dark') ? document.querySelector('h2').classList.add('dark') : document.querySelector('h2').classList.remove('dark') ((localStorage.getItem('mode') || 'dark') === 'dark') ? document.querySelector('a').classList.add('dark') : document.querySelector('a').classList.remove('dark') ((localStorage.getItem('mode') || 'dark') === 'dark') ? document.querySelector('table').classList.add('dark') : document.querySelector('table').classList.remove('dark') }) function DarkMode() { localStorage.setItem('mode', (localStorage.getItem('mode') || 'dark') === 'dark' ? 'light' β¦ -
how celery_always_eager=True works?
in celery doc it says all tasks will be executed **locally** by blocking until.... what does locally mean here. Does it run the task using the workers of the main server where app is running or it sends the task directly to celery worker running remotely https://docs.celeryproject.org/en/4.0/userguide/configuration.html#std:setting-task_always_eager -
Value Error in submitting a form in django
When I try to save the form by clicking the button it gives an value error on POST method in the product. Here is the code of the view, I think it's on the product=Product.objects.get(id=product_id), I've tried other variables but it's not working class LoanApplicationCreateView(AtomicMixin, TemplateView): template_name = 'products/create_loan_application.html' model = LoanApplication form_class = LoanApplicationCreateForm def get_object(self, queryset=None): """Get loan application request object.""" return self.model.objects.get(id=self.kwargs.get('id')) def get_context_data(self, business_id, **kwargs): """Get new loan application form view.""" context = super().get_context_data(**kwargs) context = dict() context = super(LoanApplicationCreateView, self).get_context_data(**kwargs) context['page_name'] = 'new loan application' context['title'] = 'Add Loan Application' borrower_business = get_object_or_404(Business, pk=business_id) context['borrower_business_id'] = borrower_business.id context['borrower_business_name'] = borrower_business.business_name data = {'borrower_business': borrower_business} context['loan_application_form'] = LoanApplicationCreateForm(data=data) products = Product.objects.all().values_list('id', 'product_type') product_name = Product.objects.all().values_list('product_name') context['product_list'] = json.dumps(list(products), cls=DjangoJSONEncoder) return context def post(self, request, business_id): loan_application_form = LoanApplicationCreateForm(data=request.POST) product_id = request.POST.get('product') product = Product.objects.get(id=product_id) if loan_application_form.is_valid(): loan_application_form.save() else: errors = '' for _, error in loan_application_form.errors.items(): errors = '{} {}'.format(errors, error) messages.error( request, 'Unable to create the Loan Application. {}'.format(errors), extra_tags='alert alert-danger' ) return HttpResponseRedirect(self.request.META.get('HTTP_REFERER')) I get this error... ValueError at /products/customer/add_loan_application/414c7d8f-c6e0-4121-940c-8e6dd6a321ec/ Cannot assign "'b724ec73-1e24-440b-a960-2c9972a40839'": "LoanApplication.product" must be a "Product" instance. -
Query easyaudit middleware model in Django
I'm using easyaudit to audit my Django CRUD and login operations. I would like to be able to access the easyaudit models with graphene queries so I can hook up to my frontend properly. I'm not even sure how to import the models from middleware? How do I do that? -
DRF Use serializer to validate body and serialize response
I have the following view in django which signs in a user and sends back the response after the user data has been serialized using a serializer. @api_view(['POST']) def sign_in(request): username = request.data['username'] password = request.data['password'] user = authenticate(username=username, password=password) if user is not None: update_last_login(None, user) # update the user's last login date serializer = UserSignInSerializer(user) return Response(serializer.data) return Response('Invalid login credentials', status=401) What I don't like about this view is the way I extract the username and password directly from the body. I'd like to use the same serializer to check if the body is valid. Is this possible or do I have to create a new serializer just to validate requests? Here's the existing serializer: class UserSignInSerializer(serializers.ModelSerializer): class Meta: model = User fields = ['first_name', 'last_name', 'email', 'username', 'profile'] -
Django CSV Import - Only importing first data row when using Γ¦, ΓΈ ,Γ₯ (danish characters) and spaces
I have made a system in Django with a CSV import implementation. However when the first column of the data contains danish special characters Γ, Γ and Γ or spaces it only inserts the first data row. I read that the csv module in Python that I'm using does not support Unicode input. I have provided the code below for the function that connects the csv file with Database Model in Django. Note: Database is made in Mysql views.py def opret_hold(request): prompt = { "hold": "RΓ¦kkefΓΈlgen pΓ₯ inholdet af din .csv fil skal vΓ¦re: ma, fornavn, efternavn, hold, deling" } if request.method == 'GET': return render(request, 'evalsys/admin/upload/opret_hold.html', prompt) try: csv_file = request.FILES['file'] if not csv_file.name.endswith('.csv'): messages.warning(request, 'Dette er ikke en .csv fil.') data_set = csv_file.read().decode("utf-8") io_string = io.StringIO(data_set) for row in csv.reader(io_string, delimiter=','): for column in csv.reader(io_string, delimiter=','): __, created = Hold.objects.get_or_create( holdnavn=column[0], slug=column[0], ) created = Medarbejder.objects.get_or_create( delingnavn_id=column[1], slug=column[2], ma=column[2], fornavn=column[3], efternavn=column[4], holdnavn_id=Hold.objects.get(pk=(column[0])), ) if request.method == 'POST' and HttpResponse.status_code == 200: messages.success(request, "Hold oprettet.") finally: context = {} return render(request, 'evalsys/admin/upload/opret_hold.html', context) opret_hold.html <form method="post" enctype="multipart/form-data"> {% csrf_token %} <input type="file" name="file" required> <p>Dette system acceptere kun .csv filer.</p> <button type="submit" class="btn" id="generel-btn">Upload</button> <br> </form> -
python interpreter not found for Django project after re-installing python
I have made an application using Django in pycharmIDE.after completing my project I deleted python from my machine and re-installed now when I run my application it shows No Python at 'C:\Users\Raisan\AppData\Local\Programs\Python\Python37-32\python.exe' how can I set python interpreter in Pycharm -
I'm Suffering with the problem in my django code for uploading the code of the image into the database?
Whenever i tried to upload the image through the form it gives me an error which is multivalue dictionary key error. GIVEN BELOW..... and this image will show on the other side of the project let's say user side. Any hints MultiValueDictKeyError at /hosteladmin/messfood 'photo' Request Method: POST Request URL: http://127.0.0.1:8000/hosteladmin/messfood Django Version: 2.2.4 Exception Type: MultiValueDictKeyError Exception Value: 'photo' Exception Location: C:\Users\lenovo\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\utils\datastructures.py in __getitem__, line 80 Python Executable: C:\Users\lenovo\AppData\Local\Programs\Python\Python37-32\python.exe Python Version: 3.7.4 Python Path: ['D:\\django project\\hostel_final', 'C:\\Users\\lenovo\\AppData\\Local\\Programs\\Python\\Python37-32\\python37.zip', 'C:\\Users\\lenovo\\AppData\\Local\\Programs\\Python\\Python37-32\\DLLs', 'C:\\Users\\lenovo\\AppData\\Local\\Programs\\Python\\Python37-32\\lib', 'C:\\Users\\lenovo\\AppData\\Local\\Programs\\Python\\Python37-32', 'C:\\Users\\lenovo\\AppData\\Roaming\\Python\\Python37\\site-packages', 'C:\\Users\\lenovo\\AppData\\Local\\Programs\\Python\\Python37-32\\lib\\site-packages', 'C:\\Users\\lenovo\\AppData\\Local\\Programs\\Python\\Python37-32\\lib\\site-packages\\win32', 'C:\\Users\\lenovo\\AppData\\Local\\Programs\\Python\\Python37-32\\lib\\site-packages\\win32\\lib', 'C:\\Users\\lenovo\\AppData\\Local\\Programs\\Python\\Python37-32\\lib\\site-packages\\Pythonwin'] Server time: Mon, 11 Nov 2019 10:07:52 +0000 Please Help me out on this,i shall be very thankfull VIEWS FILE CODE:- def messfood(request): if request.method=="POST": dn=request.POST['name'] dp=request.POST['price'] ft=request.POST['dfgtime'] fd=request.POST['sdday'] s=Fooddetials() s.dimage = request.FILES["photo"] s.dname=dn s.dprice=dp s.food_timing=ft s.food_day=fd s.save() return render(request,'hosteladmin/messfood.html') else: return render(request,'hosteladmin/messfood.html') HTML FORM CODE:- <div class="row"> <div class="col-md-12"> <label class="bmd-label-floating">Dish Image</label> <div class="col-md-6 col-sm-6 col-xs-12"> <input type="file" name="photo"> </div> </div> </div> MODELS FILE CODE:- class Fooddetials(models.Model): dimage=models.ImageField(upload_to='fooddetails/') dname=models.CharField(max_length=200) dprice=models.CharField(max_length=200) food_timing=models.CharField(max_length=200) food_day=models.CharField(max_length=200,default="") ROOT DIRECTORY IN SETTINGS OF THE PROJECT:- MEDIA_ROOT = os.path.join(BASE_DIR, 'media') MEDIA_URL = '/media/' -
Django composite primary key for a friendship table without using User
I have done this: class Person(models.Model): name = models.CharField(max_length=100, unique=True) address = models.TextField(max_length=1000) class Following(models.Model): following_id = models.AutoField(primary_key=True) person_id = models.ForeignKey('Person', on_delete=models.CASCADE, related_name='child') follower_id = models.ForeignKey('Person', on_delete=models.CASCADE, related_name='father') class Meta: unique_together = (("person_id", "follower_id"),) I will get error if I don't set Null=True in foreign keys, if I set it to True then it creates a Following table like this: id person_id follower_id 1 Null 2 10 Null 1 This is the way that I add data to it: Following(Person.objects.get(pk=1).id, Person.objects.get(pk=2).id) I just want to have a composite PK out of both FKs. It makes the first item as PK, second item as FK follower_id and Null for person_id. Is there any way to make it like this: id person_id follower_id 1 1 2 2 10 1 -
Creating a response array in Django rest frame work
Need a help in generating this response array in Django rest frame work, please help. { "userid":"1", "JsonArray":[ { "category_id":"1", "preference":[ { "sub_category_id":"3" }, { "sub_category_id":"1" } ] }, { "category_id":"2", "preference":[ { "sub_category_id":"2" }, { "sub_category_id":"4" } ] } ] } -
Angular 8 Reactive form Post Data not saving on Django Rest API
created a django rest api that is working fine. Built an angular 8 app that handle form submissions for tabs with and without radio buttons. register.component.ts file import { Component, OnInit } from '@angular/core'; import { Rider } from 'src/app/rider'; import { DataService } from 'src/app/data.service'; import { FormGroup, FormControl, FormBuilder } from '@angular/forms'; @Component({ selector: 'app-register', templateUrl: './register.component.html', styleUrls: ['./register.component.css'] }) export class RegisterComponent implements OnInit { riderForm:FormGroup; resForm:FormGroup; rider: Rider; restaurant: Restaurant; submitted = false; constructor(private dataService: DataService, private fb: FormBuilder) { } ngOnInit() { this.resForm= this.fb.group({ name: [''], first_name: [''], email: [''], contact: [''], city: [''], delivery: [''], }); this.riderForm=this.fb.group({ first_name: [''], other_name: [''], contact: [''], city: [''], }); } newRider():void{ this.submitted=false; this.rider=new Rider(); } saveRes(){ this.dataService.addRestaurant(this.restaurant).subscribe( data => { console.log(data); }, error => console.log(error) ); } saveRider(){ console.log(this.riderForm.value); this.dataService.addRider(this.riderForm.value).subscribe( resp => { console.log('success',resp); this.submitted=true; }, error => console.log(error)); } onSubmitRider(){this.saveRider(); } } the data service file is working as at the time of publishing this question, i dont know why the post data is not saving on django rest API server i created but the form values are displaying on the browser developer console. this the service file for the angular app, data.service.ts import { Injectable β¦ -
django how to use prefetch_related() to fetch a foreignkey's related_name
django how to use prefetch_related() to fetch a foreignkey's related_name class B(models.Models): pass class A(models.Models): b = models.ForeignKey(B) class C(models.Models): b = models.ForeignKey(B, related_name='related_c') Expected result: I tried like this, but failed a_data = A.objects.prefetch_related('b__related_c') for a in a_data: all_c_by_b = a.b.related_c.all() c_obj = all_c_by_b.first() # i dont want hit database print(c_obj) -
I'm getting an SSL Error when sending email via Django
ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:852) This is what I see in the error log whenever I run my Django webpage. I'm hosting it with Apache. On the page I see a 500: Internal Server Error. My Email config is as follows: #Email settings EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' EMAIL_HOST = 'outlook.office365.com' EMAIL_USE_SSL = True EMAIL_PORT = 587 EMAIL_HOST_USER = '****@**************.com' EMAIL_HOST_PASSWORD = '********' and my send_mail code is as follows: send_mail( 'Subject here', 'Here is the message.', '***************@**************.com', ['****@**************.com'], fail_silently=False, ) -
Work with Json files in Django (Static files)
I want to work with json files in my project but it crashes. I read that my json file has to be inside the static folder. Thus I create inside this folder a new one called "data" and I put the file inside. Furthermore I saw that some people has to add inside the settings.py the following code line and I did it too. STATICFILES_DIRS =[ os.path.join(BASE_DIR, 'static'), ] I don't know what can I do more, I don't know if the file is in a wrong path or if I have to do something more. The error is the following: [Errno 2] No such file or directory: 'data/arxiu.json' Can someone help me please? Code (views.py): from django.shortcuts import render import pandas as pd import json def coordenadas(request): lat = 9.1234567 lon = 12.1234567 code = obtener_datos() ctx = {'Lat':lat,'Lon':lon, 'code':code} return render(request,'map.html', ctx) def obtener_datos(): code = 0 with open('data/arxiu.json') as file: file = json.load(file) return code When I delete the two json lines the program works, accordingly the problem is here. -
Django Server Can't Be Accessed From LocalHost
Im really not sure what the problem is. I've tried several other solutions I've found online, even tried playing with my antivirus. Its just not coming up for me in the localhost. Any other solutions or possible problems? Tried using different localhost extensions Tried disabling ad block Added localhost to secure sites for McAfee Mode LastWriteTime Length Name Django version 2.2.7, using settings 'pythonwebsite.settings' Starting development server at http://127.0.0.1:8000/ Quit the server with CTRL-BREAK. Error: [WinError 10013] An attempt was made to access a socket in a way forbidden by its access permissions I expect to see the success message when accessing localhost