Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Django urls.py not including the path

I’m relatively new to python and trying to make a django app. Can someone explain me why I’m running in to this issue with the include statement? The sql server says no module named ‘website’. I think the problem is with the project structure, but I could not understand how to fix it.

urls.py file in website folder

urls.py  file in crm folder

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

It’s just a typo error and a missing import.

from django.contrib import admin
from django.urls import path, include

# First, import your urls file
# Note that urls end with "s"
from website import url as website_urls

urlpatterns = [
    path('admin/', admin.site.urls,

    # Then, just include it
    path('', include(website_urls))
]

Note: Next time, please post code not screenshots.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading