mirror of
https://github.com/ComputerScienceHouse/proxstar.git
synced 2025-02-12 13:01: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,8 +18,9 @@ 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
|
||||
- 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
|
||||
- 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
|
||||
|
||||
## Questions/Concerns
|
||||
|
||||
Please file an [Issue](https://github.com/ComputerScienceHouse/proxstar/issues/new) on this repository.
|
||||
Please file an [Issue](https://github.com/ComputerScienceHouse/proxstar/issues/new) on this repository.
|
||||
|
|
|
@ -35,9 +35,9 @@ app = Flask(__name__)
|
|||
app.config.from_object(rq_dashboard.default_settings)
|
||||
if os.path.exists(
|
||||
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(
|
||||
app.config.get('ROOT_DIR', os.getcwd()), 'config.local.py')
|
||||
app.config.get('ROOT_DIR', os.getcwd()), 'config_local.py')
|
||||
else:
|
||||
config = os.path.join(app.config.get('ROOT_DIR', os.getcwd()), 'config.py')
|
||||
app.config.from_pyfile(config)
|
||||
|
|
|
@ -3,7 +3,12 @@ import os
|
|||
import sentry_sdk
|
||||
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(
|
||||
os.environ.get('PROXSTAR_SENTRY_DSN'),
|
||||
config.SENTRY_DSN,
|
||||
integrations=[RqIntegration()]
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue