#!/usr/bin/env python # -*- coding: utf-8 # Required modules from flask import Flask, request, session, g, redirect, url_for, abort, render_template, flash from functools import wraps # Optionnal modules import psycopg2 from flask_sqlalchemy import SQLAlchemy ######################################################################## # App settings ######################################################################## app = Flask(__name__) # Path to static files app.static_url_path='/static' # Set debug mode to False for production app.debug = True # Various configuration settings belong here (optionnal) app.config.from_pyfile('config.local.py') # Generate a new key: head -n 40 /dev/urandom | md5sum | cut -d' ' -f1 app.secret_key = 'ce1d1c9ff0ff388a838b3a1e3207dd27' # Feel free to use SQLAlchemy (or not) db = SQLAlchemy(app) app.menu = [('accueil', '/plap.html', 0), ('Motherfuckisme', '/plap.html', 1 ), ('We make porn', '/plap.html', 0 ), ('mes couilles sur la comode3', '/plap.html', 0 ), ('mes couilles sur la comode4', '/plap.html', 0 ), ('mes couilles sur la comode5', '/plap.html', 0 ), ('mes couilles sur la comode6', '/plap.html', 0 ), ('mes couilles sur la comode7', '/plap.html', 0 ) ] ######################################################################## # Routes ######################################################################## @app.errorhandler(404) def page_not_found(e): """ 404 not found """ return render_template('error.html', menu=app.menu), 404 @app.route("/", methods=['GET', 'POST']) def index(): return render_template('index.html', menu=app.menu) ######################################################################## # Main ######################################################################## if __name__ == '__main__': app.run(host='0.0.0.0')