nebula_007
nebula_007

Reputation: 181

Django default root page stops working when I add my app to urlpatterns in urls.py

I am new to Django and only followed one tutorial on Visual Studio which worked fine. Now I was trying to create another project on PyCharm and am facing the below problem.

the default Django template sets up fine in Pycharm and I see the default root/landing page when I run the project.

but the moment I add a url for my app in urls.py the default Django page stops working, although both the admin url and myapp urls work fine.

my Urlspatterns is provided below:

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^myapp/', include('myapp.urls', namespace='myapp')), 
]

the moment I remove the line the default Django landing page starts working again. I have tried searching online but was unable to find an explanation. Posting it here because I would really like to know why this happens.

enter image description here

Upvotes: 3

Views: 1074

Answers (1)

Helio Meira Lins
Helio Meira Lins

Reputation: 46

enter image description here

This page is intended only to show that django is working properly. As soon as you add any url it is disabled.

Upvotes: 2

Related Questions