Anmeldung auf der Django-Administrationsseite mit einem gültigen Benutzernamen und Passwort nicht möglich

Ich kann mich nicht auf der Django-Administrationsseite anmelden. Wenn ich einen gültigen Benutzernamen und ein gültiges Kennwort eingebe, wird die Anmeldeseite ohne Fehlermeldungen erneut angezeigt

Diese Frage ist in derdjango FAQ, aber ich habe die Antworten dort durchgesehen und komme immer noch nicht über den anfänglichen Anmeldebildschirm hinaus.

Ich benutze Django 1.4 auf Ubuntu 12.04 mit Apache2 und Modwsgi.

Ich habe bestätigt, dass ich den Administrator in der registriereadmin.py Datei, stellen Sie sicher, dass Sie nach dem Hinzufügen die Datei synchronisierenINSTALLED_APPS. Wenn ich das falsche Passwort eingebeTUN erhalte einen Fehler, sodass mein Admin-Benutzer authentifiziert wird und nicht zur Admin-Seite weitergeht.

Ich habe beide Einstellungen ausprobiertSESSION_COOKIE_DOMAIN an die IP des Rechners und Keine. (Bestätigt, dass die Cookie-Domain als IP-Adresse des Computers in Chrom angezeigt wird.)

Überprüfen Sie auch, ob sich der Benutzer über die Shell authentifiziert:

>>> from django.contrib.auth import authenticate
>>> u = authenticate(username="user", password="pass")
>>> u.is_staff
True
>>> u.is_superuser
True
>>> u.is_active 
True

Beim Versuch, sich mit IE8 und Chrome Canary anzumelden, kehren beide zum Anmeldebildschirm zurück.

Fehlt mir noch etwas ????

settings.py

...
MIDDLEWARE_CLASSES = (
    'django.middleware.gzip.GZipMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.middleware.transaction.TransactionMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
)
AUTHENTICATION_BACKENDS = ('django.contrib.auth.backends.ModelBackend',)
INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.admin',    
    'django.contrib.staticfiles',
    'django.contrib.gis',
    'myapp.main',
)

SESSION_EXPIRE_AT_BROWSER_CLOSE = True
SESSION_SAVE_EVERY_REQUEST = True
SESSION_COOKIE_AGE = 86400 # sec
SESSION_COOKIE_DOMAIN = None
SESSION_COOKIE_NAME = 'DSESSIONID'
SESSION_COOKIE_SECURE = False

urls.py

from django.conf.urls.defaults import * #@UnusedWildImport
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.contrib import admin

admin.autodiscover()

