Created
April 24, 2013 19:49
-
-
Save gabrielhpugliese/5455018 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask | |
from views import * | |
app = Flask(__name__) | |
app.register_blueprint(views_bp) | |
views_bp.add_url_rule('/', | |
view_func=MainView.as_view('main')) | |
views_bp.add_url_rule('/user/create/<user_id>/', | |
view_func=UserView.as_view('user_create')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from os import path, environ | |
import json | |
from flask import Flask, jsonify | |
from flask.views import MethodView | |
from flask.templating import render_template | |
from flask.blueprints import Blueprint | |
from celery import Celery | |
from tasks import add | |
import settings | |
views_bp = Blueprint('views', __name__, template_folder='templates') | |
class MainView(MethodView): | |
route_base = '/' | |
def index(self): | |
return render_template('index.html') | |
class UserView(MethodView): | |
def post(self, user_id): | |
pass | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment