On Tue, Dec 20, 2011 at 11:09 PM, Divick Kishore <divick.kish...@gmail.com>wrote:
> On Wed, Dec 21, 2011 at 6:04 AM, Branton Davis <blueca...@gmail.com> > wrote: > > It sounds like your custom user template context variable might be > causing a > > conflict with the default if you're also using django.contrib.auth > (which is > > what the admin uses by default). I'm guessing that the admin > > views/templates use a 'user' variable. > > Yeah, I am using the django.contrib.auth in my project. > > > > > Not knowing anything your project, I assume your User model is an > extension > > of the django User model. If so, I would generally recommend extending > the > > django User model, as described yonder: > > > https://docs.djangoproject.com/en/dev/topics/auth/#storing-additional-information-about-users > > > > I don't really need /want my User model to be an extension of django's > User model. I need admin functionality only for backend processing and > the users don't login to my site using the regular admin User. I just > want person handling the backend to modify and edit the Database > visually (mostly for order processing). > > > At the very least, for debugging your current problem, a couple things to > > try: > > 1) Pull your custom context processor out of the loop and see if the > admin > > works correctly. If so, that confirms that it caused a conflict. > > - If you have custom admin templates (for the /admin/ view, or > > whatever view you're trying to hit), you may also have to adjust them, if > > they were relying on that context variable. > > 2) Change the name of the context variable you use (try 'appname_user' > or > > something else that will differentiate it. > > I tried both but I am getting a completely different error (stack trace > below). > > > ERROR Caught ViewDoesNotExist while rendering: Tried > ajax_handle_wishinvite in module gifts.views. Error was: 'module' > object has no attribute 'ajax_handle_wishinvite' > Traceback (most recent call last): > File > "/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py", > line 111, in get_response > response = callback(request, *callback_args, **callback_kwargs) > File > "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/sites.py", > line 214, in wrapper > return self.admin_view(view, cacheable)(*args, **kwargs) > File "/usr/local/lib/python2.6/dist-packages/django/utils/decorators.py", > line 93, in _wrapped_view > response = view_func(request, *args, **kwargs) > File > "/usr/local/lib/python2.6/dist-packages/django/views/decorators/cache.py", > line 79, in _wrapped_view_func > response = view_func(request, *args, **kwargs) > File > "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/sites.py", > line 197, in inner > return view(request, *args, **kwargs) > File > "/usr/local/lib/python2.6/dist-packages/django/views/decorators/cache.py", > line 79, in _wrapped_view_func > response = view_func(request, *args, **kwargs) > File > "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/sites.py", > line 382, in index > context_instance=context_instance > File > "/usr/local/lib/python2.6/dist-packages/django/shortcuts/__init__.py", > line 20, in render_to_response > return HttpResponse(loader.render_to_string(*args, **kwargs), > **httpresponse_kwargs) > File "/usr/local/lib/python2.6/dist-packages/django/template/loader.py", > line 188, in render_to_string > return t.render(context_instance) > File "/usr/local/lib/python2.6/dist-packages/django/template/base.py", > line 123, in render > return self._render(context) > File "/usr/local/lib/python2.6/dist-packages/django/test/utils.py", > line 57, in instrumented_test_render > return self.nodelist.render(context) > File "/usr/local/lib/python2.6/dist-packages/django/template/base.py", > line 744, in render > bits.append(self.render_node(node, context)) > File "/usr/local/lib/python2.6/dist-packages/django/template/debug.py", > line 73, in render_node > result = node.render(context) > File > "/usr/local/lib/python2.6/dist-packages/django/template/loader_tags.py", > line 127, in render > return compiled_parent._render(context) > File "/usr/local/lib/python2.6/dist-packages/django/test/utils.py", > line 57, in instrumented_test_render > return self.nodelist.render(context) > File "/usr/local/lib/python2.6/dist-packages/django/template/base.py", > line 744, in render > bits.append(self.render_node(node, context)) > File "/usr/local/lib/python2.6/dist-packages/django/template/debug.py", > line 73, in render_node > result = node.render(context) > File > "/usr/local/lib/python2.6/dist-packages/django/template/loader_tags.py", > line 127, in render > return compiled_parent._render(context) > File "/usr/local/lib/python2.6/dist-packages/django/test/utils.py", > line 57, in instrumented_test_render > return self.nodelist.render(context) > File "/usr/local/lib/python2.6/dist-packages/django/template/base.py", > line 744, in render > bits.append(self.render_node(node, context)) > File "/usr/local/lib/python2.6/dist-packages/django/template/debug.py", > line 73, in render_node > result = node.render(context) > File > "/usr/local/lib/python2.6/dist-packages/django/template/defaulttags.py", > line 311, in render > return self.nodelist_true.render(context) > File "/usr/local/lib/python2.6/dist-packages/django/template/base.py", > line 744, in render > bits.append(self.render_node(node, context)) > File "/usr/local/lib/python2.6/dist-packages/django/template/debug.py", > line 73, in render_node > result = node.render(context) > File > "/usr/local/lib/python2.6/dist-packages/django/template/defaulttags.py", > line 311, in render > return self.nodelist_true.render(context) > File "/usr/local/lib/python2.6/dist-packages/django/template/base.py", > line 744, in render > bits.append(self.render_node(node, context)) > File "/usr/local/lib/python2.6/dist-packages/django/template/debug.py", > line 73, in render_node > result = node.render(context) > File > "/usr/local/lib/python2.6/dist-packages/django/template/loader_tags.py", > line 64, in render > result = block.nodelist.render(context) > File "/usr/local/lib/python2.6/dist-packages/django/template/base.py", > line 744, in render > bits.append(self.render_node(node, context)) > File "/usr/local/lib/python2.6/dist-packages/django/template/debug.py", > line 73, in render_node > result = node.render(context) > File > "/usr/local/lib/python2.6/dist-packages/django/template/defaulttags.py", > line 437, in render > url = reverse(view_name, args=args, kwargs=kwargs, > current_app=context.current_app) > File "/usr/local/lib/python2.6/dist-packages/django/core/urlresolvers.py", > line 391, in reverse > *args, **kwargs))) > File "/usr/local/lib/python2.6/dist-packages/django/core/urlresolvers.py", > line 312, in reverse > possibilities = self.reverse_dict.getlist(lookup_view) > File "/usr/local/lib/python2.6/dist-packages/django/core/urlresolvers.py", > line 229, in _get_reverse_dict > self._populate() > File "/usr/local/lib/python2.6/dist-packages/django/core/urlresolvers.py", > line 208, in _populate > for name in pattern.reverse_dict: > File "/usr/local/lib/python2.6/dist-packages/django/core/urlresolvers.py", > line 229, in _get_reverse_dict > self._populate() > File "/usr/local/lib/python2.6/dist-packages/django/core/urlresolvers.py", > line 220, in _populate > lookups.appendlist(pattern.callback, (bits, p_pattern)) > File "/usr/local/lib/python2.6/dist-packages/django/core/urlresolvers.py", > line 170, in _get_callback > raise ViewDoesNotExist("Tried %s in module %s. Error was: %s" % > (func_name, mod_name, str(e))) > TemplateSyntaxError: Caught ViewDoesNotExist while rendering: Tried > ajax_handle_wishinvite in module gifts.views. Error was: 'module' > object has no attribute 'ajax_handle_wishinvite' > [21/Dec/2011 10:19:05] "GET /admin/ HTTP/1.1" 500 549386 > > > Thanks for the response, > Regards, > DivKis > That stack trace is unrelated to the other problem. Somewhere (guessing gifts/urls.py) you've referenced a view at gifts.views.ajax_handle_wishinvite, which doesn't exist. Check gifts/views.py for a method named 'ajax_handle_wishinvite', which is likely missing or misspelled. -- 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 django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.