Skip to content

Commit

Permalink
cors
Browse files Browse the repository at this point in the history
  • Loading branch information
BrittleFoot committed Feb 18, 2024
1 parent 82d2d57 commit e233275
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 9 deletions.
2 changes: 2 additions & 0 deletions dev-requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ pytest
pytest-cov
pytest-django
mixer

ipython
42 changes: 38 additions & 4 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,66 @@
#
# pip-compile dev-requirements.in
#
asttokens==2.4.1
# via stack-data
coverage[toml]==7.4.1
# via
# coverage
# pytest-cov
decorator==5.1.1
# via ipython
executing==2.0.1
# via stack-data
faker==12.0.1
# via mixer
iniconfig==2.0.0
# via pytest
ipython==8.21.0
# via -r dev-requirements.in
jedi==0.19.1
# via ipython
matplotlib-inline==0.1.6
# via ipython
mixer==7.2.2
# via -r dev-requirements.in
packaging==23.2
# via pytest
parso==0.8.3
# via jedi
pexpect==4.9.0
# via ipython
pluggy==1.4.0
# via pytest
pytest==7.4.4
prompt-toolkit==3.0.43
# via ipython
ptyprocess==0.7.0
# via pexpect
pure-eval==0.2.2
# via stack-data
pygments==2.17.2
# via ipython
pytest==8.0.0
# via
# -r dev-requirements.in
# pytest-cov
# pytest-django
pytest-cov==4.1.0
# via -r dev-requirements.in
pytest-django==4.7.0
pytest-django==4.8.0
# via -r dev-requirements.in
python-dateutil==2.8.2
# via faker
ruff==0.1.14
ruff==0.2.1
# via -r dev-requirements.in
six==1.16.0
# via python-dateutil
# via
# asttokens
# python-dateutil
stack-data==0.6.3
# via ipython
traitlets==5.14.1
# via
# ipython
# matplotlib-inline
wcwidth==0.2.13
# via prompt-toolkit
4 changes: 3 additions & 1 deletion requirements.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
Django==5
Django<=6
djangorestframework
django-environ
django-behaviors
django-cors-headers

psycopg2-binary
uritemplate
pyyaml
Expand Down
11 changes: 8 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,25 @@
# pip-compile requirements.in
#
asgiref==3.7.2
# via django
django==5.0
# via
# django
# django-cors-headers
django==5.0.2
# via
# -r requirements.in
# django-cors-headers
# djangorestframework
django-behaviors==0.5.1
# via -r requirements.in
django-cors-headers==4.3.1
# via -r requirements.in
django-environ==0.11.2
# via -r requirements.in
djangorestframework==3.14.0
# via -r requirements.in
psycopg2-binary==2.9.9
# via -r requirements.in
pytz==2023.3.post1
pytz==2024.1
# via djangorestframework
pyyaml==6.0.1
# via -r requirements.in
Expand Down
6 changes: 5 additions & 1 deletion src/app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = "django-insecure-3x-ab4%uwykswbk9g75q@@iyob(2bg*dpwl!n8p*g&f+p33p-r"

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = env("DEBUG")

ALLOWED_HOSTS = ["*"]

if DEBUG or env("CORS_ALLOW_ALL_ORIGINS"):
CORS_ALLOW_ALL_ORIGINS = True


# Application definition

Expand All @@ -39,11 +41,13 @@
"behaviors.apps.BehaviorsConfig",
"rest_framework",
"whitenoise",
"corsheaders",
]

INSTALLED_APPS = INTERNAL_APPS + THIRD_PARTY_APPS

MIDDLEWARE = [
"corsheaders.middleware.CorsMiddleware",
"django.middleware.security.SecurityMiddleware",
# The WhiteNoise middleware should be placed directly
# after the Django SecurityMiddleware (if you are using it)
Expand Down

0 comments on commit e233275

Please sign in to comment.