Skip to content

Instantly share code, notes, and snippets.

@pvanliefland
Created June 10, 2013 21:25
Show Gist options
  • Save pvanliefland/5752454 to your computer and use it in GitHub Desktop.
Save pvanliefland/5752454 to your computer and use it in GitHub Desktop.
Flask view import problem
from flask import Flask, request, render_template
import config, database
app = Flask(__name__)
app.debug = config.DEBUG
import views
if __name__ == "__main__":
app.run()
from app import app
# Index page
@app.route("/", methods=['GET'])
def index():
return render_template('index.html')
# Add picture page
@app.route("/add-picture", methods=['GET', 'POST'])
def add_picture():
return render_template('add_picture.html')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment