I am working through the following YT vid on Django and Python as I am looking to make my first app and trying to learn how Django works:
https://www.youtube.com/watch?v=F5mRW0jo-U4
I am working on adding new views to an app called Pages and trying to import the views from that app, but for some reason keep getting:
NameError: 'views' is not defined. I am sure this is something small that I am missing due to my newness with python in general and importing. Here is my current code:
from django.contrib import admin
from django.urls import path
#from Pages import views
from Pages.views import homepage_view, toybox_view, lounge_view, gym_view
urlpatterns = [
path('', views.homepage_view, name='home'),
path('toybox/', views.toybox_view, name='toybox'),
path('lounge/', views.lounge_view, name='lounge'),
path('gym/', views.gym_view, name='gym'),
path('admin/', admin.site.urls),
]
The second 'from' statement is the one that does not work - the commented out statement does work, I was just trying to be more specific with my imports. I have the 'src' folder that has my project - DogtopiaWeb and two apps, Dogs, and Pages. Inside of the Pages app is the views.py that I am trying to import with the above from statement.
Any idea why it can't identify the views.py inside the Pages app directory? I am importing it into the urls.py that is inside of the DogopiaWeb project.
The first screenshot is my root directory with manage.py and the two apps and main project. Second screenshot is inside the "Pages" app showing the views.py file that the import is having trouble identifying.
Thanks!

