I am trying to extend the django base user class using the instructions here:
http://code.djangoproject.com/wiki/ExtendedUserModel
I have built my model, gotten the sql and installed with
python manage.py install auth
all looks good.
but I am new to both django and python and am stuck on this step:
[02:19] <harmless> 1. patch the createsuperuser function in core/management.py to catch ObjectDoesNotExist rather than
users.UserDoesNotExist
I find on line 520 or so of management.py this:
520 except users.UserDoesNotExist:
which I change to this:
520 except ObjectDoesNotExist:
seems ok. then when trying
python manage.py createsuperuser
now I get this:
AttributeError: 'module' object has no attribute 'ObjectDoesNotExist'
so I tried to import ObjectDoesNotExist by putting this at the top of
manage.py:
from django.core.exceptions import ObjectDoesNotExist
and then I get this:
python manage.py createsuperuser
Traceback (most recent call last):
File "manage.py", line 2, in ?
from django.core.management
import execute_manager
File "/Library/Python/2.3/site-packages/Django-0.91-py2.3.egg/django/core/management.py", line 7, in ?
from django.core.exceptions import ObjectDoesNotExist
File "/Library/Python/2.3/site-packages/Django-0.91-py2.3.egg/django/core/exceptions.py", line 3, in ?
from
django.core.template import SilentVariableFailure
File "/Library/Python/2.3/site-packages/Django-0.91-py2.3.egg
/django/core/template/__init__.py", line 60, in ?
from django.conf.settings import DEFAULT_CHARSET, TEMPLATE_DEBUG
File "/Library/Python/2.3/site-packages/Django-0.91-py2.3.egg/django/conf/settings.py", line 29, in ?
raise EnvironmentError, "Environment variable %s is undefined." % ENVIRONMENT_VARIABLE
EnvironmentError: Environment variable DJANGO_SETTINGS_MODULE is undefined.
it seems that importing that exception makes django forget everything it knew asbout my project!
can someone give me a little push in the right direction?
thanks so much.
---fej
Talk is cheap. Supply exceeds Demand.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---