![Show Menu](styles/mobile-menu.png)
![Page Background](./../common/page-substrates/page0265.png)
CHAPTER 14
Deploying Our New Code
It’s time to deploy our brilliant new validation code to our live servers. This will be a
chance to see our automated deploy scripts in action for the second time.
At this point I want to say a huge thanks to Andrew Godwin and the
whole Django team. Up until Django 1.7, I used to have a whole long
section, entirely devoted to migrations. Migrations now “just work”,
so I was able to drop it altogether. Thanks for all the great work gang!
Staging Deploy
We start with the staging server:
$
cd deploy_tools
$
fab deploy
:host=elspeth@superlists-staging.ottg.euDisconnecting from superlists-staging.ottg.eu... done.
Restart Gunicorn:
elspeth@server:$
sudo restart gunicorn-superlists.ottg.eu
And run the tests against staging:
$
python3 manage.py test functional_tests --liveserver=superlists-staging.ottg.eu
OK
Live Deploy
Assuming all is well, we then run our deploy against live:
$
fab deploy
:host=elspeth@superlists.ottg.eu237