2018-05-20 00:10:01 +02:00
|
|
|
from flask import Flask
|
|
|
|
from flask_sqlalchemy import SQLAlchemy
|
|
|
|
from marshmallow import Schema, fields, ValidationError, pre_load
|
|
|
|
import os
|
|
|
|
from werkzeug.utils import secure_filename
|
|
|
|
|
|
|
|
basedir = os.path.abspath(os.path.dirname(__file__))
|
|
|
|
|
|
|
|
UPLOAD_FOLDER = os.path.join(basedir, 'uploads')
|
2018-05-23 14:12:24 +02:00
|
|
|
UPLOAD_FOLDER_COVER = os.path.join(basedir, 'uploads/cover')
|
2018-05-20 00:10:01 +02:00
|
|
|
ALLOWED_EXTENSIONS = set(['txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif'])
|
|
|
|
|
|
|
|
app = Flask(__name__)
|
|
|
|
|
|
|
|
app.config['SECRET_KEY'] = 'super secret key'
|
|
|
|
#app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////tmp/mydatabase.db'
|
|
|
|
app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
|
|
|
|
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + os.path.join(basedir, 'mydatabase.db')
|
|
|
|
db = SQLAlchemy(app)
|
|
|
|
|
|
|
|
app.config.from_object(__name__)
|
|
|
|
from app import views
|