1

I have spent some time studying Django and I've done some applications. But I really don't know what is the best approach while developing an application, I mean, there are several options: Make all the models, then all the urls, the views and then make all the templates.

Other people recommend using an agile approach, take a use case and go all the way until it's totally functional, and of course there might be other possible recommendations. Personally I feel really attracted by the agile approach, but I don't really know because for example every single model I append to my database would imply to create a new one.

To sum up, what is the best approach one should take when developing and application in Django, taking into account all the consequences that it carries?

3 Answers 3

1

Agile only, unless you're working for NASA :-)

It's either you or your customer/employer who has ideas about what IT should be. I've never seen people who're absolutely about what they're expecting to get. On the other hand, I do know a lot of people who have new ideas every day. So, in my opinion, the waterfall model only works for NASA and I've never seen it being used in programming.

4
  • Ok, agile. Now the problem I face is that when I'm working with an agile approach, for example with the models, I have to erase my database and redoit again. Is there any tools that automates this process for me? or should I write all my models first? or should I do this, erase and create?
    – Andrés
    Commented Apr 25, 2012 at 12:39
  • That's totally normal. You may either write your update scripts manually, so that DB schema gets changed instead of being recreated (that's, to be honest, tough thing), or you may just implement a procedure that populates your DB with some data to play with (while you're not on production). So, whenever you drop and recreate your DB, you may just trigger that proc and get a non-empty DB. For sure, this won't work when you're updating something that's is on prod. Commented Apr 25, 2012 at 13:36
  • @Andrés and loki2302: There's a number of ways to update the database in a simple and reliable way. They're called migrations. We use South for our project.
    – Izkata
    Commented Jul 24, 2012 at 18:41
  • Migrations are only simple and reliable when changes are primitive. Commented Jul 24, 2012 at 19:45
0

well, in my opinion, since you are choosing django you are already reinforcing a beautiful MTV design. things would be quite different if you use java frameworks or even start from scratch.

agile is definitely recommended, but I would also like to remind you that: pre-mature optimization is the root of evil.

as long as your code is functioning and as long as you put refactoring in mind. you are already doing a good design.

1
  • Ok, agile. Now the problem I face is that when I'm working with an agile approach, for example with the models, I have to erase my database and redoit again. Is there any tools that automates this process for me? or should I write all my models first? or should I do this, erase and create?
    – Andrés
    Commented Apr 25, 2012 at 12:39
0

Do them part to part. First do them on paper that tell you what you have in mind. Then create your app. First set your tools then first draft of html template then view just return your html file and then url to see the results. Now start your project. That's how i write Django.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.