Firstly, I think this should be posted to the
[email protected] instead.
So, just make sure to post queries on using Django to there only.


Coming back to your question.
If you are using your own user model then, I hope you are using the not
using the import
'from django.contrib.auth.models import User' when try to '
User.objects.anymethod()'.
Make sure that you are using something like 'from yourapp.models import
User'.
And also make sure that the custom db tables for your app is properly
synced.

And when using some custom authentication backend in your application, I
think you'll probably want to specify and use it in your settings.py
as something probably like the following:
AUTHENTICATION_BACKENDS = (
    'yourapp.backends.YourCustomBackend',
)

So, you'll also need to have the custom backend written too.

Thanks,
Subhranath Chunder.

On Fri, Jan 7, 2011 at 3:15 AM, Antony Vennard <[email protected]>wrote:

> Hello all,
>
> For various reasons a client of mine requested that, other than using a
> framework of their choice, I implement an authentication system
> following their spec. I used Django and implemented my own app which
> contains the usual models.py which implements a user object and so on.
>
> Django has been updated via my package manager several times since I
> last tested my code. I've now come back to that and what was previously
> working is breaking like so:
>
> DatabaseError at /
> column auth_user.first_name does not exist
> LINE 1: SELECT "auth_user"."id", "auth_user"."username", "auth_user"...
>
> This happens when I import my own models.py and try to
> User.objects.anymethod()
>
> Now, my model "User" doesn't contain the same fields as Django's
> obviously, so the conclusion is that Django's User model is being
> included when I've not asked it to be.
>
> Relevant parts from Settings.py:
>
> TEMPLATE_LOADERS = (
>    'django.template.loaders.filesystem.Loader',
>    'django.template.loaders.app_directories.Loader',
>    'django.template.loaders.eggs.Loader',
> )
>
> MIDDLEWARE_CLASSES = (
>    'django.middleware.common.CommonMiddleware',
>    'django.contrib.sessions.middleware.SessionMiddleware',
>    'django.middleware.csrf.CsrfViewMiddleware',
>    'django.contrib.messages.middleware.MessageMiddleware',
> )
>
> ROOT_URLCONF = 'Testbed.urls'
>
> TEMPLATE_DIRS = (
>    "/var/www/Django/Testbed/testapp/templates",
>    "/var/www/Django/Testbed/authadmin/templates",
> )
>
> AUTHENTICATION_BACKENDS = ('')
>
> TEMPLATE_CONTEXT_PROCESSORS = (
>    "vxd.auth.contexts.Authentication",
> )
>
> INSTALLED_APPS = (
>    'django.contrib.contenttypes',
>    'django.contrib.sessions',
>    'django.contrib.sites',
>    'reversetag',
>    'markitup',
>    'vxd.auth',
>    'Testbed.authadmin',
>    'Testbed.testapp',
> )
>
> Can anyone please explain what's changed?
>
> Likewise, I get various strange errors on a similar project using my
> system when I try to access the request.session["username"] key.
>
> An alternative is a project-wide rename; still, this isn't ideal.
>
> Thanks,
>
> A
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<django-developers%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/django-developers?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected].
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