Skip to content

Instantly share code, notes, and snippets.

@Frankity
Created January 12, 2017 21:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Frankity/edaa98a0f550be7a6780b51f4d9360dd to your computer and use it in GitHub Desktop.
Save Frankity/edaa98a0f550be7a6780b51f4d9360dd to your computer and use it in GitHub Desktop.
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from flask import Flask, jsonify
from flask_cors import CORS, cross_origin
from flask_mail import Mail
from flask_sqlalchemy import SQLAlchemy
import os
app = Flask(__name__)
app.config['CORS_HEADERS'] = 'Content-Type'
app.config['SECRET_KEY'] = 'new_brand_todo_app'
cors = CORS(app, resources={r"v1*":{"origins": "*"}})
app.config['SQLALCHEMY_DATABASE_URI'] = "sqlite:///todo.sqlite"
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = True
db = SQLAlchemy(app)
#app.config.from_object('config')
@app.errorhandler(404)
def not_found(error):
return jsonify({"message":"route not found"})
from api.users.controllers import mod_users as rest_users
from api.todos.controllers import mod_todo as rest_todos
app.register_blueprint(rest_users, url_prefix='/v1')
app.register_blueprint(rest_todos, url_prefix='/v1')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment