Notice: In order to edit this ticket you need to be either: a Product Owner, The owner or the reporter of the ticket, or, in case of a Task not yet assigned, a team_member"

Task #7120 (closed)

Opened 8 years ago

Closed 7 years ago

Port to 1.2 template loaders

Reported by: cxallan Owned by: cxallan
Priority: critical Milestone: OMERO-4.4
Component: Web Version: n.a.
Keywords: n.a. Cc:
Resources: n.a. Referenced By: n.a.
References: n.a. Remaining Time: n.a.
Sprint: n.a.

Description (last modified by cxallan)

As of Django 1.2 the template loaders have gone from a callables based API to a class based one. Our usage will need to be ported throughout the application. Some details are available here:

Some of the deprecation warnings that not porting to this API create can be seen in #7118.

Change History (5)

comment:1 Changed 8 years ago by cxallan

  • Description modified (diff)

comment:2 Changed 8 years ago by wmoore

Seems that the update to Class loaders requires us to edit 'omeroweb/settings.py'

Need to replace this:

TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.load_template_source',
    'django.template.loaders.app_directories.load_template_source',
#     'django.template.loaders.eggs.load_template_source',
)

With this (default)

('django.template.loaders.filesystem.Loader',
 'django.template.loaders.app_directories.Loader')

http://docs.djangoproject.com/en/1.3/ref/settings/#std:setting-TEMPLATE_LOADERS

comment:3 Changed 8 years ago by wmoore

It seems that it is not necessary to have an app turned "on" in order that you can use the templates within it:
http://docs.djangoproject.com/en/1.3/ref/templates/api/#template-loaders

Although you will need to add the location to TEMPLATE_DIRS.

Your templates can go anywhere you want, as long as the directories and templates are readable by the Web server. 
They can have any extension you want, such as .html or .txt, or they can have no extension at all.
Last edited 8 years ago by wmoore (previous) (diff)

comment:4 Changed 8 years ago by jburel

  • Sprint 2011-11-10 (2) deleted

Referencing ticket #7116 has changed sprint.

comment:5 Changed 7 years ago by cxallan

  • Resolution set to fixed
  • Status changed from new to closed

All done and working.

Note: See TracTickets for help on using tickets. You may also have a look at Agilo extensions to the ticket.

1.3.13-PRO © 2008-2011 Agilo Software all rights reserved (this page was served in: 0.79638 sec.)

We're Hiring!