16👍
I use git to track my website, and I deploy it like this:
git archive --format=tar --prefix="homepage/" master | gzip | ssh webserver "tar xvz -C ~/public_html"
This deserves a little explanation. The archive command for git will export the files for the master branch, which gets compressed with gzip to minimize network traffic. It’s received remotely over ssh, which is decompressed into the final destination directory.
The deploy script that I use has a little more going on, but this is the most important piece.
- Exposing django admin to users. Harmful?
- Django class based views – UpdateView with two model forms – one submit
- Can you achieve a case insensitive 'unique' constraint in Sqlite3 (with Django)?
- Workflow using virtualenv and pip
- DRF: Retrieve outer input data from nested serializer validate method
8👍
If the question is if you can you use git to deploy your django application, the answer is sure!
However, production deployment of a popular application can become complex – and go way beyond just rolling back files. You may need to run DB scripts (both upgrade and downgrade scripts), restart cron jobs, or move files around.
As part of your deployment process you may want to back up your code base in its entirety so that you can rollback any number of versions back.
One way to do this is with Capistrano which automates the entire deployment process for you. You author scripts in your development environment and issue commands like: cap deploy, cap deploy_with_migrations, cap rollback, etc. and everything is automated from the login all the way up to the backup process and running DB scripts. By having the deployment automated you eliminate errors in your production environment. I recently spoke to an organization who accidentally deleted their entire database while in the midst of a deployment and needed to restore everything from backups. Deployment errors can really break your business so you want to automate this if you are serious about it.
Though Capistrano is a Ruby-based deployment tool commonly used with Rails, it’s agnostic in terms of its automation capabilities. There are numerous posts on the Internet that discuss the benefits of deploying Django apps with Capistrano (google – django capistrano).
You can also check check out this link here
4👍
Well, I use SVN to deploy my website, so I’d say go for it! Keep in mind that you may have to restart/reload the server every time you update the code for the website (I’m not sure if Django or whatever you’re running it on is able to work around that).
- How to implement sorting in Django Admin for calculated model properties without writing the logic twice?
- Django custom login page
- How can I create a partial search filter in Django REST framework?
- Django object is not JSON serializable error after upgrading django to 1.6.5
- How to build a REST client frontend for a REST API backend?