5 ms·
One way is to use symlinks to link in your live build. Then your deployment process can upload your new codebase and run the migrations before switching the sy
by codeinthehole 14y ago
One way is to use symlinks to link in your live build. Then your deployment process can upload your new codebase and run the migrations before switching the symlink so that you new codebase is being served.
Where I work, we have a templated Django project that has a fabfile to do this: https://github.com/tangentlabs/tangent-django-boilerplate https://github.com/tangentlabs/tangent-django-boilerplate
If you look in the deploy function (https://github.com/tangentlabs/tangent-django-boilerplate/blob/master/fabfile.py#L123 https://github.com/tangentlabs/tangent-django-boilerplate/bl...), you can see the flow is something like:
def deploy():
deploy_codebase()
...
migrate()
...
switch_symlink()
- rheide 14y agoThis is a very creative solution. I like it.