Advertisement
Guest User

Untitled

a guest
May 19th, 2020
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. INSTALLED_APPS = [
  2. 'django.contrib.admin',
  3. 'django.contrib.auth',
  4. 'django.contrib.contenttypes',
  5. 'django.contrib.sessions',
  6. 'django.contrib.messages',
  7. 'django.contrib.staticfiles',
  8.  
  9. # packages:
  10. 'rest_framework',
  11. 'rest_framework.authtoken',
  12. 'corsheaders',
  13.  
  14. # user apps:
  15. 'users',
  16. 'api',
  17. 'products',
  18. ]
  19.  
  20. MIDDLEWARE = [
  21. 'django.middleware.security.SecurityMiddleware',
  22. 'django.contrib.sessions.middleware.SessionMiddleware',
  23. 'corsheaders.middleware.CorsMiddleware',
  24. 'django.middleware.common.CommonMiddleware',
  25. 'django.middleware.csrf.CsrfViewMiddleware',
  26. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  27. 'django.contrib.messages.middleware.MessageMiddleware',
  28. 'django.middleware.clickjacking.XFrameOptionsMiddleware',
  29. ]
  30.  
  31. # CORS SETTINGS
  32. CORS_ALLOW_CREDENTIALS = True
  33. CORS_ORIGIN_REGEX_WHITELIST = [
  34. 'http://192.168.1.14:8080/',
  35. 'http://localhost:8080/',
  36. ]
  37. CORS_URLS_REGEX = r'^/*$'
  38. CORS_ALLOW_METHODS = (
  39. 'DELETE',
  40. 'GET',
  41. 'OPTIONS',
  42. 'PATCH',
  43. 'POST',
  44. 'PUT',
  45. )
  46. CORS_ALLOW_HEADERS = (
  47. 'accept',
  48. 'accept-encoding',
  49. 'authorization',
  50. 'content-type',
  51. 'dnt',
  52. 'origin',
  53. 'user-agent',
  54. 'x-csrftoken',
  55. 'x-requested-with',
  56. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement