diff options
| author | Mitch Riedstra <mitch@riedstra.us> | 2017-10-31 22:53:29 -0400 |
|---|---|---|
| committer | Mitch Riedstra <mitch@riedstra.us> | 2017-10-31 22:53:29 -0400 |
| commit | b7d282a8ba5f0ed6c773989c96c2182257cc69a5 (patch) | |
| tree | 49c8047397a194fa608c629b883193a164890b64 /README.md | |
| parent | 4b191cb3d2c0502088e396a71147e0423e6ecb90 (diff) | |
| download | dispatch-tracker-b7d282a8ba5f0ed6c773989c96c2182257cc69a5.tar.gz dispatch-tracker-b7d282a8ba5f0ed6c773989c96c2182257cc69a5.tar.xz | |
Some changes to make deployment easier
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 64 |
1 files changed, 64 insertions, 0 deletions
@@ -40,3 +40,67 @@ pip install -r requirements.txt ./manage.py runserver 0.0.0.0:8080 ``` + + +To get a production system setup: + + +``` bash +export CFG="my-config.yml" +cd app +virtualenv env +. env/bin/activate +pip install -r requirements.txt +cp config.yml $CFG +vi $CFG # This is where you change the SECRET_KEY, static_root, allowed_hosts +# and other settings. +cat uwsgi.ini | sed -e"s/config.yml/$CFG/g" > my-uwsgi.ini +./manage.py collectstatic +./manage.py migrate +./manage.py createsuperuser +uwsgi --ini my-uwsgi.ini # This will start the daemon, it's up to you to +# configure your OS to start it on boot +``` + +Below is a sample Nginx configuration, edit for your needs: + +``` nginx +# It's up to you to configure HTTPs, I _highly_ recommend it +server { + listen 80; + # Uncomment if you have ipv6 + # listen [::]:80; + server_name dispatch.example.com; + + root /var/www/dispatch.example.com; + + index index.html index.htm; + + # Some applications have trouble with merged slashes + # This likely doesn't but worth noting + merge_slashes off; + + location / { + include uwsgi_params; + uwsgi_pass 127.0.0.1:9200; + } + + # Pass through the static directory + # This should match whatever is in your config file + location /static { + alias /var/www/dispatch.example.com/static; + } + + # This is probably going to be pulled from dispatch/static/robots.txt + location /robots.txt { + alias /var/www/dispatch.example.com/static/robots.txt; + } + + # Enable logging + # You will likely have to create these directories for Nginx to load + access_log /var/log/nginx/dispatch.example.com/access.log; + error_log /var/log/nginx/dispatch.example.com/error.log; + +} +``` + |
