In the Python tutorial documentation, it teaches the use of moving stuff like index, detail, etc into the urls.py. But isn't this bad practice, since it now mixes the url handling with presentation logic? What is HN's take on this?
Link to documentation: https://docs.djangoproject.com/en/1.5/intro/tutorial04/#use-generic-views-less-code-is-better
Not really a bad practice, more of a personal style choice. The concerns here aren't any more mixed than if you created a views.py and sub-classed the generic views settings your own options. urls.py just maps patterns to views, it's just in this case you're setting several options on some generic views.<p>That being said, I almost always DO separate them because over time your generic views often become more complex and more overridden. I also personally prefer my urls.py to not get so "messy", but it's not really a horrible practice or one with a lot of downsides.