from flask import Flask
from sqlalchemy import create_engine
from flask_cors import CORS


# Initialize the App
app = Flask(__name__)

# Remove sorted objects
app.config['JSON_SORT_KEYS'] = False

# CORS Support
app.config['CORS_HEADERS'] = 'Content-Type'
cors = CORS(app)

# Connects to DB
db = create_engine('sqlite:///database/voting-server.db')

# Initialize Voters table
with open('database/voters.sql', mode = 'r') as schema, db.begin() as conn:
    conn.execute(schema.read())

# Initialize Tokens table
with open('database/tokens.sql', mode='r') as schema, db.begin() as conn:
    conn.execute(schema.read())

with open('certs/secret.jwt', mode='r') as secret:
    secretContext = secret.read()

# noinspection PyUnresolvedReferences
from app import errors
from app import views

@@ -17,16 +17,44 @@
 t Flask%0A
+from flask_cors import CORS%0A
 from sql
@@ -86,36 +86,8 @@
 ine%0A
-from flask_cors import CORS%0A
 %0A%0A# 
@@ -101,17 +101,17 @@
 ize the 
-A
+a
 pp%0Aapp =
@@ -197,17 +197,17 @@
 %0A# CORS 
-S
+s
 upport%0Aa
@@ -267,16 +267,17 @@
 S(app)%0A%0A
+%0A
 # Connec
@@ -281,15 +281,20 @@
 nect
-s
  to 
-DB
+database
 %0Adb 
@@ -355,20 +355,15 @@
 %0A%0A# 
-Initialize V
+Setup v
 oter
@@ -485,20 +485,15 @@
 %0A%0A# 
-Initialize T
+Setup t
 oken
@@ -533,25 +533,27 @@
 s.sql', mode
-=
+ = 
 'r') as sche
@@ -609,16 +609,36 @@
 ead())%0A%0A
+%0A# Fetch JWT secret%0A
 with ope
@@ -663,17 +663,19 @@
 t', mode
-=
+ = 
 'r') as 
@@ -690,21 +690,18 @@
     
+jwt_
 secret
-Context
  = s
@@ -714,16 +714,17 @@
 read()%0A%0A
+%0A
 # noinsp
@@ -776,16 +776,54 @@
  errors%0A
+# noinspection PyUnresolvedReferences%0A
 from app

Optimize imports