#16283: my application project.auth takes models from django.contrib.auth
--------------------------------------+------------------------------
               Reporter:  TheRoSS     |          Owner:  nobody
                   Type:  Bug         |         Status:  reopened
              Milestone:              |      Component:  contrib.auth
                Version:  1.3         |       Severity:  Normal
             Resolution:              |       Keywords:
           Triage Stage:  Unreviewed  |      Has patch:  0
    Needs documentation:  0           |    Needs tests:  0
Patch needs improvement:  0           |  Easy pickings:  0
                  UI/UX:  0           |
--------------------------------------+------------------------------
Changes (by TheRoSS):

 * status:  closed => reopened
 * resolution:  invalid =>


Comment:

 No! The problem is that I didn't used 'django.contrib.auth' at all! But
 cannot name my application 'auth'.

 My settings.py file:

 {{{
 DEBUG = True
 TEMPLATE_DEBUG = DEBUG

 DATABASES = {
     'default': {
         'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2',
 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
         'NAME': 'seka',                      # Or path to database file if
 using sqlite3.
         'USER': 'root',                      # Not used with sqlite3.
         'PASSWORD': 'root',                  # Not used with sqlite3.
         'HOST': '',                      # Set to empty string for
 localhost. Not used with sqlite3.
         'PORT': '',                      # Set to empty string for
 default. Not used with sqlite3.
     }
 }

 MIDDLEWARE_CLASSES = (
     'django.middleware.common.CommonMiddleware',
     'django.contrib.sessions.middleware.SessionMiddleware',
     'django.middleware.csrf.CsrfViewMiddleware',
 )

 ROOT_URLCONF = 'seka.urls'

 INSTALLED_APPS = (
     'seka.auth',
 )

 }}}


 My models.py:

 {{{
 from django.db import models
 from django.utils.translation import ugettext_lazy as _

 # Create your models here.
 class User (models.Model):
     username = models.CharField(_('username'), max_length=30, unique=True,
 help_text=_("Required. 30 characters or fewer. Letters, numbers and
 @/./+/-/_ characters"))

 }}}

 Bu running 'manage.py sql auth' gives:

 {{{
 BEGIN;
 CREATE TABLE `auth_permission` (
     `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
     `name` varchar(50) NOT NULL,
     `content_type_id` integer NOT NULL,
     `codename` varchar(100) NOT NULL,
     UNIQUE (`content_type_id`, `codename`)
 )
 ;
 CREATE TABLE `auth_group_permissions` (
     `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
     `group_id` integer NOT NULL,
     `permission_id` integer NOT NULL,
     UNIQUE (`group_id`, `permission_id`)
 )
 ;
 ALTER TABLE `auth_group_permissions` ADD CONSTRAINT
 `permission_id_refs_id_5886d21f` FOREIGN KEY (`permission_id`) REFERENCES
 `auth_permission` (`id`);
 CREATE TABLE `auth_group` (
     `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
     `name` varchar(80) NOT NULL UNIQUE
 )
 ;
 ALTER TABLE `auth_group_permissions` ADD CONSTRAINT
 `group_id_refs_id_3cea63fe` FOREIGN KEY (`group_id`) REFERENCES
 `auth_group` (`id`);
 CREATE TABLE `auth_user_user_permissions` (
     `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
     `user_id` integer NOT NULL,
     `permission_id` integer NOT NULL,
     UNIQUE (`user_id`, `permission_id`)
 )
 ;
 ALTER TABLE `auth_user_user_permissions` ADD CONSTRAINT
 `permission_id_refs_id_67e79cb` FOREIGN KEY (`permission_id`) REFERENCES
 `auth_permission` (`id`);
 CREATE TABLE `auth_user_groups` (
     `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
     `user_id` integer NOT NULL,
     `group_id` integer NOT NULL,
     UNIQUE (`user_id`, `group_id`)
 )
 ;
 ALTER TABLE `auth_user_groups` ADD CONSTRAINT `group_id_refs_id_f116770`
 FOREIGN KEY (`group_id`) REFERENCES `auth_group` (`id`);
 CREATE TABLE `auth_user` (
     `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
     `username` varchar(30) NOT NULL UNIQUE,
     `first_name` varchar(30) NOT NULL,
     `last_name` varchar(30) NOT NULL,
     `email` varchar(75) NOT NULL,
     `password` varchar(128) NOT NULL,
     `is_staff` bool NOT NULL,
     `is_active` bool NOT NULL,
     `is_superuser` bool NOT NULL,
     `last_login` datetime NOT NULL,
     `date_joined` datetime NOT NULL
 )
 ;
 ALTER TABLE `auth_user_user_permissions` ADD CONSTRAINT
 `user_id_refs_id_dfbab7d` FOREIGN KEY (`user_id`) REFERENCES `auth_user`
 (`id`);
 ALTER TABLE `auth_user_groups` ADD CONSTRAINT `user_id_refs_id_7ceef80f`
 FOREIGN KEY (`user_id`) REFERENCES `auth_user`(`id`);
 CREATE TABLE `auth_message` (
     `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
     `user_id` integer NOT NULL,
     `message` longtext NOT NULL
 )
 ;
 ALTER TABLE `auth_message` ADD CONSTRAINT `user_id_refs_id_650f49a6`
 FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`);
 -- The following references should be added but depend on non-existent
 tables:
 -- ALTER TABLE `auth_permission` ADD CONSTRAINT
 `content_type_id_refs_id_728de91f` FOREIGN KEY (`content_type_id`)
 REFERENCES `django_content_type` (`id`);
 COMMIT;
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/16283#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to