Run Django with URL prefix (“subdirectory”) - App works, but URLs broken?

后端 未结 2 946
后悔当初
后悔当初 2020-12-16 02:03

Below are the relevant configuration files, also at http://dpaste.com/97213/ .

The apache config is currently working, because accessing \'example.com/\' shows me th

2条回答
  •  没有蜡笔的小新
    2020-12-16 02:22

    In your urls.py rename urlpatterns to base_urlpatterns; then add the followinig definition at the end of the same file:

    urlpatterns = patterns('',
        '^', include(base_urlpatterns), # iff you wish to maintain the un-prefixed URL's too
        '^your_prefix/', include(base_urlpatterns),
    )
    

提交回复
热议问题