Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

django-cors-headers

$ pipenv install django-cors-headers
# or
$ pip install django-cors-headers
Comment

cors header django

Install from pip:

python -m pip install django-cors-headers

and then add it to your installed apps:

INSTALLED_APPS = [
    ...,
    "corsheaders",
    ...,
]

You will also need to add a middleware class to listen in on responses:

MIDDLEWARE = [
    ...,
    "corsheaders.middleware.CorsMiddleware",
    "django.middleware.common.CommonMiddleware",
    ...,
]
Comment

django-cors-headers

MIDDLEWARE = [
    ...
    'corsheaders.middleware.CorsMiddleware',
    'django.middleware.common.CommonMiddleware',
    ...
]
Comment

django-cors-headers

python -m pip install django-cors-headers
Comment

django-cors-headers

CORS_ALLOWED_ORIGINS = [
    "https://example.com",
    "https://sub.example.com",
    "http://localhost:8080",
    "http://127.0.0.1:9000"
]
Comment

how to install django-cors-headers

INSTALLED_APPS = [
    ...,
    "corsheaders",
    ...,
]
Comment

django-cors-headers

INSTALLED_APPS = [
    ...
    'corsheaders',
    ...
]
Comment

django-cors-header not working

include origin header in your request
headers:{
'Content-Type':'application/json',
'origin':'*',
}
Comment

PREVIOUS NEXT
Code Example
Shell :: how to install react on mac 
Shell :: can i go back to bash from zsh mac 
Shell :: upgrade tensorflow version 
Shell :: ubuntu stop php 
Shell :: nginx post size 
Shell :: install prisma 
Shell :: unity logcat 
Shell :: install scapy 
Shell :: git fetch all remote branch 
Shell :: tqdm install 
Shell :: how to commit code to bitbucket first time 
Shell :: certbot remove certificate nginx 
Shell :: Brave on Fedora 28+, CentOS/RHEL 8+ 
Shell :: yii2 advanced install 
Shell :: stop process running on port 
Shell :: How to export a GPG public key to a file 
Shell :: m1 cocoapods 
Shell :: ubuntu virtualbox 1920x1080 
Shell :: enable epel repo centos 7 
Shell :: zsh suggestion from history 
Shell :: Key path "file:///home/user/projectname/storage/oauth-public.key" does not exist or is not readable 
Shell :: install heroku cli windows 
Shell :: download gimp ubuntu 
Shell :: bash zip command not found 
Shell :: command not found: neovim 
Shell :: install pygame on mac 
Shell :: pip install hashlib 
Shell :: ubuntu 21.04 mingw download 
Shell :: amplify cli delete app command 
Shell :: ubuntu control brightness 
ADD CONTENT
Topic
Content
Source link
Name
7+1 =