mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-02-26 16:30:39 +03:00
Merge pull request #2683 from aadithpm/master
This commit is contained in:
commit
8d5542d675
|
@ -44,6 +44,7 @@ Listed in alphabetical order.
|
|||
18 `@dezoito`_
|
||||
2O4 `@2O4`_
|
||||
a7p `@a7p`_
|
||||
Aadith PM `@aadithpm`_
|
||||
Aaron Eikenberry `@aeikenberry`_
|
||||
Adam Bogdał `@bogdal`_
|
||||
Adam Dobrawy `@ad-m`_
|
||||
|
@ -235,6 +236,7 @@ Listed in alphabetical order.
|
|||
Yuchen Xie `@mapx`_
|
||||
========================== ============================ ==============
|
||||
|
||||
.. _@aadithpm: https://github.com/aadithpm
|
||||
.. _@a7p: https://github.com/a7p
|
||||
.. _@2O4: https://github.com/2O4
|
||||
.. _@ad-m: https://github.com/ad-m
|
||||
|
|
|
@ -80,6 +80,7 @@ THIRD_PARTY_APPS = [
|
|||
{%- if cookiecutter.use_drf == "y" %}
|
||||
"rest_framework",
|
||||
"rest_framework.authtoken",
|
||||
"corsheaders",
|
||||
{%- endif %}
|
||||
]
|
||||
|
||||
|
@ -134,6 +135,9 @@ AUTH_PASSWORD_VALIDATORS = [
|
|||
# https://docs.djangoproject.com/en/dev/ref/settings/#middleware
|
||||
MIDDLEWARE = [
|
||||
"django.middleware.security.SecurityMiddleware",
|
||||
{%- if cookiecutter.use_drf == 'y' %}
|
||||
"corsheaders.middleware.CorsMiddleware",
|
||||
{%- endif %}
|
||||
{%- if cookiecutter.use_whitenoise == 'y' %}
|
||||
"whitenoise.middleware.WhiteNoiseMiddleware",
|
||||
{%- endif %}
|
||||
|
@ -321,6 +325,10 @@ REST_FRAMEWORK = {
|
|||
),
|
||||
"DEFAULT_PERMISSION_CLASSES": ("rest_framework.permissions.IsAuthenticated",),
|
||||
}
|
||||
|
||||
# django-cors-headers - https://github.com/adamchainz/django-cors-headers#setup
|
||||
CORS_URLS_REGEX = r"^/api/.*$"
|
||||
|
||||
{%- endif %}
|
||||
# Your stuff...
|
||||
# ------------------------------------------------------------------------------
|
||||
|
|
|
@ -41,4 +41,6 @@ django-redis==4.12.1 # https://github.com/jazzband/django-redis
|
|||
{%- if cookiecutter.use_drf == "y" %}
|
||||
# Django REST Framework
|
||||
djangorestframework==3.11.0 # https://github.com/encode/django-rest-framework
|
||||
# Django CORS Headers
|
||||
django-cors-headers==0.01 # https://github.com/adamchainz/django-cors-headers
|
||||
{%- endif %}
|
||||
|
|
Loading…
Reference in New Issue
Block a user