[Answered ]-Moving Django 1.6 to new server

2👍

Start with the docs here – this will give you a good overview.

To your specific questions:

1/ Django is not backwards compatible. You should install 1.6.x. Likely, there’s a requirements.txt file in the root directory of your app. On your new server, install pip and then pip install -r requirements.txt will install your dependencies. I would personally use virtualenvwrapper to manage your dependencies on the server

2/ Check the docs, but the main steps are:

  1. Choose a web server. I personally use nginx. You’ll need to setup your nginx.conf.
  2. Choose a Python WSGI HTTP Server – I use gunicorn. You’ll also need to configure this. This tutorial is a great place to start.
  3. If you use the DigitalOcean tutorial above, any linux server will do. Last, you’ll need to upload your Postgres database to the server but sounds like you’re able to do that.

3/ You will need to edit your settings.py of the Django project and update certain variables.

  1. If you’re changing your database, as well as the app deployment, you’ll need to edit the database connection, run ./manage.py syncdb and ./manage.py migrate (if you’re using South) to set up the database schema.
  2. It’s also recommended to change the SECRET_KEY between deployments.
  3. If you’re deploying on a different hosts, you’ll need to edit ALLOWED_HOSTS appropriately for your new deployment as well.

Good luck!

Leave a comment