Alex Rivera | Logout

Worst practices in Django you have ever seen

Asked 2010-01-13T16:50:31.097
22

What are the worst mistakes made using Django framework, that you have noticed? Have you seen some real misuses, that maybe should go as warnings to the Django docs?

Edit
Report

2 Answers

13

Not splitting stuff up into multiple applications. It's not so much about reusability as it is about having a dozen models, and over 100 views in one app, it's damned unreadable. Plus I like to be able to scan my urls.py file easily to see where a URL points, when I have 100 URLs that gets harder.

answered 2010-01-13T16:57:35.043
4

I've experienced a worst practice : use something else that the default id as primary key of model.

It looked as a good idea but it caused some problems in the administration web site and it was difficult to restore the id as primary key on an existing database.

I think that there is no specific case that are specific enough to cause these problems. I recommend to keep the id of your model as it is by default.

See What is the best approach to change primary keys in an existing Django app? for details

answered 2010-07-21T13:38:11.237

Your Answer