Объект «ModelOptions» не имеет атрибута «local_many_to_many» - PullRequest
3 голосов
/ 02 мая 2011

Я пытаюсь перенести проект Django в GAE (Google App Engine)

Проблема в том, что я обнаружил эту ошибку при попытке входа в систему:

'ModelOptions' object has no attribute 'local_many_to_many'

Строка, провоцирующая ошибку:

user = authenticate(username=uName,password=uPass)

Частичный код:

 if request.method == 'POST':
        if request.POST['submit'] == 'Login':
            postDict = request.POST.copy()
            lForm = LoginForm(postDict)
            if (lForm.is_valid()):
                uName = request.POST['username']
                uPass = request.POST['password']
                user = authenticate(username=uName,password=uPass) 
                if user is not None:
                    if user.is_active:
                        login(request,user)
                        return HttpResponseRedirect(next)
                    else:
                        message = 'Account Deactivated'

Трассировка:

    ['/Users/xavicolomer/Dropbox/projects/workspace2/test', 
'/Users/xavicolomer/Dropbox/projects/workspace2/test/django.zip', 
'/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine', 
'/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/antlr3', 
'/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/django_0_96', 
'/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/fancy_urllib', 
'/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/ipaddr', 
'/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webob', 
'/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/yaml/lib', 
'/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/simplejson', 
'/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/graphy', 
'/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine', 
'/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources', 
'/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python26.zip', 
'/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6', 
'/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-darwin', 
'/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-mac', 
'/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-mac/lib-scriptpackages', '/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python', 
'/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk', 
'/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-old', 
'/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynload', 
'/Library/Python/2.6/site-packages', 
'/usr/share/django/django-trunk', 
'/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/PyObjC', 
'/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/wx-2.8-mac-unicode']

1 Ответ

0 голосов
/ 29 мая 2011

Используете ли вы стандартное приложение для аутентификации, поставляемое с django-nonrel? Это не сработает, потому что требует соединения. Установите django -missions-backend-nonrel и все будет хорошо.

...