def create_app(): app = Flask(__name__) # configuring the database app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:////Users/alxander44/Desktop/twitter_app/web_app_4444.db" app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False app.config["SECRET_KEY"] = SECRET_KEY db.init_app(app) migrate.init_app(app,db) #class Book(db.Model): #__table_args__ = {'extend_existing': True} #id = db.Column(db.Integer, primary_key=True) #title = db.Column(db.String(128)) #author_id = db.Column(db.String(128)) # reqistering routes: app.register_blueprint(home_routes) app.register_blueprint(book_routes) app.register_blueprint(twitter_routes) return app
def create_app(): app = Flask(__name__) # already have app.config["SQLALCHEMY_DATABASE_URI"] = DATABASE_URL app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False # for login from flask dance app.config['SECRET_KEY'] = 'thisissupposedtobeasecret' app.config["TWITTER_OAUTH_CLIENT_KEY"] = TWITTER_API_KEY app.config["TWITTER_OAUTH_CLIENT_SECRET"] = TWITTER_API_SECRET twitter_bp = make_twitter_blueprint() app.register_blueprint(twitter_bp, url_prefix="/login") # for databases db.init_app(app) migrate.init_app(app, db) # linking to routes.py page via my_routes variable app.register_blueprint(my_routes) return app
def create_app(): """This function creates a Flask app to interact with Spotify data. Returns: Flask app - returns an object of class Flask from the flask module. This function uses psycopg2 to connect to a postgresql database containing data from Spotify about the auditory properties of their songs. To use, a user must have the appropriate database password and details properly configured within their Flask environment. """ app = Flask(__name__) DB_URL = 'postgresql+psycopg2://{user}:{pw}@{url}/{dbname}'.format( user=db_user, pw=db_pw, url=db_url, dbname=db_name) app.config['SQLALCHEMY_DATABASE_URI'] = DB_URL # silence the deprecation warning app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False db.init_app(app) migrate.init_app(app, db) app.register_blueprint(home_route) app.register_blueprint(data_route) return app
def create_app(): app = Flask(__name__) app.config["SQLALCHEMY_DATABASE_URI"] = DATABASE_URI db.init_app(app) migrate.init_app(app, db) app.register_blueprint(home_routes) app.register_blueprint(book_routes) return app
def create_app(): app = Flask(__name__) app.config["SECRET_KEY"] = SECRET_KEY app.config["SQLALCHEMY_DATABASE_URI"] = DATABASE_URL db.init_app(app) migrate.init_app(app, db) app.register_blueprint(home_routes) app.register_blueprint(twitter_routes) app.register_blueprint(stats_routes) return app
def create_app(): app = Flask(__name__) app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False app.config['SQLALCHEMY_DATABASE_URI'] = DATABASE_URL app.config['TWITTER_API_CLIENT'] = twitter_api_client() db.init_app(app) migrate.init_app(app, db) app.register_blueprint(routes) return app
def create_app(): app = Flask(__name__) app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///web_app_tweets.db" # app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:////Users\\dougcohen\\Repos\\Unit-3\\my-twitoff-13\\web_app\\web_app_tweets.db" db.init_app(app) migrate.init_app(app, db) app.register_blueprint(home_routes) app.register_blueprint(tweet_routes) return app
def create_app(): app = Flask(__name__) app.config["SQLALCHEMY_DATABASE_URI"] = DATABASE_URL app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False db.init_app(app) migrate.init_app(app, db) app.register_blueprint(home_routes) app.register_blueprint(book_routes) app.register_blueprint(twitter_routes) return app
def create_app(): app = Flask(__name__) app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///web_app_12.db" #app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:////Users/mjr/Desktop/web-app-inclass-11/web_app_12.db" db.init_app(app) migrate.init_app(app, db) app.register_blueprint(home_routes) app.register_blueprint(book_routes) return app
def create_app(): app = Flask(__name__) app.config["SQLALCHEMY_DATABASE_URI"] = DATABASE_URL app.config["SQLALCHEMY_DATABASE_TRACKING"] = False db.init_app(app) migrate.init_app(app, db) app.register_blueprint(my_routes) return app
def create_app(): APP = Flask(__name__) APP.config["SECRET_KEY"] = SECRET_KEY APP.config["SQLALCHEMY_DATABASE_URI"] = DATABASE_URL APP.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False DB.init_app(APP) migrate.init_app(APP, DB) APP.register_blueprint(strain_routes) return APP
def create_app(): app = Flask(__name__) #app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///web_app_13.db" app.config[ "SQLALCHEMY_DATABASE_URI"] = "sqlite://///home/tmbern/workspace/repos/lambda/my-web-app-tmbern-ds13/web_app_13.db" db.init_app(app) migrate.init_app(app, db) app.register_blueprint(home_routes) app.register_blueprint(book_routes) return app
def create_app(): # Working base create app app = Flask(__name__) app.config["SECRET_KEY"] = SECRET_KEY app.config["SQLALCHEMY_DATABASE_URI"] = DATABASE_URL app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False db.init_app(app) migrate.init_app(app, db) app.register_blueprint(home_routes) app.register_blueprint(school_routes) app.register_blueprint(vis_routes) return app
def create_app(): app = Flask(__name__) app.config["SECRET_KEY"] = SECRET_KEY # enable flash messaging via sessions app.config["SQLALCHEMY_DATABASE_URI"] = DATABASE_URI app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False db.init_app(app) migrate.init_app(app, db) app.register_blueprint(home_routes) app.register_blueprint(book_routes) return app
def create_app(): app = Flask(__name__) app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///twitoff.db" # app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:////C:\Users\lesle\Desktop\twitoff_13\twitoff-13\twitoff_13.db" db.init_app(app) migrate.init_app(app, db) app.register_blueprint(tweet_routes) app.register_blueprint(home_routes) app.register_blueprint(twitter_routes) return app
def create_app(): app = Flask(__name__) app.config["CUSTOM_VAR"] = 5 # just an example of app config app.config["SQLALCHEMY_DATABASE_URI"] = DATABASE_URL app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False # app.config["TWITTER_API_CLIENT"] = twitter_api_client() db.init_app(app) migrate.init_app(app, db) app.register_blueprint(new_routes) return app
def create_app(): app = Flask(__name__) #app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///web_app_331.db" app.config["SQLALCHEMY_DATABASE_URI"] = DATABASE_URL app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False #app.config["TWITTER_API_CLIENT"] = twitter_api_client() db.init_app(app) migrate.init_app(app, db) app.register_blueprint(new_routes) return app
def create_app(): app = Flask(__name__) # configure the database: app.config["SQLALCHEMY_DATABASE_URI"] = DATABASE_URI app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False # suppress warning messages db.init_app(app) migrate.init_app(app, db) # configure routes: # app.register_blueprint(database_routes) app.register_blueprint(songs_routes) app.register_blueprint(home_routes) return app
def create_app(): app = Flask(__name__) #app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///web_app_11.db" app.config["SQLALCHEMY_DATABASE_URI"] = DATABASE_URL db.init_app(app) migrate.init_app(app, db) app.register_blueprint(stats_routes) app.register_blueprint(admin_routes) app.register_blueprint(twitter_routes) app.register_blueprint(home_routes) app.register_blueprint(book_routes) return app
def create_app(): app = Flask(__name__) # configure our app to use a database # We'll use the relative path option here app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///twitoff_hkang.db" #app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:////Users/mjr/Desktop/web-app-inclass-11/twitoff_hkang.db" # configure app to use migration object (allow app to interface with data) db.init_app(app) migrate.init_app(app, db) app.register_blueprint(home_routes) app.register_blueprint(book_routes) return app
def create_app(): """ Create and configure the instance of the flask app for the routes and database """ app = Flask(__name__) app.config["SQLALCHEMY_DATABASE_URL"] = DATABASE_URL db.init_app(app) migrate.init_app(app, db) app.register_blueprint(home_routes) # app.register_blueprint(twitter_routes) app.register_blueprint(twitter_routes) return app
def create_app(): app = Flask(__name__) # initialize new Flask app #ASSOC OUR DB CONN W/ OUR FLASK APP: app.config["SQLALCHEMY_DATABASE_URI"] = DATABASE_URI db.init_app(app) migrate.init_app(app, db) app.register_blueprint( home_routes) # tells our app (instance) about the routes app.register_blueprint( book_routes ) # REGISTER ONLY 1 ENDPT BC THEY WILL HAVE THE SAME APP ROUTES (jon) return app
def create_app(): app = Flask(__name__) app.config["SECRET_KEY"] = 'super secret key' app.config['SQLALCHEMY_DATABASE_URI'] = f'sqlite:////{DB_LOCATION}' db.init_app(app) migrate.init_app(app, db) app.register_blueprint(home_routes) app.register_blueprint(admin_routes) app.register_blueprint(ml_routes) return app
def create_app(): app = Flask(__name__) # Configures the DataBase app.config["SQLALCHEMY_DATABASE_URI"] = DATABASE_URI # Initializes the DataBase db.init_app(app) # Migrates the app and DataBase migrate.init_app(app, db) # Registering the blueprints for the different app routes app.register_blueprint(home_routes) app.register_blueprint(book_routes) return app
def create_app(): app = Flask(__name__) app.config["SECRET_KEY"] = SECRET_KEY app.register_blueprint(home_routes) app.register_blueprint(strain_routes) app.register_blueprint(recommendation_routes) app.config["SQLALCHEMY_DATABASE_URI"] = DATABASE_URL app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False # suppress warning messages db.init_app(app) migrate.init_app(app, db) return app
def create_app(): app = Flask(__name__) app.config["SQLALCHEMY_DATABASE_URI"] = DATABASE_URL app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False # importing models.py database class tables # links to __init__file which calls on create app to run db.init_app(app) migrate.init_app(app, db) # linking to routes.py page via my_routes variable app.register_blueprint(my_routes) return app
def create_app(): app = Flask(__name__) app.config["SECRET_KEY"] = SECRET_KEY # required for flash messaging # configure the database: app.config["SQLALCHEMY_DATABASE_URI"] = DATABASE_URI app.config[ "SQLALCHEMY_TRACK_MODIFICATIONS"] = False # suppress warning messages db.init_app(app) migrate.init_app(app, db) # configure routes: app.register_blueprint(home_routes) app.register_blueprint(book_routes) return app
def create_app(): app = Flask(__name__) # configure the database: app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///db.sqlite3' app.config[ "SQLALCHEMY_TRACK_MODIFICATIONS"] = False # suppress warning messages db.init_app(app) migrate.init_app(app, db) #1 app.register_blueprint(home_routes.home_routes) return app
def create_app(): app = Flask(__name__) # For use with database app.config["SQLALCHEMY_DATABASE_URI"] = DATABASE_URL db.init_app(app) migrate.init_app(app, db) app.register_blueprint(home_routes) #app.register_blueprint(book_routes) app.register_blueprint(user_routes) app.register_blueprint(tweet_routes) app.register_blueprint(twitter_routes) app.register_blueprint(stats_routes) return app
def create_app(): app = Flask(__name__) app.config["SQLALCHEMY_DATABASE_URI"] = os.getenv("DATABASE_URL") app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False # app.config["SECRET_KEY"] = SECRET_KEY db.init_app(app) migrate.init_app(app, db) app.register_blueprint(home_routes) app.register_blueprint(twitter_routes) app.register_blueprint(admin_routes) app.register_blueprint(stat_routes) return app