6 ms·
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
by frankwiles 14y ago
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.
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.
- Systemic33 14y agoThat's exactly what I was thinking, just doing the simple example in the tutorial makes the urls.py seem bloated in my eyes.