Including URLconf

50 views
Skip to first unread message

Alec Greenholdt

unread,
Mar 6, 2022, 7:24:44 PM3/6/22
to Django users
as described in the documentation i am putting this code in. as soon as i put in "path('polls/', include('polls.urls'))," i get the following error. Please help
Screenshot 2022-03-06 173046.png
Screenshot 2022-03-06 172909.png

Alec Greenholdt

unread,
Mar 6, 2022, 11:29:23 PM3/6/22
to Django users

if i try to migrate, this error pops up as well
Screenshot 2022-03-06 222834.png

David Crandell

unread,
Mar 7, 2022, 9:42:58 AM3/7/22
to Django users
Do you have the app imported in the settings.py?

Also try using the "app_name" var in each of your urls.py files.

Alec Greenholdt

unread,
Mar 7, 2022, 12:35:40 PM3/7/22
to Django users
this is the installed apps in settings.py I haven't touched it. i only did what it told me to do in the django tutorial documentation. as a reminder, I attached only things I have added since I created the project. i even tried to delete it all and redo it and I get the same issue
Screenshot 2022-03-07 112811.png
Screenshot 2022-03-07 113424.png
Screenshot 2022-03-07 113401.png

Justin Kpakpa

unread,
Mar 7, 2022, 8:31:20 PM3/7/22
to django...@googlegroups.com




Sent from my Galaxy
Visit your settings.py file and include the app in INSTALLED_APPS. Check if that works.

-------- Original message --------
From: Alec Greenholdt <alec...@gmail.com>
Date: 07/03/2022 00:24 (GMT+00:00)
To: Django users <django...@googlegroups.com>
Subject: Including URLconf

as described in the documentation i am putting this code in. as soon as i put in "path('polls/', include('polls.urls'))," i get the following error. Please help

--
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/51cb96bf-09ef-4e7c-8000-670b5f5b5b9an%40googlegroups.com.

David Crandell

unread,
Mar 7, 2022, 9:47:46 PM3/7/22
to Django users
That's definitely your problem. Include the app under INSTALLED_APPS - put "app_name.apps.AppNameConfig" with app_name being the name of your app.

Alec Greenholdt

unread,
Mar 7, 2022, 10:47:56 PM3/7/22
to Django users

this is what i did and it changed nothing. i also don't know what exactly you mean by app because I don't believe I ever created an app. as shown above the code  2 lines of code with polls is the only thing I've added as shown in the tutorial
Screenshot 2022-03-07 214123.png

John Dollosa

unread,
Mar 8, 2022, 8:12:23 AM3/8/22
to Django users
Question: Do you have a folder named polls in your project directory? And inside that directory there's an apps.py file? 

Alec Greenholdt

unread,
Mar 8, 2022, 8:55:08 AM3/8/22
to Django users
these are my folders. the only thing the tutorial had me create upon creation of the project and app was a urls.py file inside my "mainsite" folder. and I show in the code above what it had me add. those are the only things I have done
Screenshot 2022-03-08 074229.png

John Dollosa

unread,
Mar 8, 2022, 9:37:58 AM3/8/22
to Django users
Do you have a variable called PollsConfig inside this file (mainsite/apps.py
If yes,  can you change polls.apps.PollsConfig in your INSTALLED_APPS into mainsite.apps.PollsConfig
Reply all
Reply to author
Forward
0 new messages