Reputation: 7942
I think I'm using Django in google app engine this way:
from google.appengine.ext.webapp import template
...
self.response.out.write(template.render('view/some_name.html', viewVals))
But I read somewhere that to use Django, you need to do this:
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
from google.appengine.dist import use_library
use_library('django', '1.2')
https://developers.google.com/appengine/docs/python/tools/libraries#Django
I don't understand what is the difference between what I'm doing and using Django the way described above in the google documentation.
Also, if I do attempt to use it in this way, how do I know I succeeded? Do I still use:
self.response.out.write(template.render('view/some_name.html', viewVals))
Please help clarify this. Thanks
Upvotes: 1
Views: 203
Reputation: 21835
Google App Engine used to ship with an older version of Django and in order to use the newest you had to do that trick. I'm not sure what's the default version on Django now (I personally using Jinja2, and you can go through the Getting Started to see how to use it with GAE).
In order to test if you're succeeded or not, use the in operator, that was introduced in Django 1.2, if it worked then you don't need the extra setting, otherwise use it.
{% if "bc" in "abcdef" %}
This appears since "bc" is a substring of "abcdef"
{% endif %}
Upvotes: 1