Hi, I in my project wanted to structure everything in a directory called main and have more directories for more options.
For example for views I have a views directory and I called for example the function pages_views.py and there I would like to put the return of the pages.
When I access, however, I receive an error
AttributeError: module 'main.views' has no attribute 'pages_views'
This is the directory
And this is the function
from django.contrib import admin
from django.urls import path
from django.urls import include
from rest_framework_jwt.views import obtain_jwt_token
from . import views
urlpatterns = [
path('', views.pages_views.index, name='index'),
]
And url acceses
from django.contrib import admin
from django.urls import path
from django.urls import include
from rest_framework_jwt.views import obtain_jwt_token
from . import views
urlpatterns = [
path('', include('main.urls')),
path('admin/', admin.site.urls)
]
It’s the first time I use django and I don’t know if it’s the best structure as a project, to have directories for all the functions, but I coming from laravel would do so.
How could I make the accesses?
