Deploying a premade Django application?

July 23, 2014 3k views

I have a 100% working premade Django website that I spent the past week or so working on. After a lot of twists and round abouts, I discovered not every host supported Django. Then I was like "Duh!". Luckily, I found this website. I searched around a bit, and I can't find a way to deploy a premade Django website to this web host. Is it possible? It'd be ab absolute shame to see an entire website to go to waste :|


2 Answers

Take a look at How To Deploy a Local Django App to a VPS. If your app isn't stored on a git repository, you can use FileZilla or any other SFTP client to transfer your app to your droplet.

by Stephen Tippets
Here you'll learn how to deploy a local Django app to a VPS.
  • I'm still looking into it, but I think this was exactly what I was looking for! Thank you! :D

A simple way to do this is to swap the server files in the one-click install image of Django that Digital Ocean provides with the files you've created on your local machine.

However this would only work if both projects use the same Django version, the one-click image I believe is using 1.6.1, and if you've started a project recently it is likely you are using a version > 1.7.

If you are using the same version though, just replace the django directory with your nearly identical project using git, filezilla, or a similar program. Then modify the settings.py file to match that of the original settings.py, mainly the credentials for the database. Then issue a 'python manage.py sql <your apps>', 'python manage.py syncdb', and 'service gunicorn restart', and you should be good to go.

Again this is only a working solution if the versions match, and its an imperfect one at that. If you're new to Django I'd suggest reading up on Django settings and configurations, which should allow you to deploy applications on nearly any VPS.

Have another answer? Share your knowledge.