urlpatterns = patterns('',
    (r'^bin/', include('myproject.main.urls')),    
    (r'^layer/r(?P<layer_id>\d+)/

Apache-Version:

Apache/2.2.22 (Ubuntu) mod_wsgi/3.3 Python/2.7.3 configured

Apache apache2 / sites-available / default:

<VirtualHost *:80>
        ServerAdmin ironman@localhost
        DocumentRoot /var/www/bin
        LogLevel warn
        WSGIDaemonProcess lbs processes=2 maximum-requests=500 threads=1
        WSGIProcessGroup lbs
        WSGIScriptAlias / /var/www/bin/apache/django.wsgi
        Alias /static /var/www/lbs/static/
</VirtualHost>
<VirtualHost *:8080>
        ServerAdmin ironman@localhost
        DocumentRoot /var/www/bin
        LogLevel warn
        WSGIDaemonProcess tilestache processes=2 maximum-requests=500 threads=1
        WSGIProcessGroup tilestache
        WSGIScriptAlias / /var/www/bin/tileserver/tilestache.wsgi
</VirtualHost>

AKTUALISIEREN

Die Admin-Seite wird bei Verwendung des Entwicklungsservers über fortgesetztrunserver es scheint also ein wsgi / apache problem zu sein. Ich habe es immer noch nicht herausgefunden.

LÖSUNG

Das Problem war, dass ich die Einstellungsdatei hatteSESSION_ENGINE Wert auf gesetzt'django.contrib.sessions.backends.cache' ohne mit demCACHE_BACKEND richtig konfiguriert.

Ich habe die SESSION_ENGINE in geändert'django.contrib.sessions.backends.db' was das Problem behoben hat.

, "myproject.layer.views.get_result_layer"), (r'^layer/b(?P<layer_id>\d+)/

Apache-Version:

Apache/2.2.22 (Ubuntu) mod_wsgi/3.3 Python/2.7.3 configured

Apache apache2 / sites-available / default:

<VirtualHost *:80>
        ServerAdmin ironman@localhost
        DocumentRoot /var/www/bin
        LogLevel warn
        WSGIDaemonProcess lbs processes=2 maximum-requests=500 threads=1
        WSGIProcessGroup lbs
        WSGIScriptAlias / /var/www/bin/apache/django.wsgi
        Alias /static /var/www/lbs/static/
</VirtualHost>
<VirtualHost *:8080>
        ServerAdmin ironman@localhost
        DocumentRoot /var/www/bin
        LogLevel warn
        WSGIDaemonProcess tilestache processes=2 maximum-requests=500 threads=1
        WSGIProcessGroup tilestache
        WSGIScriptAlias / /var/www/bin/tileserver/tilestache.wsgi
</VirtualHost>

AKTUALISIEREN

Die Admin-Seite wird bei Verwendung des Entwicklungsservers über fortgesetztrunserver es scheint also ein wsgi / apache problem zu sein. Ich habe es immer noch nicht herausgefunden.

LÖSUNG

Das Problem war, dass ich die Einstellungsdatei hatteSESSION_ENGINE Wert auf gesetzt'django.contrib.sessions.backends.cache' ohne mit demCACHE_BACKEND richtig konfiguriert.

Ich habe die SESSION_ENGINE in geändert'django.contrib.sessions.backends.db' was das Problem behoben hat.

, "myproject.layer.views.get_baseline_layer"), (r'^layer/c(?P<layer_id>\d+)/

Apache-Version:

Apache/2.2.22 (Ubuntu) mod_wsgi/3.3 Python/2.7.3 configured

Apache apache2 / sites-available / default:

<VirtualHost *:80>
        ServerAdmin ironman@localhost
        DocumentRoot /var/www/bin
        LogLevel warn
        WSGIDaemonProcess lbs processes=2 maximum-requests=500 threads=1
        WSGIProcessGroup lbs
        WSGIScriptAlias / /var/www/bin/apache/django.wsgi
        Alias /static /var/www/lbs/static/
</VirtualHost>
<VirtualHost *:8080>
        ServerAdmin ironman@localhost
        DocumentRoot /var/www/bin
        LogLevel warn
        WSGIDaemonProcess tilestache processes=2 maximum-requests=500 threads=1
        WSGIProcessGroup tilestache
        WSGIScriptAlias / /var/www/bin/tileserver/tilestache.wsgi
</VirtualHost>

AKTUALISIEREN

Die Admin-Seite wird bei Verwendung des Entwicklungsservers über fortgesetztrunserver es scheint also ein wsgi / apache problem zu sein. Ich habe es immer noch nicht herausgefunden.

LÖSUNG

Das Problem war, dass ich die Einstellungsdatei hatteSESSION_ENGINE Wert auf gesetzt'django.contrib.sessions.backends.cache' ohne mit demCACHE_BACKEND richtig konfiguriert.

Ich habe die SESSION_ENGINE in geändert'django.contrib.sessions.backends.db' was das Problem behoben hat.

, "myproject.layer.views.get_candidate_layer"), (r'^layers/

Apache-Version:

Apache/2.2.22 (Ubuntu) mod_wsgi/3.3 Python/2.7.3 configured

Apache apache2 / sites-available / default:

<VirtualHost *:80>
        ServerAdmin ironman@localhost
        DocumentRoot /var/www/bin
        LogLevel warn
        WSGIDaemonProcess lbs processes=2 maximum-requests=500 threads=1
        WSGIProcessGroup lbs
        WSGIScriptAlias / /var/www/bin/apache/django.wsgi
        Alias /static /var/www/lbs/static/
</VirtualHost>
<VirtualHost *:8080>
        ServerAdmin ironman@localhost
        DocumentRoot /var/www/bin
        LogLevel warn
        WSGIDaemonProcess tilestache processes=2 maximum-requests=500 threads=1
        WSGIProcessGroup tilestache
        WSGIScriptAlias / /var/www/bin/tileserver/tilestache.wsgi
</VirtualHost>

AKTUALISIEREN

Die Admin-Seite wird bei Verwendung des Entwicklungsservers über fortgesetztrunserver es scheint also ein wsgi / apache problem zu sein. Ich habe es immer noch nicht herausgefunden.

LÖSUNG

Das Problem war, dass ich die Einstellungsdatei hatteSESSION_ENGINE Wert auf gesetzt'django.contrib.sessions.backends.cache' ohne mit demCACHE_BACKEND richtig konfiguriert.

Ich habe die SESSION_ENGINE in geändert'django.contrib.sessions.backends.db' was das Problem behoben hat.

, "myproject.layer.views.get_layer_definitions"), (r'^js/mapui.js

Apache-Version:

Apache/2.2.22 (Ubuntu) mod_wsgi/3.3 Python/2.7.3 configured

Apache apache2 / sites-available / default:

<VirtualHost *:80>
        ServerAdmin ironman@localhost
        DocumentRoot /var/www/bin
        LogLevel warn
        WSGIDaemonProcess lbs processes=2 maximum-requests=500 threads=1
        WSGIProcessGroup lbs
        WSGIScriptAlias / /var/www/bin/apache/django.wsgi
        Alias /static /var/www/lbs/static/
</VirtualHost>
<VirtualHost *:8080>
        ServerAdmin ironman@localhost
        DocumentRoot /var/www/bin
        LogLevel warn
        WSGIDaemonProcess tilestache processes=2 maximum-requests=500 threads=1
        WSGIProcessGroup tilestache
        WSGIScriptAlias / /var/www/bin/tileserver/tilestache.wsgi
</VirtualHost>

AKTUALISIEREN

Die Admin-Seite wird bei Verwendung des Entwicklungsservers über fortgesetztrunserver es scheint also ein wsgi / apache problem zu sein. Ich habe es immer noch nicht herausgefunden.

LÖSUNG

Das Problem war, dass ich die Einstellungsdatei hatteSESSION_ENGINE Wert auf gesetzt'django.contrib.sessions.backends.cache' ohne mit demCACHE_BACKEND richtig konfiguriert.

Ich habe die SESSION_ENGINE in geändert'django.contrib.sessions.backends.db' was das Problem behoben hat.

, "myproject.layer.views.view_mapjs"), (r'^tilestache/config/

Apache-Version:

Apache/2.2.22 (Ubuntu) mod_wsgi/3.3 Python/2.7.3 configured

Apache apache2 / sites-available / default:

<VirtualHost *:80>
        ServerAdmin ironman@localhost
        DocumentRoot /var/www/bin
        LogLevel warn
        WSGIDaemonProcess lbs processes=2 maximum-requests=500 threads=1
        WSGIProcessGroup lbs
        WSGIScriptAlias / /var/www/bin/apache/django.wsgi
        Alias /static /var/www/lbs/static/
</VirtualHost>
<VirtualHost *:8080>
        ServerAdmin ironman@localhost
        DocumentRoot /var/www/bin
        LogLevel warn
        WSGIDaemonProcess tilestache processes=2 maximum-requests=500 threads=1
        WSGIProcessGroup tilestache
        WSGIScriptAlias / /var/www/bin/tileserver/tilestache.wsgi
</VirtualHost>

AKTUALISIEREN

Die Admin-Seite wird bei Verwendung des Entwicklungsservers über fortgesetztrunserver es scheint also ein wsgi / apache problem zu sein. Ich habe es immer noch nicht herausgefunden.

LÖSUNG

Das Problem war, dass ich die Einstellungsdatei hatteSESSION_ENGINE Wert auf gesetzt'django.contrib.sessions.backends.cache' ohne mit demCACHE_BACKEND richtig konfiguriert.

Ich habe die SESSION_ENGINE in geändert'django.contrib.sessions.backends.db' was das Problem behoben hat.

, "myproject.layer.views.get_tilestache_cfg"), (r'^admin/', include(admin.site.urls)), (r'^sites/', include("myproject.sites.urls")), (r'^

Apache-Version:

Apache/2.2.22 (Ubuntu) mod_wsgi/3.3 Python/2.7.3 configured

Apache apache2 / sites-available / default:

<VirtualHost *:80>
        ServerAdmin ironman@localhost
        DocumentRoot /var/www/bin
        LogLevel warn
        WSGIDaemonProcess lbs processes=2 maximum-requests=500 threads=1
        WSGIProcessGroup lbs
        WSGIScriptAlias / /var/www/bin/apache/django.wsgi
        Alias /static /var/www/lbs/static/
</VirtualHost>
<VirtualHost *:8080>
        ServerAdmin ironman@localhost
        DocumentRoot /var/www/bin
        LogLevel warn
        WSGIDaemonProcess tilestache processes=2 maximum-requests=500 threads=1
        WSGIProcessGroup tilestache
        WSGIScriptAlias / /var/www/bin/tileserver/tilestache.wsgi
</VirtualHost>

AKTUALISIEREN

Die Admin-Seite wird bei Verwendung des Entwicklungsservers über fortgesetztrunserver es scheint also ein wsgi / apache problem zu sein. Ich habe es immer noch nicht herausgefunden.

LÖSUNG

Das Problem war, dass ich die Einstellungsdatei hatteSESSION_ENGINE Wert auf gesetzt'django.contrib.sessions.backends.cache' ohne mit demCACHE_BACKEND richtig konfiguriert.

Ich habe die SESSION_ENGINE in geändert'django.contrib.sessions.backends.db' was das Problem behoben hat.

, "myproject.layer.views.view_map"), ) urlpatterns += staticfiles_urlpatterns()

