Django URLS, how to map root to app?

后端 未结 7 983
迷失自我
迷失自我 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:09

    As I didn't see any answer for django 2.0 I thought I'll provide one. you have to use '' as the root url. Here is an example from django 2.0 docs

    urlpatterns = [
        path('', main_views.homepage),
        path('help/', include('apps.help.urls')),
        path('credit/', include(extra_patterns)),
    ]
    

提交回复
热议问题