Requires the following environment variables:
AMQP_USER= (see admin docs)
AMQP_PASSWORD= (see admin docs)
MONGODB_URI= (see admin docs)
AMQP_VHOST= (see admin docs)
AMQP_HOST= (see admin docs)
DJANGO_DEBUG=1
-
Install Anaconda with Python 3.6. This guide assumes Windows 64bit.
-
Create virtual environment
python -m venv venv -
Activate the virtual environment
venv\Scripts\activate -
Install dependencies
pip install -r requirements.txt -
Edit
setenv.cmdand ensure configuration (get from Dropbox admin) -
Run
setenv.cmd -
python manage.py collectstatic -
Configure your webserver to:
-
Reverse proxy
http://ecn.pptik.id/tohttp://localhost:8000/- Exclude
/static/*(in IIS, use Condition -{PATH_INFO}does not match pattern^/static/)
- Exclude
-
Serve
/static/fromecnweb/staticfolder -
Forward HTTP
Hostheader -
Bonus: Set/Forward HTTP
X-Forwarded-Protoheader -
Bonus: Support SSL (see https://community.letsencrypt.org/t/how-to-generate-a-ssl-certificate-for-iis-7-0-or-7-5/29467)
-
-
Linux: Use
gunicorn:pip install --upgrade gunicorn gunicorn ecnweb.wsgiWindows - Easy way: Use waitress:
pip install --upgrade waitress waitress-serve --listen=*:8000 ecnweb.wsgi:applicationWindows - Hard way: https://medium.com/@bilalbayasut/deploying-python-web-app-flask-in-windows-server-iis-using-fastcgi-6c1873ae0ad8 You need to install Web Platform Installer in IIS Manager.
E:
cd \ecnweb
call setenv
set PATH=E:\ecnweb\venv\Scripts;%PATH%
waitress-serve --listen=*:8000 ecnweb.wsgi:application