Exemple #1
0
from bookshelf import app
from bookshelf.data.models import db

# from flask.ext.script import Shell, Manager

# def make_shell_context():
#     return dict(app=app, db=db, Author=Author)

# manager = Manager(create_app)
# manager.add_command("shell", Shell(make_context=_make_context))

if __name__ == '__main__':
    app.run()
Exemple #2
0
from bookshelf import app


if __name__ == '__main__':
    app.run()
Exemple #3
0
from bookshelf import app
"""
 Modern convention is to write web applications using an "MVC" - "Model View Controller" structure.
 This allow your code to be segmented into logical sections which will be maintained on different cyles by different teams,
 may be shared between different applications, and may even be in different languages / formats.
 
    • Model - the business logic of the application
    • View - the template to be completed / look and feel of the page
    • Controller - top code that runs the model and renders the view
 
    Although convention is to talk "MVC", there's a fourth element that's needed - and indeed that's needed first
    • Router - How particular URLs map onto particular controllers
"""

# for development server
if __name__ == '__main__':
    app.run(debug=True)
Exemple #4
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from bookshelf import app

if __name__ == '__main__':
    port = int(os.environ.get("PORT", 8080))
    app.run('0.0.0.0', port=port)
Exemple #5
0
from bookshelf import app

if __name__ == "__main__":
    app.run('0.0.0.0')
Exemple #6
0
#!/bin/env python
from bookshelf import app

if __name__ == '__main__':
    app.run(host='0.0.0.0', debug=True, port=5000)