annot-server/webapp/__init__.py
author ymh <ymh.work@gmail.com>
Tue, 14 Oct 2014 08:12:54 +0200
changeset 23 16a1925df2df
parent 22 986ee928a866
child 24 eb1f7b06001f
permissions -rw-r--r--
add status to annotation creation. Improve error management for annotation creation
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
22
986ee928a866 add sqlalchemy model + put create module for webapp
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
#
986ee928a866 add sqlalchemy model + put create module for webapp
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
# See LICENCE for detail
986ee928a866 add sqlalchemy model + put create module for webapp
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
# Copyright (c) 2014 IRI
986ee928a866 add sqlalchemy model + put create module for webapp
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
#
986ee928a866 add sqlalchemy model + put create module for webapp
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
986ee928a866 add sqlalchemy model + put create module for webapp
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
import uuid
986ee928a866 add sqlalchemy model + put create module for webapp
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
import json
986ee928a866 add sqlalchemy model + put create module for webapp
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
986ee928a866 add sqlalchemy model + put create module for webapp
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
from flask import Flask
986ee928a866 add sqlalchemy model + put create module for webapp
ymh <ymh.work@gmail.com>
parents:
diff changeset
    10
986ee928a866 add sqlalchemy model + put create module for webapp
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
import config
986ee928a866 add sqlalchemy model + put create module for webapp
ymh <ymh.work@gmail.com>
parents:
diff changeset
    12
import database
986ee928a866 add sqlalchemy model + put create module for webapp
ymh <ymh.work@gmail.com>
parents:
diff changeset
    13
986ee928a866 add sqlalchemy model + put create module for webapp
ymh <ymh.work@gmail.com>
parents:
diff changeset
    14
app = Flask(__name__)
986ee928a866 add sqlalchemy model + put create module for webapp
ymh <ymh.work@gmail.com>
parents:
diff changeset
    15
app.secret_key = str(uuid.uuid4())
986ee928a866 add sqlalchemy model + put create module for webapp
ymh <ymh.work@gmail.com>
parents:
diff changeset
    16
app.debug = config.DEBUG
986ee928a866 add sqlalchemy model + put create module for webapp
ymh <ymh.work@gmail.com>
parents:
diff changeset
    17
app.config.from_object(config)
986ee928a866 add sqlalchemy model + put create module for webapp
ymh <ymh.work@gmail.com>
parents:
diff changeset
    18
986ee928a866 add sqlalchemy model + put create module for webapp
ymh <ymh.work@gmail.com>
parents:
diff changeset
    19
import webapp.views