Re: URL configuration error for a beginner

32 views
Skip to first unread message

Arpana Mehta

unread,
Aug 31, 2020, 7:52:27 PM8/31/20
to django...@googlegroups.com
You need to replace apps.url with the name of the app ( which you might have created using python manage.py startapp <appname> and have a urls.py file in that app folder)
 In the tutorial also, they first create an app 'polls' and then include 'polls.url'

It would be easier to solve your problem if you can post the directory structure here.

Regards,
Arpana

On Tue, 1 Sep 2020 at 04:29, Manal Helal <manal...@gmail.com> wrote:
Hi

I am using DJango to the first time and appreciate some explanation to the error I am receiving. I followed the steps in the polls app tutorial:


and getting the following error when running: python manage.py runserver

path('app/', include('app.urls')),

  File "/home/me/website/venv/lib/python3.8/site-packages/django/urls/conf.py", line 34, in include

    urlconf_module = import_module(urlconf_module)

  File "/home/me/opt/python-3.8.1/lib/python3.8/importlib/__init__.py", line 127, in import_module

    return _bootstrap._gcd_import(name[level:], package, level)

  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import

  File "<frozen importlib._bootstrap>", line 991, in _find_and_load

  File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked

ModuleNotFoundError: No module named 'app.urls'


I tried adding 

from app import views


but not working and I am obviously have a long way understanding the classes and directory structure of Django and appreciate a clarification to make things easier, 


thank you in advance


Manal


--
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/a0c75269-ad22-4860-b6bd-3b9f69b8cfd7n%40googlegroups.com.

Haris Ahmad

unread,
Sep 1, 2020, 12:27:55 AM9/1/20
to django...@googlegroups.com
Hello dear,

add that app in settings.py in installed apps
Eg. "base.apps.BaseAppConfig"
Or simply
"base" 

Kind regards Haris

maninder singh Kumar

unread,
Sep 2, 2020, 9:36:32 AM9/2/20
to django...@googlegroups.com
If its frozen, perhaps your server is not running


Reply all
Reply to author
Forward
0 new messages