I am new to django and mod_wsgi, when I was trying to deploy a django project(in python) demo on Apache using mod_wsgi, I encountered some problem as following:
When the demo runs on django's built-in webserver with command 'python manage.py runserver', everything looks normal like Running on built-in server
while when running on Apache/mod_wsgi with command 'mod_wsgi-express start-server wsgi.py' , it looks like this: Running on Apache/mod-wsgi
I have no idea which part of my code or configuration goes wrong, could anyone help me out?
This is because runserver
serves css files for you. But in production you need to set up Apache to serve your static folder. Add alias to your apache config, eg
Alias /static /path/to/static_folder
Read more on managing static files .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.