TAGS :Viewed: 7 - Published at: a few seconds ago

[ Moving Django 1.6 to new server ]

I'm wondering what steps are evolved in moving a django project to a new server. basicly i'm completely new to Django and have a few questions. The server it is on is now is not stable so I need to act fast. I did not build the app that is there but have pulled down the www folder from the root server. The server is running centOS.

Questions. is Django backwards compatible or will I need to insure that the same version is installed?

Apart from moving the files what other steps are involved in running the app?

Will I need to use centOS or will any linux server do?

I have a database cluster of PostgreSQL ready to go also.

Answer 1


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!