mirror of
https://github.com/ComputerScienceHouse/proxstar.git
synced 2025-02-14 22:11:51 +00:00
Use config.py for rqsettings
Move `config.local.py` to `config_local.py`, since `.` is invalid in filenames for imports
This commit is contained in:
parent
c80b240497
commit
b95e446857
3 changed files with 10 additions and 4 deletions
|
@ -18,6 +18,7 @@ It is available to house members at [proxstar.csh.rit.edu](https://proxstar.csh.
|
||||||
1. [Fork](https://help.github.com/en/articles/fork-a-repo) this repository
|
1. [Fork](https://help.github.com/en/articles/fork-a-repo) this repository
|
||||||
- Optionally create a new [git branch](https://git-scm.com/book/en/v2/Git-Branching-Branches-in-a-Nutshell) if your change is more than a small tweak (`git checkout -b BRANCH-NAME-HERE`)
|
- Optionally create a new [git branch](https://git-scm.com/book/en/v2/Git-Branching-Branches-in-a-Nutshell) if your change is more than a small tweak (`git checkout -b BRANCH-NAME-HERE`)
|
||||||
3. Make your changes locally, commit, and push to your fork
|
3. Make your changes locally, commit, and push to your fork
|
||||||
|
- If you want to test locally, you should copy `config.py` to `config_local.py`, and talk to an RTP about filling in secrets.
|
||||||
4. Create a [Pull Request](https://help.github.com/en/articles/about-pull-requests) on this repo for our Webmasters to review
|
4. Create a [Pull Request](https://help.github.com/en/articles/about-pull-requests) on this repo for our Webmasters to review
|
||||||
|
|
||||||
## Questions/Concerns
|
## Questions/Concerns
|
||||||
|
|
|
@ -35,9 +35,9 @@ app = Flask(__name__)
|
||||||
app.config.from_object(rq_dashboard.default_settings)
|
app.config.from_object(rq_dashboard.default_settings)
|
||||||
if os.path.exists(
|
if os.path.exists(
|
||||||
os.path.join(
|
os.path.join(
|
||||||
app.config.get('ROOT_DIR', os.getcwd()), 'config.local.py')):
|
app.config.get('ROOT_DIR', os.getcwd()), 'config_local.py')):
|
||||||
config = os.path.join(
|
config = os.path.join(
|
||||||
app.config.get('ROOT_DIR', os.getcwd()), 'config.local.py')
|
app.config.get('ROOT_DIR', os.getcwd()), 'config_local.py')
|
||||||
else:
|
else:
|
||||||
config = os.path.join(app.config.get('ROOT_DIR', os.getcwd()), 'config.py')
|
config = os.path.join(app.config.get('ROOT_DIR', os.getcwd()), 'config.py')
|
||||||
app.config.from_pyfile(config)
|
app.config.from_pyfile(config)
|
||||||
|
|
|
@ -3,7 +3,12 @@ import os
|
||||||
import sentry_sdk
|
import sentry_sdk
|
||||||
from sentry_sdk.integrations.rq import RqIntegration
|
from sentry_sdk.integrations.rq import RqIntegration
|
||||||
|
|
||||||
|
if os.path.exists('config_local.py'):
|
||||||
|
import config_local as config
|
||||||
|
else:
|
||||||
|
import config
|
||||||
|
|
||||||
sentry_sdk.init(
|
sentry_sdk.init(
|
||||||
os.environ.get('PROXSTAR_SENTRY_DSN'),
|
config.SENTRY_DSN,
|
||||||
integrations=[RqIntegration()]
|
integrations=[RqIntegration()]
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue