Alex Rivera | Logout

What is a good Django workflow?

Asked 2011-03-11T03:16:47.907
17

I'm a beginner to Python and Django.

When starting a new project what do you do first before diving into the code?

For example, one could take the following steps:

  1. Configure the settings.py file first
  2. Configure models.py to lay out data structure
  3. Create template files
  4. Define the views/pages
  5. Syncdb
  6. etc

So my question is, what is a good workflow to get through the required steps for a Django application? This also serves as a checklist of things to do. In the definitive guide to Django, the author talks about approaching top down or bottom up. Can anyone expand further on this and perhaps share their process?

Thanks.

Edit
Report

1 Answer

0

I find that my process varies depending on a lot of variables, mainly whether I know something will work or if I'm experimenting and also whether I'm developing on my production server or in a development environment.

For example, I often do my development directly on the deployment server (most of my work is for intranet projects so there isn't any security risk, etc). But when I do this I really need to make sure the settings and urls are setup first and that gunicorn and nginx are configured.

If I know something should work, or am setting up a generic base set of code, sometimes I'll do all that coding for views and models before I even get enough setup to even run the development server. But when experimenting with new code I find it's good to be able to test every step of the way, so in that case you need your servers running.

In general I do settings, models, syncdb, views, urls, templates, collectstatic, graphics/aesthetics

In general I leave my base.html very plain until the everything else is working, then I add css/js etc.

I guess my point here is that there isn't really a wrong answer for how you do it, and there isn't even only one best practice (as far as I'm concerned). When you do more work, you'll find what you are comfortable with and it'll even vary from project to project.

Good luck, hopefully you learn to love django!

answered 2011-03-28T16:17:29.460

Your Answer