Django URLS, how to map root to app?

后端 未结 7 1001
迷失自我
迷失自我 2021-01-30 08:43

I am pretty new to django but experienced in Python and java web programming with different frameworks. I have made myself a nice little django app, but I cant seem to make it m

7条回答
  •  长发绾君心
    2021-01-30 09:13

    Just put an empty raw regular expression: r''

    I tested here and it worked perfectly.

    urlpatterns = patterns('',
        url(r'', include('homepage.urls')),
        url(r'^homepage/', include('homepage.urls')),
        url(r'^admin/', include(admin.site.urls)),
    )
    

    Hope it help!

提交回复
热议问题