0
votes

Here I am creating my first Django application that is basically a polls app. I have followed these steps:

  • Created a django app in pycharm.

  • Wrote two tables in models.py.

  • Done "python manage.py makemigrations".

  • It successfully created my migrations.

  • Done "python manage.py createsuperuser", set its username and
    password.

  • Now doing, "python manage.py runserver", Its opening great.

Issue: When hitting "http://127.0.0.1:8000/admin/", server just stops. No error and nothing happens. I don't understand that why I am not being able to hit the url.

urls.py

from django.contrib import admin
from django.urls import path

urlpatterns = [
    path('admin/', admin.site.urls),
]

Server state while quitting:


C:\Users\Maha Waqar\PycharmProjects\DjangoSites>python manage.py runserver
Watching for file changes with StatReloader
Performing system checks...

System check identified no issues (0 silenced).
March 09, 2020 - 21:40:44
Django version 3.0.4, using settings 'DjangoSites.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
[09/Mar/2020 21:41:20] "GET / HTTP/1.1" 200 16351

C:\Users\Maha Waqar\PycharmProjects\DjangoSites>

My folder hirearchy:

DjangoSites //root folder

->DjangoSites

->mysite //current app I am working in
1
python manage.py migrate make sure you not only make the migration file, but you also apply them. Although I'm surprised there's no error message. - GTBebbo
1) I'm assuming you made both the project, and the app. 2) Do an initial migration right after you make the project and the app 3) Make your 2 new models in the app models.py file 4) Make migrations 5) Migrate - dfundako
What are your Django and python versions? - Hajar
@Hajar python 3.7, django 3.0.4 - Dandy Mandy
Try to upgrade to python 3.8 and see if it works. - Hajar

1 Answers

1
votes

It's a bug and can be fixed by upgrade to python 3.8. https://code.djangoproject.com/ticket/31092