I went through a quick survey tutorial on the Django website, and the last topic was introducing general concepts. A convenient way to get around the need to create custom views for each URL pattern.
This is the main idea, as I understand it:
1) Query β URL Patterns β View β Pattern
or
2) Request β URL patterns (general view) [-> optional pattern]
2, apparently, requires less code, it's just two steps, not four, but on the other hand you paste more into URL patterns, there is more automatic continuation, and now your views are defined in two places.
I really like the idea of ββhaving URL patterns, that is what the patterns are, rather than adding an extra pattern. I also like the idea of ββuniquely identifying all views, even simple ones, so later I know where to find them without going through the files. Plus, we all know that any machine is harder to set up than something that you build from scratch (at least from scratch Django).
Am I missing something? I am making a big mistake that will haunt me later, I donβt use general views at all?
Ska
source share