Arachnid / bloggart

A blog application for App Engine
http://bloggart-demo.appspot.com/
287 stars 78 forks source link

Relative calls in {% extend %} is a bad practice #31

Closed xen closed 15 years ago

xen commented 15 years ago

In admin templates base.html call {% extend "../base.html" %}. I'm try it with other Django version and its stop working. Seems like it is bad practice and you can't guaranty that it will work. So may be best way is divide admin and user templates or move both to same folder.

Arachnid commented 15 years ago

Are you sure it's not just some other issue? Where did you see that it was bad practice?

andialbrecht commented 15 years ago

I can confirm that relative paths don't work with Django 1.1. If you add

[sourcecode:python] from google.appengine.dist import use_library use_library('django', '1.1') import django from django import forms django.newforms = forms [/sourcecode]

to admin.py the admin pages fail with a TemplateSyntaxError because of a missing template (it's actually not a syntax error in the template).

But I think this problem only occurs if google.appengine.ext.webapp.template is used since the customized template loader in that module restricts the template paths to a single directory. When using the native Django template loader and renderer I had no problems.

xen commented 15 years ago

Sorry for delay and thank to andialbrecht for quick response. I'm tested locally with Django 1.1 and it was one of the issues, but only one with templates. Also I found that some other people have same problems here http://stackoverflow.com/questions/671369/django-specifying-a-base-template-by-directory

Arachnid commented 15 years ago

Fixed with andialbrecht's patch.