OHH i just found the solution which is that i miss to add this line in
view.py
from blog.savedtemplate.models import Template

and it solved my issue :)
Thank you ;
Mary Adel


On Mar 8, 1:59 pm, "Mary" <[EMAIL PROTECTED]> wrote:
> I just have another one issue about the template db
> I have created a template in the database and i called it blog/
> home.html
>
> and i wrote may view like this :
>
> from django.shortcuts import render_to_response
> from blog.home.models import Blog
> def home(request):
>
>     return render_to_response('blog/home.html')
>
> But i got an error which is
> Exception Type:         TemplateDoesNotExist
> Exception Value:        /blog/home.html
> Exception Location:     /usr/lib/python2.4/site-packages/Django-0.95.1-
> py2.4.egg/django/template/loader.py in find_template_source, line 72
> Template-loader postmortem
>
> Django tried loading these templates, in this order:
>
>     * Using loader
> django.template.loaders.filesystem.load_template_source:
>           o /blog/home.html (File does not exist)
>     * Using loader
> django.template.loaders.app_directories.load_template_source:
>           o /blog/home.html (File does not exist)
>           o /blog/home.html (File does not exist)
>     * Using loader
> blog.savedtemplate.loaders.database.load_template_source:
>
> Can anyone tell me please what is my mistake as i really can't know
> Thank you very much
> Mary Adel
>
> On Mar 8, 11:49 am, "Mary" <[EMAIL PROTECTED]> wrote:
>
> > Dear Malcom ;
> > I have renamed my version to "myapp.savedtemplate" and it worked fine
> > with me
> > so my problem has been solved and i really appreciate your help;
>
> > Thank you very much ;
> > Mary Adel
>
> > On Mar 7, 1:00 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
> > wrote:
>
> > > On Wed, 2007-03-07 at 01:41 -0800, Mary wrote:
> > > > Dear Malcom;
>
> > > > I have commented this line #from template.models import Template
> > > > in template/loaders/database.py
>
> > > > and it works fine with but i don't know if it will affect any of the
> > > > functionality or not
>
> > > That's not a good idea. It will break a lot of things having to do with
> > > templating.
>
> > > > also my setting.py is :
> > > > TEMPLATE_LOADERS = (
> > > >     'django.template.loaders.filesystem.load_template_source',
> > > >     'django.template.loaders.app_directories.load_template_source',
> > > >     'myapp.template.loaders.database.load_template_source',
>
> > > > )
>
> > > > MIDDLEWARE_CLASSES = (
> > > >     'django.middleware.common.CommonMiddleware',
> > > >     'django.contrib.sessions.middleware.SessionMiddleware',
> > > >     'django.contrib.auth.middleware.AuthenticationMiddleware',
> > > >     'django.middleware.doc.XViewMiddleware',
> > > >     "myapp.middleware.threadlocals.ThreadLocals",
> > > > )
>
> > > > ROOT_URLCONF = 'myapp.urls'
>
> > > > TEMPLATE_DIRS = (
> > > >     # Put strings here, like "/home/html/django_templates".
> > > >     # Always use forward slashes, even on Windows.
> > > >     "/var/www/myapp/Template_Dir/",
> > > > )
>
> > > > INSTALLED_APPS = (
> > > >     'django.contrib.auth',
> > > >     'django.contrib.contenttypes',
> > > >     'django.contrib.sessions',
> > > >     'django.contrib.sites',
> > > >     'django.contrib.admin',
> > > >     'django.contrib.markup',
> > > >     '.myapp.articles',
>
> > > This line looks a little suspicious (the leading '.'), but it may be
> > > fine.
>
> > > >     'myapp.stockphoto',
> > > >     'myapp.template',
>
> > > This is probably where your problem lies. From your error message, it
> > > looks like there is some confusion between your package called
> > > "template" and Django's internal "template" package. Try renaming your
> > > version to "myapp.templateX" or something like that and see if the
> > > problem goes away.
>
> > > I realise this is a bit ugly if it is the solution, but some of the
> > > dynamic importing inside Django can cause problems sometimes. If
> > > renaming here does make your problem go away, let us know, because it
> > > might be something we can look at fixing in the future. (And, obviously,
> > > if that doesn't fix the problem, let us know too and somebody might have
> > > some other ideas.)
>
> > > Regards,
> > > Malcolm


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to