If it works locally, then it would seem it is surely an environment issue. I'm using WebFaction for a Django project currently, as well. I haven't run into this problem, but I did have to customize a few things in order to get my project to run remotely on WebFaction. Check ~/webapps/[your_project]/apache2/conf/httpd.conf, and verify that the PYTHONPATH environment variable includes the path to the instance of Django you are using. That seems like the most likely culprit.
Chris Pratt On Jan 15, 3:58 am, Eric Abrahamsen <[EMAIL PROTECTED]> wrote: > I've got two django sites running on one server, each under a > different subdomain of one domain name (this is on WebFaction). They > run off the same codebase, r 7020 at present, different Apache > instances using mod_python, and both have the same problem: the admin > system seems to be unable to find the 'user' object. After a fresh > Apache restart, logging into the admin system gives the following > error traceback, triggered by trying to render the 'Change Password' > url tag, the second of the three that come from the base.html template > in contrib.admin.templates: > > ################ > > Traceback: > File "/home/user/lib/python2.5/django/template/debug.py" in > render_node > 71. result = node.render(context) > File "/home/user/lib/python2.5/django/template/defaulttags.py" in > render > 363. return reverse(self.view_name, args=args, > kwargs=kwargs) > File "/home/user/lib/python2.5/django/core/urlresolvers.py" in reverse > 297. return iri_to_uri(u'/' + > get_resolver(urlconf).reverse(viewname, *args, **kwargs)) > File "/home/user/lib/python2.5/django/core/urlresolvers.py" in reverse > 282. if lookup_view in self.reverse_dict: > File "/home/user/lib/python2.5/django/core/urlresolvers.py" in > _get_reverse_dict > 218. for key, value in > pattern.reverse_dict.iteritems(): > File "/home/user/lib/python2.5/django/core/urlresolvers.py" in > _get_reverse_dict > 221. self._reverse_dict[pattern.callback] = > (pattern,) > File "/home/user/lib/python2.5/django/core/urlresolvers.py" in > _get_callback > 178. self._callback = get_callable(self._callback_str) > File "/home/user/lib/python2.5/django/utils/functional.py" in wrapper > 18. result = func(*args) > File "/home/user/lib/python2.5/django/core/urlresolvers.py" in > get_callable > 47. lookup_view = getattr(__import__(mod_name, {}, > {}, ['']), func_name) > File "/home/user/lib/python2.5/django/contrib/admin/views/auth.py" in > <module> > 66. 'title': _('Change password: %s') % > escape(user.username), > > Exception Type: NameError at /admin/ > Exception Value: name 'user' is not defined > ############# > > Refreshing once or twice changes this to a plain old Reverse Match Not > Found, which means that I can get into the admin site and use it > normally (except for those three links at the top, which fail > silently), unless I try to add/change User objects, in which case it > gives me a variant on the above error again. > > I don't see how user can be undefined when the variable is set a few > lines earlier in the user_change_password() function. The same code > works fine in my local development environment (using the development > server instead of Apache/mod_python): the django codebase is at the > same revision and my own code is checked out in both places from the > same repository. Does this make sense to anyone? > > Thanks in advance, > Eric --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---