Hallo ich benutze Django Rest-Auth und ich habe dieses Problem in/Passwort/ändern/es immer zurück csrf Token fehlt oder falsches Problem: Ich mache die Anfrage für einen Android app ich entwickle meine Einstellungen sind:django Rest Framework csrf Token fehlt oder inkorrekt
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.sites',
'rest_framework',
'rest_framework.authtoken',
'rest_auth',
'rest_auth.registration',
'allauth',
'allauth.account',
'allauth.socialaccount',
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
REST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES': (
'rest_framework.authentication.SessionAuthentication',
'rest_framework.authentication.TokenAuthentication',
)
}
Versionen: django-rest-auth == 0.9.1
djangorestframework == 3.6.2
Erklären Sie, wie Sie die Anforderung, über ein Formular durchführen? Sie müssen das Token in das Formular einfügen. – Todor
@Todor Ich habe die Frage bearbeitet, die Anfrage von Android-App gemacht –
Werfen Sie einen Blick auf diese Frage: http: // Stackoverflow.com/questions/27997483/which-authentication-zu-verwendet-wenn-django-rest-framework-und-ios-app verwenden – Todor