Skip to content

Commit

Permalink
update config to heroku
Browse files Browse the repository at this point in the history
  • Loading branch information
StevenHHB committed Sep 5, 2023
1 parent c5ea444 commit d84a808
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 12 deletions.
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: gunicorn app:app
5 changes: 0 additions & 5 deletions app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,9 @@
from flask_login import LoginManager
from flask_migrate import Migrate

# Assuming 'app' and 'db' are your Flask and SQLAlchemy instances respectively


db = SQLAlchemy()
login_manager = LoginManager()


def create_app():
app = Flask(__name__)
app.config.from_object('config')
Expand All @@ -20,6 +16,5 @@ def create_app():

with app.app_context():
from . import routes, models # Import routes after the app is created
db.create_all() # Optionally, create all tables here

return app
9 changes: 2 additions & 7 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@

BASE_DIR = os.path.abspath(os.path.dirname(__file__))

SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(BASE_DIR, 'app.db')
SECRET_KEY = secrets.token_hex(16)
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL')
SQLALCHEMY_TRACK_MODIFICATIONS = False

# generate a secret key with secret package

secret_key = secrets.token_hex(16)

SECRET_KEY = '1234567891234567'
35 changes: 35 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
alembic==1.12.0
APScheduler==3.10.4
blinker==1.6.2
boto3==1.28.39
botocore==1.31.39
click==8.1.7
cockroachdb==0.3.5
Flask==2.3.3
Flask-Login==0.6.2
Flask-Migrate==4.0.4
Flask-SQLAlchemy==3.0.5
greenlet==2.0.2
gunicorn==21.2.0
iniconfig==2.0.0
itsdangerous==2.1.2
Jinja2==3.1.2
jmespath==1.0.1
Mako==1.2.4
MarkupSafe==2.1.3
packaging==23.1
pluggy==1.3.0
psycopg2-binary==2.9.7
pycryptodome==3.18.0
pytest==7.4.0
python-dateutil==2.8.2
pytz==2023.3
s3transfer==0.6.2
secret==0.8
six==1.16.0
SQLAlchemy==2.0.20
tabulate==0.9.0
typing_extensions==4.7.1
tzlocal==5.0.1
urllib3==1.26.16
Werkzeug==2.3.7

0 comments on commit d84a808

Please sign in to comment.