'corsheaders',
Add middlewares: 'corsheaders.middleware.CorsMiddleware', 'django.middleware.common.CommonMiddleware', Add at last CORS_ORIGIN_ALLOW_ALL = True
Add allowed hosts ALLOWED_HOSTS = ['*']
Add settings.py under App_settings
'rest_framework',
'rest_framework.authtoken', //for custom signup
Copy this at bottom:
REST_FRAMEWORK = {
# Use Django's standard `django.contrib.auth` permissions,
# or allow read-only access for unauthenticated users.
'DEFAULT_AUTHENTICATION_CLASSES': [
'rest_framework.authentication.BasicAuthentication',
'rest_framework.authentication.SessionAuthentication',
'rest_framework.authentication.TokenAuthentication',
],
'DEFAULT_PERMISSION_CLASSES': [
'rest_framework.permissions.DjangoModelPermissionsOrAnonReadOnly'
]
}
in settings.py file add corsheaders under APPS add corsmiddlewares and this CORS_ORIGIN_WHITELIST ='https://localhost:3000',
signup: rk@gmail.com 1234