-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathhackhub.py
More file actions
41 lines (30 loc) · 767 Bytes
/
hackhub.py
File metadata and controls
41 lines (30 loc) · 767 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
from settings import *
import sqlite3
# Data storage helpers
def get_db():
database = SQLITE_DB
db = sqlite3.connect(database)
db.row_factory = sqlite3.Row
return db
def init_db():
with open("schema.sql") as f:
db = get_db()
cur = db.cursor()
cur.executescript(f.read())
# Web API
from flask import Flask
app = Flask(__name__)
app.secret_key = SECRET_KEY
app.debug = True
from api_member import *
from api_status import *
from api_membership import *
from api_irc import *
from api_sms import *
from web import *
from admin import *
from filters import *
app.jinja_env.filters['ts2readable'] = ts2readable
app.jinja_env.filters['nl2br'] = nl2br
if __name__ == "__main__":
app.run(host="0.0.0.0")