Hi! I have updated Django from svn, installed a new app and some new models and now when I try to browse /admin/ I get this error:
ViewDoesNotExist: Tried index in module django.contrib.admin.views.main. Error was: 'module' object has no attribute 'index'
I have checked that my user is the owner of all the files in django.contrib.admin.views and I have checked that there not exist any method in django.contrib.admin.views.main called index.
What is this attribute used for and how I can fix this error?
The problem is that in the last versions in the repository of Django the Admin interface has changed. More info in: http://www.djangoproject.com/documentation/admin/ I have read the documentation but now I have another error. Now the error is with the template index of the admin interface:
TemplateSyntaxError at /admin/ Caught an exception while rendering: u'user' Original Traceback (most recent call last): File "/usr/lib/python2.4/site-packages/django/template/debug.py", line 71, in render_node result = node.render(context) File "/usr/lib/python2.4/site-packages/django/contrib/admin/templatetags/log.py" , line 18, in render self.user = context[self.user].id File "/usr/lib/python2.4/site-packages/django/template/context.py", line 43, in __getitem__ raise KeyError(key) KeyError: u'user'
After reading the document the most importante change I see is extracting the Admin class from the models and creating another class called MyModelAdmin that extends admin.ModelAdmin and modifying the urls.py to include:
> Hi! > I have updated Django from svn, installed a new app and some new > models and now when I try to browse /admin/ I get this error:
> ViewDoesNotExist: Tried index in module > django.contrib.admin.views.main. Error was: 'module' object has no > attribute 'index'
> I have checked that my user is the owner of all the files in > django.contrib.admin.views and I have checked that there not exist any > method in django.contrib.admin.views.main called index.
> What is this attribute used for and how I can fix this error?
Florencio Cano wrote:
> The problem is that in the last versions in the repository of Django
> the Admin interface has changed. More info in:
> http://www.djangoproject.com/documentation/admin/ > I have read the documentation but now I have another error. Now the
> error is with the template index of the admin interface:
> TemplateSyntaxError at /admin/
> Caught an exception while rendering: u'user' Original Traceback (most
> recent call last): File
> "/usr/lib/python2.4/site-packages/django/template/debug.py", line 71,
> in render_node result = node.render(context) File
> "/usr/lib/python2.4/site-packages/django/contrib/admin/templatetags/log.py" ,
> line 18, in render self.user = context[self.user].id File
> "/usr/lib/python2.4/site-packages/django/template/context.py", line
> 43, in __getitem__ raise KeyError(key) KeyError: u'user'
> After reading the document the most importante change I see is
> extracting the Admin class from the models and creating another class
> called MyModelAdmin that extends admin.ModelAdmin and modifying the
> urls.py to include:
> Any ideas to solve this problem in the new Admin interface version?
> 2008/7/21 Florencio Cano <florencio.c...@gmail.com>:
> > Hi!
> > I have updated Django from svn, installed a new app and some new
> > models and now when I try to browse /admin/ I get this error:
> > ViewDoesNotExist: Tried index in module
> > django.contrib.admin.views.main. Error was: 'module' object has no
> > attribute 'index'
> > I have checked that my user is the owner of all the files in
> > django.contrib.admin.views and I have checked that there not exist any
> > method in django.contrib.admin.views.main called index.
> > What is this attribute used for and how I can fix this error?
I think the easyest way to see the difference is if you do a new
django-admin startproject, and check the comments in urls.py
then you can go on and have a look at the admin.site.root as well,
that is put in urls.py by default, but if you just want a basic admin
site, then probably you won't need it
at least, this is what I did, and now I understand pretty well what
has happened :)
V
On Jul 21, 12:32 pm, "Florencio Cano" <florencio.c...@gmail.com>
wrote:
> The problem is that in the last versions in the repository of Django
> the Admin interface has changed. More info in:http://www.djangoproject.com/documentation/admin/ > I have read the documentation but now I have another error. Now the
> error is with the template index of the admin interface:
> TemplateSyntaxError at /admin/
> Caught an exception while rendering: u'user' Original Traceback (most
> recent call last): File
> "/usr/lib/python2.4/site-packages/django/template/debug.py", line 71,
> in render_node result = node.render(context) File
> "/usr/lib/python2.4/site-packages/django/contrib/admin/templatetags/log.py" ,
> line 18, in render self.user = context[self.user].id File
> "/usr/lib/python2.4/site-packages/django/template/context.py", line
> 43, in __getitem__ raise KeyError(key) KeyError: u'user'
> After reading the document the most importante change I see is
> extracting the Admin class from the models and creating another class
> called MyModelAdmin that extends admin.ModelAdmin and modifying the
> urls.py to include:
> > Hi!
> > I have updated Django from svn, installed a new app and some new
> > models and now when I try to browse /admin/ I get this error:
> > ViewDoesNotExist: Tried index in module
> > django.contrib.admin.views.main. Error was: 'module' object has no
> > attribute 'index'
> > I have checked that my user is the owner of all the files in
> > django.contrib.admin.views and I have checked that there not exist any
> > method in django.contrib.admin.views.main called index.
> > What is this attribute used for and how I can fix this error?
> Florencio Cano wrote: >> The problem is that in the last versions in the repository of Django >> the Admin interface has changed. More info in: >> http://www.djangoproject.com/documentation/admin/ >> I have read the documentation but now I have another error. Now the >> error is with the template index of the admin interface:
>> TemplateSyntaxError at /admin/ >> Caught an exception while rendering: u'user' Original Traceback (most >> recent call last): File >> "/usr/lib/python2.4/site-packages/django/template/debug.py", line 71, >> in render_node result = node.render(context) File >> "/usr/lib/python2.4/site-packages/django/contrib/admin/templatetags/log.py" , >> line 18, in render self.user = context[self.user].id File >> "/usr/lib/python2.4/site-packages/django/template/context.py", line >> 43, in __getitem__ raise KeyError(key) KeyError: u'user'
>> After reading the document the most importante change I see is >> extracting the Admin class from the models and creating another class >> called MyModelAdmin that extends admin.ModelAdmin and modifying the >> urls.py to include:
>> Any ideas to solve this problem in the new Admin interface version?
>> 2008/7/21 Florencio Cano <florencio.c...@gmail.com>: >> > Hi! >> > I have updated Django from svn, installed a new app and some new >> > models and now when I try to browse /admin/ I get this error:
>> > ViewDoesNotExist: Tried index in module >> > django.contrib.admin.views.main. Error was: 'module' object has no >> > attribute 'index'
>> > I have checked that my user is the owner of all the files in >> > django.contrib.admin.views and I have checked that there not exist any >> > method in django.contrib.admin.views.main called index.
>> > What is this attribute used for and how I can fix this error?
I had the same problem. The solution is update the new url.py (you
already did )
and drop the database and then re-sync you project (remember do a
backup of your data).
The new admin class have new tables on database, that works from me.
On Jul 30, 10:03 pm, Henhiskan <henhis...@gmail.com> wrote:
> I had the same problem. The solution is update the new url.py (you
> already did )
> and drop the database and then re-sync you project (remember do a
> backup of your data).
> The new admin class have new tables on database, that works from me.