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

20 lines
424 B

  1. import os
  2. from flask import Flask
  3. def create_app():
  4. app = Flask(__name__)
  5. app.config.from_mapping(
  6. SECRET_KEY='dev',
  7. DATABASE=os.path.join(app.instance_path, 'voting-system.sqlite')
  8. )
  9. app.config.from_pyfile('config.py', silent=True)
  10. try:
  11. os.makedirs(app.instance_path)
  12. except OSError:
  13. pass # Already exists
  14. @app.route('/votings')
  15. def hello():
  16. return 'Hello, world!'
  17. return app