Skip to content

Instantly share code, notes, and snippets.

@aballah-chamakh
Created July 11, 2019 13:18
Show Gist options
  • Select an option

  • Save aballah-chamakh/560b2b8192aa67a7b0d270dec2279704 to your computer and use it in GitHub Desktop.

Select an option

Save aballah-chamakh/560b2b8192aa67a7b0d270dec2279704 to your computer and use it in GitHub Desktop.
# add the account app and all the dependency
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'account',
'Door',
'corsheaders',
'rest_framework',
]
# set the customized user model
AUTH_USER_MODEL = 'account.User'
# allow you api to be accessible
CORS_ORIGIN_ALLOW_ALL = True
# add the CorsMiddleware
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'corsheaders.middleware.CorsMiddleware', # Here
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment