Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

django

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

like image 426
nebula_007 Avatar asked Dec 21 '25 00:12

nebula_007


1 Answers

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.

like image 59
Helio Meira Lins Avatar answered Dec 23 '25 18:12

Helio Meira Lins



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!