I discovered the problem: I had added settings to my settings.py to
print out the variable name if the variable didn't exist. These are
the values:

TEMPLATE_DEBUG = DEBUG
TEMPLATE_STRING_IF_INVALID = '%s'

Some of the admin templates make use of variables that don't actually
exist. If the value is simply blank, the page will work. If, however
the name of the variable is printed it won't work. See this ticket for
more info:

http://code.djangoproject.com/ticket/3579

The solution was to comment out those two settings and like magic it
works.

Kevin


On Jun 8, 6:32 pm, Kevin Audleman <kevin.audle...@gmail.com> wrote:
> I go into the admin section of my site, click on Users, then on the
> 'Add User' button. It takes me to a screen that asks me to put in a
> username and password and click 'Save'. At this point I get an error:
>
> ValueError at /admin/auth/user/add/form_url
>
> invalid literal for int() with base 10: 'add/form_url'
>
> I wondered if it might have to do with any of the changes I had made
> though defining an admin.py in my app, so I removed it and went back
> to the stock admin site. The error persists. The full trace is below.
>
> Any help greatly appreciated!
>
> Kevin
> -----------------------------------------------------------------------------------------------
> -----------------------------------------------------------------------------------------------
>
> Environment:
>
> Request Method: POST
> Request URL:http://localhost:8001/admin/auth/user/add/form_url
> Django Version: 1.0.2 final
> Python Version: 2.5.1
> Installed Applications:
> ['django.contrib.auth',
>  'django.contrib.contenttypes',
>  'django.contrib.sessions',
>  'django.contrib.sites',
>  'django.contrib.admin',
>  'registration',
>  'profiles',
>  'CasaCasa.customprofile',
>  'django.contrib.humanize']
> Installed Middleware:
> ('django.middleware.common.CommonMiddleware',
>  'django.contrib.sessions.middleware.SessionMiddleware',
>  'django.contrib.auth.middleware.AuthenticationMiddleware')
>
> Traceback:
> File "/Library/Python/2.5/site-packages/django/core/handlers/base.py"
> in get_response
>   86.                 response = callback(request, *callback_args,
> **callback_kwargs)
> File "/Library/Python/2.5/site-packages/django/contrib/admin/sites.py"
> in root
>   157.                 return self.model_page(request, *url.split('/',
> 2))
> File "/Library/Python/2.5/site-packages/django/views/decorators/
> cache.py" in _wrapped_view_func
>   44.         response = view_func(request, *args, **kwargs)
> File "/Library/Python/2.5/site-packages/django/contrib/admin/sites.py"
> in model_page
>   176.         return admin_obj(request, rest_of_url)
> File "/Library/Python/2.5/site-packages/django/contrib/auth/admin.py"
> in __call__
>   42.         return super(UserAdmin, self).__call__(request, url)
> File "/Library/Python/2.5/site-packages/django/contrib/admin/
> options.py" in __call__
>   197.             return self.change_view(request, unquote(url))
> File "/Library/Python/2.5/site-packages/django/db/transaction.py" in
> _commit_on_success
>   238.                 res = func(*args, **kw)
> File "/Library/Python/2.5/site-packages/django/contrib/admin/
> options.py" in change_view
>   548.             obj = model._default_manager.get(pk=object_id)
> File "/Library/Python/2.5/site-packages/django/db/models/manager.py"
> in get
>   93.         return self.get_query_set().get(*args, **kwargs)
> File "/Library/Python/2.5/site-packages/django/db/models/query.py" in
> get
>   303.         clone = self.filter(*args, **kwargs)
> File "/Library/Python/2.5/site-packages/django/db/models/query.py" in
> filter
>   489.         return self._filter_or_exclude(False, *args, **kwargs)
> File "/Library/Python/2.5/site-packages/django/db/models/query.py" in
> _filter_or_exclude
>   507.             clone.query.add_q(Q(*args, **kwargs))
> File "/Library/Python/2.5/site-packages/django/db/models/sql/query.py"
> in add_q
>   1258.                             can_reuse=used_aliases)
> File "/Library/Python/2.5/site-packages/django/db/models/sql/query.py"
> in add_filter
>   1201.         self.where.add((alias, col, field, lookup_type,
> value), connector)
> File "/Library/Python/2.5/site-packages/django/db/models/sql/where.py"
> in add
>   48.                 params = field.get_db_prep_lookup(lookup_type,
> value)
> File "/Library/Python/2.5/site-packages/django/db/models/fields/
> __init__.py" in get_db_prep_lookup
>   202.             return [self.get_db_prep_value(value)]
> File "/Library/Python/2.5/site-packages/django/db/models/fields/
> __init__.py" in get_db_prep_value
>   353.         return int(value)
>
> Exception Type: ValueError at /admin/auth/user/add/form_url
> Exception Value: invalid literal for int() with base 10: 'add/
> form_url'
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to