'python manage.py startapp polls' doesn't generate urls.py in polls

162 views
Skip to first unread message

Julie Reier

unread,
Dec 7, 2020, 9:48:59 AM12/7/20
to Django users
Hi! I'm following the tutorial at https://docs.djangoproject.com/en/3.1/intro/tutorial01/.

When running the 'python manage.py startapp polls' command, the urls.py file is generated in the top level directory, but not in the polls directory. I even tried the tutorial a second time, naming the site 'secondsite'.

Here's the content:

manage.py

polls

secondsite


./polls:

__init__.py

admin.py

apps.py

migrations

models.py

tests.py

views.py


./polls/migrations:

__init__.py


./secondsite:

__init__.py

__pycache__

asgi.py

settings.py

urls.py

wsgi.py

./secondsite/__pycache__:

__init__.cpython-37.pyc

settings.cpython-37.pyc


Mohemed Misfar

unread,
Dec 7, 2020, 9:55:15 AM12/7/20
to django...@googlegroups.com
Good evening,
When u run the code python manage.py startapp, it wont create urls.py. You have to create it in your every apps after run that command. You will only have the urls.py file in your main app which has the settings.py. 
Thank you.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/055d1c5c-2a65-4bae-86a8-1ca1c86ddd97n%40googlegroups.com.

Julie Reier

unread,
Dec 7, 2020, 9:58:49 AM12/7/20
to Django users
Nevermind. I managed to create the missing file myself.
Reply all
Reply to author
Forward
0 new messages