File tree Expand file tree Collapse file tree 4 files changed +14
-1
lines changed Expand file tree Collapse file tree 4 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 11import redis
2- from config import Config
32from flask import Flask
43from app .utils import make_celery
4+ from config import Config
5+ from flask_sqlalchemy import SQLAlchemy
6+ from flask_migrate import Migrate
57
68
79app = Flask (__name__ , static_url_path = '/static' )
810app .config .from_object (Config )
11+ db = SQLAlchemy (app )
12+ migrate = Migrate (app , db )
913
1014# connect to Redis instance
1115redis_db = redis .StrictRedis (host = app .config ['REDIS_SERVER' ],
Original file line number Diff line number Diff line change 33{% block content %}
44< div class ="col-md-9 ">
55 < h1 > Repositories</ h1 >
6+ {% if not repositories %}
7+ None found. < a href ="# "> Add your first one now</ a > .
8+ {% endif %}
69</ div >
710{% endblock content %}
Original file line number Diff line number Diff line change 11import os
2+ base_dir = os .path .abspath (os .path .dirname (__file__ ))
23
34
45class Config (object ):
@@ -13,3 +14,8 @@ class Config(object):
1314 # Celery task queue
1415 CELERY_BROKER_URL = os .getenv ('CELERY_BROKER_URL' ) or REDIS_URL
1516 CELERY_RESULT_BACKEND = os .getenv ('CELERY_RESULT_BACKEND' ) or REDIS_URL
17+
18+ # database settings
19+ SQLALCHEMY_DATABASE_URI = os .getenv ('DATABASE_URL' ) or \
20+ 'sqlite:///' + os .path .join (basedir , 'flaskdash.db' )
21+ SQLALCHEMY_TRACK_MODIFICATIONS = False
You can’t perform that action at this time.
0 commit comments