I was making an application that included user profiles, and I thought
I was done with the first part so I entered an sql command and got
this:

Ian-Smiths-Computer:~/Sites/matches ismith$ python manage.py sql nest
matches.cafe: cannot import name User
1 error found.
BEGIN;
CREATE TABLE `nest_userprofile` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `website` varchar(200) NOT NULL,
    `about` longtext NOT NULL,
    `avatar` varchar(100) NOT NULL,
    `user_id` integer NOT NULL UNIQUE REFERENCES `auth_user` (`id`)
);
COMMIT;

Here is what my nest/models.py looks like:

from django.db import models
from django.contrib.auth.models import User

# Create your models here.

class UserProfile(models.Model):
        website = models.URLField()
        about = models.TextField()
        avatar = models.ImageField(upload_to='avatars')
        user = models.ForeignKey(User, unique=True)
I'm using it to extend the User model, but for some reason it cannot
connect to it. I then tried to re-SQL another app in my project that
hadn't had a problem, and it gave the same error.

I even included  AUTH_PROFILE_MODULE = 'nest.UserProfile'  in my
project's settings.py

I was thinking maybe I should redownload django, to reset contrib/auth/
models.py, just in case it got modified somehow.


--~--~---------~--~----~------------~-------~--~----~
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