Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- INSTALLED_APPS = [
- 'django.contrib.admin',
- 'django.contrib.auth',
- 'django.contrib.contenttypes',
- 'django.contrib.sessions',
- 'django.contrib.messages',
- 'django.contrib.staticfiles',
- # packages:
- 'rest_framework',
- 'rest_framework.authtoken',
- 'corsheaders',
- # user apps:
- 'users',
- 'api',
- 'products',
- ]
- MIDDLEWARE = [
- 'django.middleware.security.SecurityMiddleware',
- 'django.contrib.sessions.middleware.SessionMiddleware',
- 'corsheaders.middleware.CorsMiddleware',
- 'django.middleware.common.CommonMiddleware',
- 'django.middleware.csrf.CsrfViewMiddleware',
- 'django.contrib.auth.middleware.AuthenticationMiddleware',
- 'django.contrib.messages.middleware.MessageMiddleware',
- 'django.middleware.clickjacking.XFrameOptionsMiddleware',
- ]
- # CORS SETTINGS
- CORS_ALLOW_CREDENTIALS = True
- CORS_ORIGIN_REGEX_WHITELIST = [
- 'http://192.168.1.14:8080/',
- 'http://localhost:8080/',
- ]
- CORS_URLS_REGEX = r'^/*$'
- CORS_ALLOW_METHODS = (
- 'DELETE',
- 'GET',
- 'OPTIONS',
- 'PATCH',
- 'POST',
- 'PUT',
- )
- CORS_ALLOW_HEADERS = (
- 'accept',
- 'accept-encoding',
- 'authorization',
- 'content-type',
- 'dnt',
- 'origin',
- 'user-agent',
- 'x-csrftoken',
- 'x-requested-with',
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement