Monday, August 31, 2020

Re: URL configuration error for a beginner

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 <manalorama@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+unsubscribe@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.

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAGyqUuWCL6fBZbHbXaQGzgJo4H3av%2BSO12t6QLhyxxWx_L46gA%40mail.gmail.com.

No comments:

Post a Comment