# Tutorial page polls not working, no module named polls.url.

**URL:** <https://forum.djangoproject.com/t/tutorial-page-polls-not-working-no-module-named-polls-url/20469>\
**Category:** Getting Started\
**Created:** [April 24, 2023, 2:03am UTC](https://forum.djangoproject.com/t/tutorial-page-polls-not-working-no-module-named-polls-url/20469 "2023-04-24T02:03:22Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mabaran00](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/mabaran00/32/13398_2.png) [@mabaran00](https://forum.djangoproject.com/u/mabaran00)\
**Post date:** [April 24, 2023, 2:03am UTC](https://forum.djangoproject.com/t/tutorial-page-polls-not-working-no-module-named-polls-url/20469/1 "2023-04-24T02:03:22Z")

</div>

The tutorial works fine until the polls part, the absolute beginning of the polls part.

This is the error when following the instructions and files are saved.  
This is also running under windows.

my mysite\urls.py

```plaintext
from django.urls import include, path

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

```

my polls\polls\urls.py

```auto

from django.urls import path

from . import views

urlpatterns = [
    path("", views.index, name="index"),
]

```

my polls/polls.views.py

```auto
from django.http import HttpResponse

def index(request):
    return HttpResponse("Hello, world. You're at the polls index.")

```

\Diskstation\Mike\data\mysite\mysite\urls.py changed, reloading.  
Watching for file changes with StatReloader  
Performing system checks…

Exception in thread django-main-thread:  
Traceback (most recent call last):  
File “C:\Program Files\Python310\lib\threading.py”, line 1016, in \_bootstrap\_inner  
self.run()  
File “C:\Program Files\Python310\lib\threading.py”, line 953, in run  
self.\_target(\*self.\_args, \*\*self._kwargs)  
File “C:\Users\mikea\AppData\Roaming\Python\Python310\site-packages\django\utils\autoreload.py”, line 64, in wrapper  
fn(\*args, \*\*kwargs)  
File “C:\Users\mikea\AppData\Roaming\Python\Python310\site-packages\django\core\management\commands\runserver.py”, line 133, in inner\_run  
self.check(display\_num\_errors=True)  
File “C:\Users\mikea\AppData\Roaming\Python\Python310\site-packages\django\core\management\base.py”, line 485, in check  
all\_issues = checks.run\_checks(  
File “C:\Users\mikea\AppData\Roaming\Python\Python310\site-packages\django\core\checks\registry.py”, line 88, in run\_checks  
new\_errors = check(app\_configs=app\_configs, databases=databases)  
File “C:\Users\mikea\AppData\Roaming\Python\Python310\site-packages\django\core\checks\urls.py”, line 14, in check\_url\_config  
return check\_resolver(resolver)  
File “C:\Users\mikea\AppData\Roaming\Python\Python310\site-packages\django\core\checks\urls.py”, line 24, in check\_resolver  
return check\_method()  
File “C:\Users\mikea\AppData\Roaming\Python\Python310\site-packages\django\urls\resolvers.py”, line 494, in check  
for pattern in self.url\_patterns:  
File “C:\Users\mikea\AppData\Roaming\Python\Python310\site-packages\django\utils\functional.py”, line 57, in **get**  
res = instance. **dict** [self.name] = self.func(instance)  
File “C:\Users\mikea\AppData\Roaming\Python\Python310\site-packages\django\urls\resolvers.py”, line 715, in url\_patterns  
patterns = getattr(self.urlconf\_module, “urlpatterns”, self.urlconf\_module)  
File “C:\Users\mikea\AppData\Roaming\Python\Python310\site-packages\django\utils\functional.py”, line 57, in **get**  
res = instance. **dict** [self.name] = self.func(instance)  
File “C:\Users\mikea\AppData\Roaming\Python\Python310\site-packages\django\urls\resolvers.py”, line 708, in urlconf\_module  
return import\_module(self.urlconf\_name)  
File "C:\Program Files\Python310\lib\importlib\_init_.py", line 126, in import\_module  
return \_bootstrap.\_gcd\_import(name[level:], package, level)  
File “”, line 1050, in \_gcd\_import  
File “”, line 1027, in \_find\_and\_load  
File “”, line 1006, in \_find\_and\_load\_unlocked  
File “”, line 688, in \_load\_unlocked  
File “”, line 883, in exec\_module  
File “”, line 241, in _call\_with\_frames\_removed  
File “Y:\data\mysite\mysite\urls.py”, line 21, in   
path(“polls/”, include(“polls.urls”)),  
File “C:\Users\mikea\AppData\Roaming\Python\Python310\site-packages\django\urls\conf.py”, line 38, in include  
urlconf\_module = import\_module(urlconf\_module)  
File "C:\Program Files\Python310\lib\importlib\_init_.py", line 126, in import\_module  
return \_bootstrap.\_gcd\_import(name[level:], package, level)  
File “”, line 1050, in \_gcd\_import  
File “”, line 1027, in \_find\_and\_load  
File “”, line 1004, in \_find\_and\_load\_unlocked  
ModuleNotFoundError: No module named ‘polls.urls’

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [April 24, 2023, 3:14am UTC](https://forum.djangoproject.com/t/tutorial-page-polls-not-working-no-module-named-polls-url/20469/2 "2023-04-24T03:14:48Z")

</div>

> [@mabaran00](#):
>
> my polls/polls.views.py

Are you saying that the file name you have for your urls.py file in the polls directory is `polls.urls.py`? If so, that is incorrect. The file name is `urls.py`

---

<div class="post-metadata">

**Author:** ![mabaran00](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/mabaran00/32/13398_2.png) [@mabaran00](https://forum.djangoproject.com/u/mabaran00)\
**Post date:** [April 24, 2023, 3:29am UTC](https://forum.djangoproject.com/t/tutorial-page-polls-not-working-no-module-named-polls-url/20469/3 "2023-04-24T03:29:14Z")

</div>

No the file is polls\urls.py  
Edited the post.

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [April 24, 2023, 3:49am UTC](https://forum.djangoproject.com/t/tutorial-page-polls-not-working-no-module-named-polls-url/20469/4 "2023-04-24T03:49:27Z")

</div>

> [@mabaran00](#):
>
> my polls\polls\urls.py

Now you show it as being in two directories named polls? This is also incorrect. You should have this urls.py file in your polls directory, not inside a second directory named polls inside your polls directory.

---

<div class="post-metadata">

**Author:** ![mabaran00](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/mabaran00/32/13398_2.png) [@mabaran00](https://forum.djangoproject.com/u/mabaran00)\
**Post date:** [April 24, 2023, 3:58am UTC](https://forum.djangoproject.com/t/tutorial-page-polls-not-working-no-module-named-polls-url/20469/5 "2023-04-24T03:58:34Z")

</div>

The location of the file is Y:\data\mysite\polls\polls\>  
Is the second polls NOT supposed to be there?  
The mysite created 2 mysite directories as well.  
Y:\data\mysite\mysite\>  
According to the startproject it creates the 2 directories?

```auto
     mysite/
    manage.py
    mysite/
        __init__.py
        settings.py
        urls.py
        asgi.py
        wsgi.py

```

> **[Django](https://docs.djangoproject.com/en/4.2/intro/tutorial01/)**
>
> The web framework for perfectionists with deadlines.

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [April 24, 2023, 4:01am UTC](https://forum.djangoproject.com/t/tutorial-page-polls-not-working-no-module-named-polls-url/20469/6 "2023-04-24T04:01:36Z")

</div>

If \data\mysite is the base directory, then there should be a mysite and a polls directory in it. There would not be a polls directory in that polls directory.

---

<div class="post-metadata">

**Author:** ![mabaran00](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/mabaran00/32/13398_2.png) [@mabaran00](https://forum.djangoproject.com/u/mabaran00)\
**Post date:** [April 24, 2023, 4:07am UTC](https://forum.djangoproject.com/t/tutorial-page-polls-not-working-no-module-named-polls-url/20469/7 "2023-04-24T04:07:04Z")

</div>

I will have to start over. Thanks for redirecting me!  
I just realized/learned the difference between  
python -m django startproject  
and  
python -m django startapp

---

<div class="post-metadata">

**Author:** ![mabaran00](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/mabaran00/32/13398_2.png) [@mabaran00](https://forum.djangoproject.com/u/mabaran00)\
**Post date:** [April 24, 2023, 4:17am UTC](https://forum.djangoproject.com/t/tutorial-page-polls-not-working-no-module-named-polls-url/20469/8 "2023-04-24T04:17:20Z")

</div>

It is working properly now.  
Thank you!
