我有一些難以在單個域上安裝多個項目的Django。我想在同一個域中運行的Django-CMS和LFS:使用apache + mod_wsgi(帶有Ubuntu的亞馬遜ec2服務器)的Django-CMS和LFS
- mydomain.com(Django的CMS)
- mydomain.com/store(LFS)
對於現在,我可以用正確的django-project訪問這兩個域,但是在LFS項目中,所有商店的鏈接都會重定向到第一個域。例如,購物車鏈接重定向到mydomain.com/cart而不是mydomain.com/store/cart。
我試圖通過在所有url模式中添加「store /」來更改url.py文件,但它不起作用。 我想我必須在LFS項目的settings.py中添加一個配置,但我不知道是什麼。
你有什麼想法嗎? 謝謝! :)
PS:這裏我的httpd.conf
Alias /store/static /home/ubuntu/lfs-installer/lfs_project/sitestatic/
<Directory /home/ubuntu/lfs-installer/lfs_project/sitestatic>
Order deny,allow
Allow from all
</Directory>
WSGIScriptAlias /store /home/ubuntu/lfs-installer/apache/django.wsgi
Alias /static /home/ubuntu/lfs-installer/selmyrtech/static/
<Directory /home/ubuntu/lfs-installer/selmyrtech/static>
Order deny,allow
Allow from all
</Directory>
WSGIScriptAlias//home/ubuntu/lfs-installer/selmyrtech/apache/django.wsgi
感謝您的回覆。我想了解一個新的URL約定,但我想知道是否有另一個解決方案。 對於第二個解決方案,我更喜歡有兩個Django項目,因爲當你有LFS時,Django Admin會變得非常困難,並帶有許多LFS選項。 無論如何,感謝您的幫助;) – edfanhouse 2012-08-15 16:45:05