H H H
H H H

Reputation: 529

Managing a django website the professional way

Hi Stack OverFlow people, three months ago I had no clue about web development or python. And a day before yesterday I launced my first Django website :) www.gccfishing.com

This is how i deployed the website:

  1. I developed the project on my home desktop.
  2. Created a Github repo and uploaded it there.
  3. On a webfaction server I cloned the repo and configured the server to run the project.

Everything is fine and people have started using it, but I'm facing a problem; I cant figure out an efficient way to make changes to the project on the server.

Since yesterday I have been tweaking the project code in vim directly on the server through ssh.

I have also been tweaking my development copy of the project at home desktop.

So now my home desktop, the Github repo and the webfaction server have slightly different code.

Whats the best solution for me in this case so that I have one copy(server copy) of the project to work on? and my work flow would be such that I develop on the home desktop and just upload it to the server.

Am I making sense?

Whats the best way of updating the server copy of the project? Any thoughts/recommendations?

Upvotes: 3

Views: 305

Answers (2)

Softinio
Softinio

Reputation: 658

Congrats on your first project for sure and great choice on tools to use :-)

You will find this blog series useful to help you use fabric to deploy (especially part 5):

http://www.abidibo.net/blog/2012/04/30/deploy-django-applications-nginx-uwsgi-virtualenv-south-git-and-fabric-part-1/

Also you may want to have a look at this as also a nice resource:

http://www.jeffknupp.com/blog/2012/10/24/starting-a-django-14-project-the-right-way/

Upvotes: 2

James R
James R

Reputation: 4656

Well, first let me say congrats. I think this is a pretty cool first project and I'm sure you learned a ton along the way.

Your question is really something like "how do I maintain a production application". I think if you do some googling around that (with django tacked on the end) you will get a ton of great answers.

More specifically, your asking about deployment.

In this case, you want to only make your changes on your laptop. Test them locally, and then commit them to github.

From your box, once you ssh into it, just do a git pull and restart your webserver.

That said, you might want to look at a python package called "fabric" http://fabric.readthedocs.org/en/1.3.3/index.html to manage deployments and maintenance.

Learning fabric can be a valuable addition to your toolset as well.

Also, it's ok for your server to be behind or on a different branch then development as you work out new features. But, you really don't want your server ahead. You should commit any changes you've made to github from your server and then pull them back down to your local so everyone is in sync.

Upvotes: 4

Related Questions