开发者

Invalid admin login and logout urls when django-cms app is not mounted on root

开发者 https://www.devze.com 2023-02-17 02:11 出处:网络
I\'m using ModWsgi for deploying my app. I have a WSGIScriptAlias which points to my cms project. WSGIScriptAlias /cmsapp \"/home/hari/dev/cmsproj/apache/django.wsgi\"

I'm using ModWsgi for deploying my app. I have a WSGIScriptAlias which points to my cms project.

WSGIScriptAlias /cmsapp "/home/hari/dev/cmsproj/apache/django.wsgi"

I also have USE_I18N set to True in my settings, and I'm using django-cms' multilingual middleware.

I can access the admin login page via http://localhost/cmsapp/admin/. After I submit my credentials, I get a 404 as http://localhost/en/admin/ page is reached. Ideally I should visit http://localhost/cmsapp/en/admin/ - trying to visit this URL manually takes me to the admin panel.

Similarly, when I'm trying to logout from the admin panel, I get redirected to http://localhost/en/cmsapp/admin/logout/. If I remove 'en', I'm successfully logged out.

This is really strange. I feel that for these URLs, it appends language code after domain name, instead of appending it at the actual root. other relative URLs like http://loca开发者_Python百科lhost/cmsapp/en/admin/cms/page/ and http://localhost/cmsapp/en/admin/auth/user/ work perfectly.

Any suggestions? Are there any settings I'm missing?


Set LOGIN_URL and LOGOUT_URL in settings file.

http://docs.djangoproject.com/en/1.2/ref/settings/

For whatever reason, these don't take into consideration mount point of application and it has to be added into front of those settings.

0

精彩评论

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