Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

debug cors #881

Merged
merged 6 commits into from
Oct 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/workflows/code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ on:
branches:
- master
- dev
- debug-*
paths:
- "apps/**"
- "configs/**"
- "templates/**"
pull_request:
branches:
- master
- dev
- debug-*
paths:
- "apps/**"
- "configs/**"
Expand All @@ -14,6 +24,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master

- name: build code image
uses: elgohr/Publish-Docker-Github-Action@master
with:
Expand All @@ -22,8 +33,10 @@ jobs:
password: ${{ secrets.DOCKER_PASSWORD }}
tags: "latest,code"
dockerfile: deploy/Dockerfile.CODE

- name: build debug code image
uses: elgohr/Publish-Docker-Github-Action@master
if: startsWith(github.ref, 'refs/heads/debug-')
with:
name: ehco1996/django-sspanel
username: ${{ secrets.DOCKER_USERNAME }}
Expand Down
1 change: 0 additions & 1 deletion configs/default/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"apps.openapi",
]

CORS_ALLOW_ALL_ORIGINS = True

MIDDLEWARE = [
"django_prometheus.middleware.PrometheusBeforeMiddleware",
Expand Down
2 changes: 2 additions & 0 deletions configs/default/sites.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

# 网站域名设置(请正确填写,不然订阅功能会失效:
HOST = os.getenv("HOST", "http://127.0.0.1:8000")
CORS_ALLOW_ALL_ORIGINS = True
CSRF_TRUSTED_ORIGINS = [HOST]

# 网站密钥
SECRET_KEY = os.getenv("SECRET_KEY", "aasdasdas")
Expand Down
2 changes: 0 additions & 2 deletions configs/development.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import os

from configs.default import * # noqa

# NOTE for django debug toolbar
Expand Down