mod_wsgi + Flask
Here’s my mod_wsgi configuration for a flask app that uses Flask-Admin.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WSGIDaemonProcess makermanager2 user=www-data group=www-data threads=5 | |
WSGIScriptAlias /makermanager2 /var/www/makermanager2/runserver.wsgi | |
<Directory /var/www/makermanager2> | |
WSGIProcessGroup makermanager2 | |
WSGIApplicationGroup %{GLOBAL} | |
Order deny,allow | |
Allow from all | |
</Directory> | |
Alias /makermanager2/assets /var/www/makermanager2/application/static | |
<Directory /var/www/makermanager2/application/static> | |
Order allow,deny | |
Allow from all | |
</Directory> | |
Alias /makermanager2/static/admin /opt/Envs/prod/src/flask-admin-master/flask_admin/static/ | |
<Directory /opt/Envs/prod/src/flask-admin-master/flask_admin/static/> | |
Order allow,deny | |
Allow from all | |
</Directory> |
Trailing slashes matter! If you set a trailing slash, it will only set the alias for that directory and not all of the directories below it.