Example #1
0
from flask import Flask
from flaskext.sqlalchemy import SQLAlchemy

from settings import local
import locale

locale.setlocale(locale.LC_ALL, 'de_DE.utf8')

app = Flask("app_name")
db_url = '%s://%s:%s@%s/%s' % (
        local.ENGINE, 
        local.USERNAME, 
        local.PASSWORD, 
        local.HOST, 
        local.DATABASE
        )
app.secret_key = '7104f3435f6dae99bb2ec4cdd903a90d'
app.config['SQLALCHEMY_DATABASE_URI'] = db_url
app.config['CSRF_ENABLED'] = False
db = SQLAlchemy(app)


from views import *
Example #2
0
from wtforms import RadioField, IntegerField, TextAreaField, SelectField
from wtforms.fields.html5 import DateField, DateTimeField
from wtforms.validators import Required, IPAddress
from wtforms.validators import ValidationError, Optional
import json
import re
from flask import jsonify
from acitoolkit.acitoolkit import Credentials
import difflib

# Create application
app = Flask(__name__, static_folder='static')

# Cross site replay security
app.config['SECRET_KEY'] = 'Dnit7qz7mfcP0YuelDrF8vLFvk0snhwP'
app.config['CSRF_ENABLED'] = True
csrf = CsrfProtect(app)

bootstrap = Bootstrap(app)

# Create in-memory database
app.config['DATABASE_FILE'] = 'snapshots.sqlite'
app.config['SQLALCHEMY_DATABASE_URI'] = ('sqlite:///' +
                                         app.config['DATABASE_FILE'])
app.config['SQLALCHEMY_ECHO'] = True
db = SQLAlchemy(app)

# Create the ACI Config Database
cdb = ConfigDB()
versions = cdb.get_versions()