straight55b / app-engine-patch

Automatically exported from code.google.com/p/app-engine-patch
0 stars 0 forks source link

Upgrading from patch 1.0 to 1.0.2.1 fails #181

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm sure it something wrong in my models

1. installed all the files in common/ from aep into my common
2. ran all tests, all pass
3. When I run it online I get:

AttributeError at /

'module' object has no attribute 'User'

Request Method:     GET
Request URL:    http://localhost:8084/
Exception Type:     AttributeError
Exception Value:    

'module' object has no attribute 'User'

Exception Location: 
/Users/nix/Documents/workspace/cirrusmachina/common/zip-packages/django-1.0.2.zi
p/django/contrib/auth/models.py
in <module>, line 460

What is the expected output? What do you see instead?
I expected to see my home page: I believe something is wrong with my
settings.py

What version of the product are you using? On what operating system?
This is latest GoogleAppEngineLauncher: 1.2.3.422
Python 2.5.1
MacOS 10.5.x

Please provide any additional information below.

Here is a stripped-down copy of my settings.py:

----%<----CUT

# -*- coding: utf-8 -*-
from datetime import timedelta, datetime
import os

_server_software = os.environ.get('SERVER_SOFTWARE','').lower()
if _server_software.startswith('goog'):
    DEBUG = False
else:
    DEBUG = True
del _server_software

TEMPLATE_DEBUG = DEBUG

DATABASE_ENGINE = 'appengine'

MEDIA_URL = '/media/'

# Auth User Model (see app-engine-patch docs)
AUTH_USER_MODULE = 'user.models'

TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.load_template_source',
    'ragendja.template.app_prefixed_loader',
    'django.template.loaders.app_directories.load_template_source',
)

MIDDLEWARE_CLASSES = (
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.middleware.common.CommonMiddleware',
    'ragendja.middleware.LoginRequiredMiddleware',
)

ROOT_URLCONF = 'urls'

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.sessions',
    'django.contrib.webdesign',
    'appenginepatcher',
    'user',
    'message',
    'image',
    'comment',
    'services',
    'contact'
)

TEMPLATE_CONTEXT_PROCESSORS = (
    'django.core.context_processors.auth',
    'django.core.context_processors.media',
    'django.core.context_processors.request',
)

TEMPLATE_DIRS = (
    os.path.join(os.path.dirname(__file__), 'templates'),
)

# Make this unique, and don't share it with anybody.
SECRET_KEY = 'DELETED'

# Reserved Slugs
RESERVED_SLUGS = {
    'user.models.User' : [
        'login', 'logout'
    ]
}
----%<----CUT

Original issue reported on code.google.com by nick.bau...@gmail.com on 8 Jul 2009 at 4:26

GoogleCodeExporter commented 9 years ago
Do you always import User via django.contrib.auth.models? Or do you sometimes 
import 
from user.models?

Original comment by wkornew...@gmail.com on 8 Jul 2009 at 4:33

GoogleCodeExporter commented 9 years ago
the latter

Original comment by nick.bau...@gmail.com on 8 Jul 2009 at 5:05

GoogleCodeExporter commented 9 years ago
Then please change all your imports.

Original comment by wkornew...@gmail.com on 8 Jul 2009 at 5:06

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
So everywhere I have:

from user.models import User

I change to:

from django.contrib.auth.models import User
#from user.models import User

And I still get the same problem.

Original comment by nick.bau...@gmail.com on 8 Jul 2009 at 7:06

GoogleCodeExporter commented 9 years ago
OK, I missed an import. It seems to be working, now! 

Is this way of doing it going to stay around? I really think App Engine Patch is
awesome, but the way these dependencies are managed seem hard to grok and easy 
to
screw up by stupid people like me :)

Original comment by nick.bau...@gmail.com on 8 Jul 2009 at 7:34

GoogleCodeExporter commented 9 years ago
I think they'll have to stay that way. The documentation could put more 
emphasize on 
it, but in general it's mentioned there. In any case, by loading from 
django.contrib.auth.models your code becomes less dependent on a specific 
module 
configuration, so this import style was always favored in the documentation.

Original comment by wkornew...@gmail.com on 8 Jul 2009 at 10:27