开发者

How to relocate the django admin site below root?

开发者 https://www.devze.com 2023-02-27 21:25 出处:网络
The contrib admin site of Django is a perfect starting point for simple in-house applications that lots of people use.

The contrib admin site of Django is a perfect starting point for simple in-house applications that lots of people use.

I've done a bit of searching and seen the discussions of media and tools for working with and merging static media for the admin site. But it is still pretty fragmented and opaque.

Assume I have a site "mysite" with an application "myapp" that is derived from the admin app.

I 开发者_JS百科would really appreciate an example of relocating mysite and myapp, including the admin app, onto a web server where it is not at the root url.

I think this use case would flush out a lot of the issues and confusion that I see people have.


I think what you want to do is use the FORCE_SCRIPT_NAME = '/path/not/at/root/of/domain' option in your settings.py file. No trailing /.

http://docs.djangoproject.com/en/1.3/ref/settings/#force-script-name

I hope I'm understanding your question right and I hope this helps solve it.

Edit: oops gave link to old docs...updated with new docs version

Edit2: Here is another link describing this here at djangoproject again.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号