Skip to content
This repository has been archived by the owner on Sep 29, 2023. It is now read-only.

Commit

Permalink
- New settings system
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos Sanchez Mateo committed Aug 17, 2017
1 parent 121a024 commit 7451c9c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,6 @@ ENV/

# mypy
.mypy_cache/

#vscode
.vscode/
4 changes: 1 addition & 3 deletions redirector.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
"""
Redirector
"""
import os

from flask import Flask, request, redirect
from settings import PORT

APP = Flask(__name__)

Expand All @@ -20,5 +19,4 @@ def redirect_to_box():
return redirect(new_url)

if __name__ == '__main__':
PORT = int(os.environ.get('PORT', 5000))
APP.run(host='0.0.0.0', port=PORT, debug=True)
Binary file modified requirements.txt
Binary file not shown.
11 changes: 11 additions & 0 deletions settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# settings.py
from os import environ
from dotenv import load_dotenv, find_dotenv

load_dotenv(find_dotenv())

DOWNLOAD_PATH = environ.get('DOWNLOAD_PATH')
REPORT_SERVER = environ.get('REPORT_SERVER')
REPORT_USERNAME = environ.get('REPORT_USERNAME')
REPORT_PASSWORD = environ.get('REPORT_PASSWORD')
PORT = int(environ.get('PORT'))

0 comments on commit 7451c9c

Please sign in to comment.