Hi, I'm trying to get a correct admin interface with the default
openlayers.
Here are my models/admin :
#models.py
from django.contrib.gis.db import models
from django.contrib.auth.models import User
class Competitor(models.Model):
# User pour auth + Utilities
user = models.ForeignKey(User, unique=True)
tel = models.CharField(max_length=10)
birthdate = models.DateField()
# Adress
adress1 = models.CharField(max_length=150)
adress2 = models.CharField(max_length=150)
postcode = models.CharField(max_length=5)
city = models.CharField(max_length=100)
# Infos specifiques
licence = models.CharField(max_length=150)
permis = models.CharField(max_length=150)
# Geolocalisation
geolocation = models.PointField(srid=4269)
objects = models.GeoManager()
def __unicode__(self):
return user.username
#admin.py
from django.contrib.gis import admin
from myproject.myapp.models import Competitor
class CompetitorAdmin(admin.GeoModelAdmin):
search_fileds = ['tel',]
admin.site.register(Competitor, CompetitorAdmin)
Tha admin interface renders me this error :
TemplateSyntaxError at /admin/myapp/competitor/add/
Caught an exception while rendering: gis/admin/openlayers.html
Original Traceback (most recent call last):
File "/usr/local/lib/python2.5/site-packages/django/template/
debug.py", line 71, in render_node
result = node.render(context)
File "/usr/local/lib/python2.5/site-packages/django/template/
debug.py", line 87, in render
output = force_unicode(self.filter_expression.resolve(context))
File "/usr/local/lib/python2.5/site-packages/django/utils/
encoding.py", line 49, in force_unicode
s = unicode(s)
File "/usr/local/lib/python2.5/site-packages/django/forms/forms.py",
line 326, in __unicode__
return self.as_widget()
File "/usr/local/lib/python2.5/site-packages/django/forms/forms.py",
line 358, in as_widget
return widget.render(name, data, attrs=attrs)
File "/usr/local/lib/python2.5/site-packages/django/contrib/gis/
admin/widgets.py", line 54, in render
return render_to_string(self.template, self.params)
File "/usr/local/lib/python2.5/site-packages/django/template/
loader.py", line 102, in render_to_string
t = get_template(template_name)
File "/usr/local/lib/python2.5/site-packages/django/template/
loader.py", line 80, in get_template
source, origin = find_template_source(template_name)
File "/usr/local/lib/python2.5/site-packages/django/template/
loader.py", line 73, in find_template_source
raise TemplateDoesNotExist, name
TemplateDoesNotExist: gis/admin/openlayers.html
Where am I wrong ?
I runned all the tests for PostGis, it's OK. Why django cannot find
the template, I saw it exists in /usr/local/lib/python2.5/site-
packages/django/contrib/gis/templates/gis/admin
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---