apache - Serving Django application from relative path -


I am developing a Django application which works fine at the local level. In production, a relative path will be applied, such as www.example.com/app / .

I am using Apache with mod_wsgi, and I have configured Apache to serve the application from a relative URL:

  WSGIScriptAlias ​​/ app / Path / to / my / modwsgi.py WSGIDaemon Process app display-name = app_wsgi   

Unfortunately, I get a 404 error. Debug info, however, is very mysterious. If I try to get www.example.com/app/myurl/ , then what ango says url = in this order: ^ myurl / $ ... current URL, mural /, does not match any of these

It looks like Django - correctly guesses that the path is myurl / , and not app / myurl / . However, although myurl / clearly matches ^ myurl / $ , this is not a match.

I have also tried to add the setting

  FORCE_SCRIPT_NAME = '/ app'   

but nothing changes - error The message remains the same.

The information about the debug is: - Trying with more acceptable regexs in / URL config; Iwas able to get a page From there I could print request.path , and it turned out to be app / myurl / .

To make it work, I instead

  FORCE_SCRIPT_NAME = '' STATIC_URL = '/ app / static /' MEDIA_URL = '/ app / media /'    

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -