Closed aguynamedben closed 11 years ago
First of all, thanks for taking the time to check this out on 1.5. I hadn't got round to it yet!
I'm not keen on sniffing the Django version to be honest. If we were going down that route, you'd find you could just compare the version tuple directly. For instance even in this case, I think TemplateView is in Django 1.4, and we should use it there if we can.
Capability-based stuff is usually done in the rest of django by trying to import something, catching the ImportError if it happens, and doing something else. So I suspect the best bet is to try to import TemplateView (and use it if we can) and if not, fall back to direct_to_template.
And, we can just update the docs :)
Does that make sense?
Thanks again.
Hey, sure yeah that all makes a lot of sense. Getting late where I am but I'll implement the things you're saying and update the pull request tomorrow or the next day, good call.
-Ben
Since TemplateView has been available since Django 1.3 does it make sense to have a fallback at all to direct_to_template ?
True - and this is now all done anyway in 3308be4943bbebdb8b9749453c9912779e282888
hmm..
Hey Dan, this project is awesome, I'm finding it very useful.
I'm playing with Django 1.5 RC1 and the import in urls.py is failing.
According to https://docs.djangoproject.com/en/1.4/topics/generic-views/ it looks like since Django 1.3 the module
django.views.generic.simple
and its functiondirect_to_template
were deprecated, and that module was finally removed in 1.5.It's not the cleanest solution because I wanted to keep backwards-compatibility and reduce headache for people just trying to follow your awesome docs.
-Ben