Apache-Version:

Apache/2.2.22 (Ubuntu) mod_wsgi/3.3 Python/2.7.3 configured

Apache apache2 / sites-available / default:

<VirtualHost *:80>
        ServerAdmin ironman@localhost
        DocumentRoot /var/www/bin
        LogLevel warn
        WSGIDaemonProcess lbs processes=2 maximum-requests=500 threads=1
        WSGIProcessGroup lbs
        WSGIScriptAlias / /var/www/bin/apache/django.wsgi
        Alias /static /var/www/lbs/static/
</VirtualHost>
<VirtualHost *:8080>
        ServerAdmin ironman@localhost
        DocumentRoot /var/www/bin
        LogLevel warn
        WSGIDaemonProcess tilestache processes=2 maximum-requests=500 threads=1
        WSGIProcessGroup tilestache
        WSGIScriptAlias / /var/www/bin/tileserver/tilestache.wsgi
</VirtualHost>

AKTUALISIEREN

Die Admin-Seite wird bei Verwendung des Entwicklungsservers über fortgesetztrunserver es scheint also ein wsgi / apache problem zu sein. Ich habe es immer noch nicht herausgefunden.

LÖSUNG

Das Problem war, dass ich die Einstellungsdatei hatteSESSION_ENGINE Wert auf gesetzt'django.contrib.sessions.backends.cache' ohne mit demCACHE_BACKEND richtig konfiguriert.

Ich habe die SESSION_ENGINE in geändert'django.contrib.sessions.backends.db' was das Problem behoben hat.

Antworten auf die Frage(16)

Ihre Antwort auf die Frage