Do you have 'django.contrib.auth' and 'django.contrib.contenttypes' in
your INSTALLED_APPS setting?

On Jul 2, 10:20 am, Fernando Rodríguez <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm learning django with "the definitve guide to django". On chapter 6,
> I tried to activate the admin interface fro the "books" app, by adding
> django.contrib.admin to the INSTALLED_APPS and then calling manage.py
> syncdb.
>
> It failed with the following error:
>
> --------------------------------------------------------------------------------
> [EMAIL PROTECTED]:~/django/mysite$ manage syncdb
> Error: Couldn't install apps, because there were errors in one or more
> models:
> admin.logentry: 'user' has relation with model User, which has not been
> installed
> admin.logentry: 'content_type' has relation with model ContentType,
> which has not been installed
> ----------------------------------------------------------------------------------
>
> The book mentions a possible error (though not that one), and the fix is
> to run create_superuser.py. I tried, and it didn't work either:
>
> ----------------------------------------------------------------------------------
> Traceback (most recent call last):
>   File "./create_superuser.py", line 8, in <module>
>     from django.core import validators
>   File "/var/lib/python-support/python2.5/django/core/validators.py",
> line 13, in <module>
>     from django.utils.translation import gettext, gettext_lazy, ngettext
>   File
> "/var/lib/python-support/python2.5/django/utils/translation/__init__.py", 
> line 3, in <module>
>     if settings.USE_I18N:
>   File "/var/lib/python-support/python2.5/django/conf/__init__.py", line
> 28, in __getattr__
>     self._import_settings()
>   File "/var/lib/python-support/python2.5/django/conf/__init__.py", line
> 53, in _import_settings
>     raise EnvironmentError, "Environment variable %s is undefined." %
> ENVIRONMENT_VARIABLE
> EnvironmentError: Environment variable DJANGO_SETTINGS_MODULE is
> undefined.
> [EMAIL PROTECTED]:/usr/share/python-support/python-django/django/contrib
> ----------------------------------------------------------------------------------------------
>
> Any suggestions? O:-)
>
> Thanks!
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to