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

change requirements.txt #5

Open
duicleme opened this issue Oct 13, 2023 · 0 comments
Open

change requirements.txt #5

duicleme opened this issue Oct 13, 2023 · 0 comments

Comments

@duicleme
Copy link

duicleme commented Oct 13, 2023

<< requirements.txt >>

=============================================
bcrypt==4.0.1
blinker==1.6.2
click==8.1.7
dnspython==2.4.2
email-validator==2.0.0.post2
Flask==2.3.0
Flask-Bcrypt==1.0.1
Flask-Login==0.6.2
Flask-SQLAlchemy==3.1.1
Flask-WTF==1.2.1
greenlet==2.0.2
idna==3.4
itsdangerous==2.1.2
Jinja2==3.1.2
MarkupSafe==2.1.3
SQLAlchemy==2.0.21
typing_extensions==4.8.0
Werkzeug==2.3.0
WTForms==3.0.1
celery
redis
stravalib

and some change .

<< monolith-master/monolith/app.py >>

import os
from flask import Flask
from monolith.database import db, User
from monolith.views import blueprints
from monolith.auth import login_manager

def create_app():
app = Flask(name)
app.config['WTF_CSRF_SECRET_KEY'] = 'A SECRET KEY'
app.config['SECRET_KEY'] = 'ANOTHER ONE'
app.config['STRAVA_CLIENT_ID'] = os.environ['STRAVA_CLIENT_ID']
app.config['STRAVA_CLIENT_SECRET'] = os.environ['STRAVA_CLIENT_SECRET']
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////tmp/runnerly'

for bp in blueprints:
    app.register_blueprint(bp)
    bp.app = app

db.init_app(app)
login_manager.init_app(app)

with app.app_context():
    db.create_all()

    q = db.session.query(User).filter(User.email == 'tarek@ziade.org')
    user = q.first()
    if user is None:
        tarek = User()
        tarek.email = 'tarek@ziade.org'
        tarek.is_admin = True
        tarek.set_password('ok')
        db.session.add(tarek)
        db.session.commit()
return app

if name == 'main':
app = create_app()
app.run()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant