Skip to content

Instantly share code, notes, and snippets.

@Collinslenjo
Forked from cedbeu/__init__.py
Created March 3, 2018 11:36
Show Gist options
  • Select an option

  • Save Collinslenjo/294afa4a6a56252b8aa8bcec998f69b3 to your computer and use it in GitHub Desktop.

Select an option

Save Collinslenjo/294afa4a6a56252b8aa8bcec998f69b3 to your computer and use it in GitHub Desktop.
Minimal Flask application - Basic package design pattern Create a structure like this: `./run.py` `./webapp/__init__.py` `./webapp/views.py`
#!/usr/bin/python
# coding: utf-8
from flask import Flask
app = Flask(__name__)
import webapp.views
#!/usr/bin/python
# coding: utf-8
from webapp import app
@app.route('/')
def webapp():
return 'Hello World'
#!/usr/bin/python
# coding: utf-8
from webapp import app
if __name__ == '__main__':
app.run(debug=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment