Django development server stops after logging into admin

2024/10/8 0:31:54

I have installed django 3.0 in python 3.7 and started a basic django project. I have created a superuser and run the development server using python manage.py runserver. When I go to localhost:8000/admin it shows me ui to login after I entered my credentials it redirects back to localhost:8000/admin but at that time server stops running without any error on console.

The last message I see in log file is

(0.002) SELECT "django_session"."session_key", "django_session"."session_data", "django_session"."expire_date" FROM "django_session" WHERE ("django_session"."expire_date" > '2019-12-11T08:52:16.929697+00:00'::timestamptz AND "django_session"."session_key" = 'tqpcf2gv6iqatc42pdmz6zdjpy7iri37') LIMIT 21; args=(datetime.datetime(2019, 12, 11, 8, 52, 16, 929697, tzinfo=<UTC>), 'tqpcf2gv6iqatc42pdmz6zdjpy7iri37')
(0.002) SELECT "auth_user"."id", "auth_user"."password", "auth_user"."last_login", "auth_user"."is_superuser", "auth_user"."username", "auth_user"."first_name", "auth_user"."last_name", "auth_user"."email", "auth_user"."is_staff", "auth_user"."is_active", "auth_user"."date_joined" FROM "auth_user" WHERE "auth_user"."id" = 1 LIMIT 21; args=(1,)

Has someone faced this issue? What could be the solution?

EDIT: I found someone faced same issue in reddit looks like this is a bug in django

Uninstalling django then installing django 2.2.8 with pip install "django>=2.2,<3" helped.

Answer

Check up your python version. It should be 3.8+ for Django 3.0. I had the same problem when I was using python 3.7.

https://en.xdnf.cn/q/70183.html

Related Q&A

fastai.fastcore patch decorator vs simple monkey-patching

Im trying to understand the value-added of using fastais fastcore.basics.patch_to decorator. Heres the fastcore way: from fastcore.basics import patch_toclass _T3(int):pass@patch_to(_T3) def func1(self…

Adding user to group on creation in Django

Im looking to add a User to a group only if a field of this User is specified as True once the User is created. Every User that is created would have a UserProfile associated with it. Would this be the…

imgradient matlab equivalent in Python

I am searching for an imgradient MATLAB equivalent in Python. I am aware of cv2.Sobel() and cv2.Laplacian() but it doesnt work as imgradient works in MATLAB. If I could get source code of imgradient.m…

Error: astype() got an unexpected keyword argument categories

df = pd.DataFrame([A+, A, A-, B+, B, B-, C+, C, C-, D+, D],index=[excellent, excellent, excellent, good, good, good, ok, ok, ok, poor, poor])df.rename(columns={0: Grades}, inplace=True)dfI am trying to…

python: regular expression search pattern for binary files (half a byte)

I am using the following regular expression pattern for searching 0xDEAD4FAD in a binary file:my_pattern = re.compile(b"\xDE\xAD\x4F\xAD")but how do I generalize the search pattern for search…

pandas: selecting rows in a specific time window

I have a dataset of samples covering multiple days, all with a timestamp. I want to select rows within a specific time window. E.g. all rows that were generated between 1pm and 3 pm every day.This is a…

How to visualize (dendrogram) a dictionary of hierarchical items?

This is my first time of doing visualization from hierarchical data in dictionary format with Python. Last part of the data looks like this:d = {^2820: [^391, ^1024], ^2821: [^759, w, ^118, ^51], ^2822…

How to unfocus (blur) Python-gi GTK+3 window on Linux

What I want to do and whyI want my window to unfocus, so the previous focused window is selected.Why? I want to interact with the previously selected window (from other programs). My current plan is: …

SyntaxError: multiple exception types must be parenthesized

I am a beginner and have a problem after installing pycaw for the audio control using python, on putting the basic initialization code for pycaw, i get the following error:- Traceback (most recent call…

Python find difference between file paths

I have a bunch of file paths, such as:path1 = "./base/folder1/subfolder" path2 = "./base/folder2/"I am trying to write a function that can give me the relative difference between th…