Example #1
0
def create_app(environ):
    app = Flask(__name__, static_url_path="/brigade/static")
    app.secret_key = "sangria wreath"
    app.config["BRIGADE_SIGNUP_SECRET"] = environ["BRIGADE_SIGNUP_SECRET"]
    app.config["GITHUB_CLIENT_ID"] = environ["GITHUB_CLIENT_ID"]
    app.config["GITHUB_CLIENT_SECRET"] = environ["GITHUB_CLIENT_SECRET"]

    # github.app = app
    github.init_app(app)

    app.register_blueprint(brigade)
    app.register_blueprint(filters)
    return app
Example #2
0
import json
import os
import re
from requests import get, post
from operator import itemgetter

from datetime import datetime
from base64 import b64encode

from flask import Flask, render_template, request, redirect, url_for, make_response, flash
import filters

app = Flask(__name__, static_url_path="/brigade/static")
app.register_blueprint(filters.blueprint)

app.config["BRIGADE_SIGNUP_SECRET"] = os.environ["BRIGADE_SIGNUP_SECRET"]
app.secret_key = "SECRET KEY"


@app.context_processor
def get_fragments():
    """ The base template includes the signup form and the footer
        pulled from our main site.
    """
    # Get universal sign up form
    r = get("http://www.codeforamerica.org/fragments/email-signup.html")
    signup = r.content

    # Get footer html
    r = get("http://www.codeforamerica.org/fragments/global-footer.html")
    footer = r.content