Re: Newform-admin: problem with loading admin templates and templatetags
On Dec 27, 2007 2:15 AM, Webchemist <[EMAIL PROTECTED]> wrote: > > Jeremy, thanks to reply! > > > What you really want here is to have > > 'django.template.loaders.app_directories.load_template_source' in your > > TEMPLATE_LOADERS. That's really what you want, not add add the admin > > templates to TEMPLATE_DIRS. > > This template loader was enabled of cause from the beginning. But it > does not help. > > The traceback is at http://dpaste.com/29095/ > Err, django.contrib.admin isn't in your INSTALLED_APPS. :) --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Newform-admin: problem with loading admin templates and templatetags
On Dec 27, 11:34 am, Julien <[EMAIL PROTECTED]> wrote: > In urls.py, have you set it up properly: > > from django.conf.urls.defaults import * > from django.contrib import admin > > urlpatterns = patterns('', > ('^admin/(.*)', admin.site.root), > ) Naturally, yes! Otherwise admin application didn't start at all. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Newform-admin: problem with loading admin templates and templatetags
In urls.py, have you set it up properly: from django.conf.urls.defaults import * from django.contrib import admin urlpatterns = patterns('', ('^admin/(.*)', admin.site.root), ) On Dec 27, 7:15 pm, Webchemist <[EMAIL PROTECTED]> wrote: > Jeremy, thanks to reply! > > > What you really want here is to have > > 'django.template.loaders.app_directories.load_template_source' in your > > TEMPLATE_LOADERS. That's really what you want, not add add the admin > > templates to TEMPLATE_DIRS. > > This template loader was enabled of cause from the beginning. But it > does not help. > > The traceback is athttp://dpaste.com/29095/ > > When I copy admin templates to my project template folder, I get > > >"In template d:\projects\nftest\templates\admin\login.html, error at line 4 > >'adminmedia' is not a valid tag library: Could not load template library > >from django.templatetags.adminmedia, No module named adminmedia" > > It seems that Django searches templates and tempatetags only in > project folder not in django folder. It's strange because django IS in > python path and newforms-admin and trunk branches have similar code > for template loading, but they behavior in the same environment is > different. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Newform-admin: problem with loading admin templates and templatetags
Jeremy, thanks to reply! > What you really want here is to have > 'django.template.loaders.app_directories.load_template_source' in your > TEMPLATE_LOADERS. That's really what you want, not add add the admin > templates to TEMPLATE_DIRS. This template loader was enabled of cause from the beginning. But it does not help. The traceback is at http://dpaste.com/29095/ When I copy admin templates to my project template folder, I get >"In template d:\projects\nftest\templates\admin\login.html, error at line 4 >'adminmedia' is not a valid tag library: Could not load template library from >django.templatetags.adminmedia, No module named adminmedia" It seems that Django searches templates and tempatetags only in project folder not in django folder. It's strange because django IS in python path and newforms-admin and trunk branches have similar code for template loading, but they behavior in the same environment is different. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Newform-admin: problem with loading admin templates and templatetags
On Dec 26, 2007 3:49 AM, Webchemist <[EMAIL PROTECTED]> wrote: > > Hi, all! > I am trying to switch to the new-form admin branch and created a > simple project in test purposes. > I installed 0.97-newforms-admin-SVN-6977 and created a test project. > When trying to start at 127.0.0.1:8000/admin I got an error What rev were you at before switching to newforms? > TemplateDoesNotExist at /admin/ > admin/login.html > > Ok, I add the path to the settings.TEMPLATE_DIRS: > "C:/Python25/Lib/site-packages/django/contrib/admin/templates/" ...See, this makes it seem like you're starting with a new project from scratch? If you were using the same settings file that was working on (and old rev of) trunk before, I would have thought it'd work as-is. What you really want here is to have 'django.template.loaders.app_directories.load_template_source' in your TEMPLATE_LOADERS. That's really what you want, not add add the admin templates to TEMPLATE_DIRS. Give that a go w/ the loader changed and see if adminmedia works that way, too. > All files exist, i.e. django/contrib/admin/templatetags/adminmedia.py > exists > > My configuration is: > Windows XP SP2 Pro > Python 2.5 (C:\Python25) > Django 0.97-pre-SVN-6964 and 0.97-newforms-admin-SVN-6977 (I switch > between them by renaming django folder) > If changing TEMPLATE_LOADER doesn't help, have a look at the code here: http://code.djangoproject.com/browser/django/branches/newforms-admin/django/template/__init__.py#L1000 I'd just see what paths were coming in there and go from there. If you're not sure how to proceed but changing TEMPLATE_LOADERS didn't help, please paste the entire raw stack trace for the error to dpaste.com and put a link here on the list. Cheers, Jeremy P.S. Turnaround on help from the list is generally better; I imagine it's slow due to the holidays. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Newform-admin: problem with loading admin templates and templatetags
Hi, all! I am trying to switch to the new-form admin branch and created a simple project in test purposes. I installed 0.97-newforms-admin-SVN-6977 and created a test project. When trying to start at 127.0.0.1:8000/admin I got an error TemplateDoesNotExist at /admin/ admin/login.html Ok, I add the path to the settings.TEMPLATE_DIRS: "C:/Python25/Lib/site-packages/django/contrib/admin/templates/" After that, error message changed: TemplateSyntaxError at /admin/ 'adminmedia' is not a valid tag library: Could not load template library from django.templatetags.adminmedia, No module named adminmedia All files exist, i.e. django/contrib/admin/templatetags/adminmedia.py exists My configuration is: Windows XP SP2 Pro Python 2.5 (C:\Python25) Django 0.97-pre-SVN-6964 and 0.97-newforms-admin-SVN-6977 (I switch between them by renaming django folder) Adding of paths to sys.paths etc. had no result - the error appears anyway. When I switch back to the 0.97-pre and start my former project - it works fine. All pathes to the Django are the same in both cases. Django embedded server was used in both cases. As I see, templates and paths in 0.97-pre and 0.97-newform-admin are similar. In both cases Django lives in C:\Python25\Lib\site-packages \django. So I can't to localize the problem. Could anybody help me? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---