Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating a development environment for Django

We are starting a web project with Django (and are pretty new to this), and I was wondering what would been the best way to setup a productive development environment.

Here is some info:

  • We are 2 developers working on the project
  • We have a development/production server hosted on Webfactional (using an apache server)
  • The DB (MySQL) is hosted on this server
  • We are both using Eclipse with Pydev
  • The project is hosted on a Github repository

So far, we didn't setup any local development server, we are syncing modifications to the server through Github. But it is not really convenient...

We were thinking of setting up apache servers locally, that uses the remote database, and only sync once in a while.

Do you think it would be better?

Do you have other ideas/additional tips?

Thanks!

like image 839
nbarraille Avatar asked Dec 09 '22 09:12

nbarraille


1 Answers

Don't try and share servers and databases while you're developing. You'll only get confused.

Each developer should have a local copy of MySQL on their own machine, and run the development server as mipadi recommends. Manage db schema changes via South, and keep data in fixtures or use South's data migrations. Each developer should commit to their local version of the git repository, but only push changes to Github when the particular task is complete and working (or, better, use a remote branch so that changes are synched, but only merge back to master when complete).

A good idea is to have a continuous integration server like Hudson/Jenkins that, after each commit to master, runs the tests and - if they pass - builds an up-to-date version of the site, which you can use for functional/user testing.

Edit to add There's no relationship between the development server and any particular database backend. As I recommend above, it is quite simple to install MySQL or PostgreSQL on your local machine, and use the development server against that. I have been working this way for several years, after initially encountering some of the issues you were worried about when switching between sqlite3 and the production MySQL db.

like image 187
Daniel Roseman Avatar answered Jan 25 '23 20:01

Daniel Roseman