1

Im getting this error when trying to access a customized version of flatpages in my admin:

DatabaseError: no such table: django_template

On settings I have flatpages, the middleware and of course my custom flatpages installed... what could be the problem?

This is my custom flatpage model and admin, Im trying to get the flatpages to have translations.

Also Im guessing I have to change the templatetag on the flatpage in order to use my custom model...

My flat pages model -> https://gist.github.com/2052903

My flat pages admin -> https://gist.github.com/2052907

and the lookup translation util -> https://gist.github.com/2052919

All suggestions are welcome to change the code or anything...

=== EDIT ===

This is my settings file -> https://gist.github.com/2054598

and this is the complete error traceback -> http://dpaste.com/717679/

This error happens when I try to access the flatpages admin

Thank you all!

jpic
  • 32,891
  • 5
  • 112
  • 113
maumercado
  • 1,453
  • 4
  • 23
  • 47

1 Answers1

2

This is because you have "dbtemplates.loader.Loader" in TEMPLATE_LOADERS, but "dbtemplates" is not is INSTALLED_APPS.

So either add "dbtemplates" to INSTALLED_APPS and syncdb, either remove "dbtemplates.loader.Loader" from TEMPLATE_LOADERS.

Note: if you're going to use dbtemplates, then you should really use JohnnyCache if you don't want database queries at each template load.

jpic
  • 32,891
  • 5
  • 112
  • 113
  • Thats the first thing I did when the problem arised! – maumercado Mar 17 '12 at 14:49
  • Does the table exist ? Does the django user have necessary permissions to use it ? – jpic Mar 17 '12 at 15:20
  • The table does not exists, but its because django_template its not mention in any models I use, thats the weird thing, so I guess Ill have to create it by hand but for what purpose? – maumercado Mar 17 '12 at 16:09
  • Thank you jpic, I'll be more carefull next time with the installed_apps list and template loaders, nice catch by the way! Also Ill do as suggested, being reading johnycache :) – maumercado Mar 17 '12 at 16:54