I'm new to Django and am trying to create a very simple app off of a tutorial I found online.
Working on a mac
Django Version 2.0.7
Python 3.7.0
My file structure:
helloworld
......venv
..........(other files)
......helloworld_project
..........(other files)
......manage.py
......pages
.........._ pycache _
..............otherfiles
..........admin.py
..........apps.py
..........migrations
..............(other files)
..........models.py
..........tests.py
..........urls.py
..........views.py
The problem: when I run my urls.py file, I get the following message:
Traceback (most recent call last):
File "/Users/Bethany/Desktop/helloworld/pages/urls.py",
line 3, in <module>
from pages import views
ModuleNotFoundError: No module named 'pages'
My urls.py file:
# pages/urls.py
from django.urls import path
from pages import views
urlpatterns = [
path('', views.homePageView, name='home')
]
I've tried replacing "from pages import views" with "from . import views" and get the same message.
I've looked through a few similar questions on stack overflow, but haven't had success with finding a solution to fix my issue. does anyone have any suggestions?
Thanks!
If needed, this is the tutorial I'm following: https://djangoforbeginners.com/hello-world/
pages
to yourINSTALLED_APPS
insettings.py
as described in that tutorial? – Selcuk__init__.py
inpages
folder? – Selcuk