Issue
I have been trying to make a django project, but I can't make an app.
python3 manage.py startapp app
In settings.py:
INSTALLED_APPS = [
'app',
<All other django.things>
]
In urls.py:
from django.urls import path, include
urlpatterns = [
path('app/', include('app.urls')),
path('admin/', admin.site.urls),
]
Note: These are exerpts
But I still get this error: ModuleNotFoundError: No module named 'app.urls'
Solution
Since you are pointing to 'app/urls' and there is no file called urls in your app folder, you externally have to create urls.py file in your app folder.
urls.py
from django.urls import path, include
from . import views
urlpatterns = [
path('', view.your_view_name),
]
Answered By - sunil ghimire
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.