You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.3 KiB
Python

7 years ago
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from marshmallow import Schema, fields, ValidationError, pre_load
7 years ago
from flask_socketio import SocketIO, emit
from os import environ
from dotenv import load_dotenv, find_dotenv
7 years ago
import os
import click
7 years ago
from werkzeug.utils import secure_filename
7 years ago
from sqlalchemy.dialects import registry
# import flask_whooshalchemyplus not using whoosh anymore
7 years ago
registry.register("rqlite.pyrqlite", "sqlalchemy_rqlite.pyrqlite", "dialect")
7 years ago
basedir = os.path.abspath(os.path.dirname(__file__))
UPLOAD_FOLDER = os.path.join(basedir, 'uploads')
UPLOAD_FOLDER_COVER = os.path.join(basedir, 'cover')
7 years ago
#ALLOWED_EXTENSIONS = set(['txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif'])
7 years ago
load_dotenv(find_dotenv())
7 years ago
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'] = 'rqlite+pyrqlite://localhost:4001/'
7 years ago
app.config['DEBUG'] = True
app.config['PORT'] = 80
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + os.path.join(basedir, 'mydatabase.db')
7 years ago
db = SQLAlchemy(app)
light = not os.path.isdir(UPLOAD_FOLDER)
7 years ago
DOMAIN = environ.get('DOMAIN')
socketio = SocketIO(app)
7 years ago
app.config.from_object(__name__)
from app import views