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_testing import TestCase | |
from app import create_app, db | |
class BaseTestCase(TestCase): | |
def create_app(self): | |
return create_app("testing") | |
def setUp(self): |
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 app import create_app | |
app = create_app() |
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 getenv | |
from flask import Flask | |
from flask_sqlalchemy import SQLAlchemy | |
from .config import config | |
db = SQLAlchemy() | |
def create_app(config_name=None): |
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 getenv | |
class Config: | |
SECRET_KEY = getenv('SECRET_KEY', 'hard to guess string') | |
PROPAGATE_EXCEPTIONS = True | |
SQLALCHEMY_ECHO = getenv('SQLALCHEMY_ECHO') == 'true' | |
SQLALCHEMY_DATABASE_URI = getenv('DATABASE_URL') | |
SQLALCHEMY_TRACK_MODIFICATIONS = True |
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
# encoding=utf-8 | |
import sys | |
import datetime | |
import email | |
import mimetypes | |
import os | |
import time | |
import gzip | |
import subprocess |
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
#!/usr/bin/python | |
import sys | |
sys.path.append("/usr/local/google_appengine") | |
sys.path.append("/usr/local/google_appengine/lib/yaml/lib") | |
sys.path.append("/usr/local/google_appengine/lib/django_1_3") | |
sys.path.append("/usr/local/google_appengine/lib/fancy_urllib") | |
sys.path.append("/usr/local/google_appengine/lib/webob") | |
sys.path.append("/usr/local/google_appengine/lib/simplejson") | |
import os |
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
import models | |
from wtforms import Form | |
from wtforms import fields | |
from wtforms import validators | |
class PasswordRestForm(Form): | |
email = fields.TextField('email') | |
class PasswordChangeForm(Form): | |
current = fields.PasswordField('Current Password') |
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
# -*- coding: utf-8 -*- | |
from __future__ import absolute_import | |
import datetime | |
from ndb import model | |
from webapp2_extends.utils import Unique, UniqueConstraintViolation, \ | |
check_password_hash, generate_password_hash | |
from webapp2_extends.auth import create_session_id | |
DEBUG = True |
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
# -*- coding: utf-8 -*- | |
""" | |
A real simple app for using webapp2 with auth and session. | |
It just covers the basics. Creating a user, login, logout and a decorator for protecting certain handlers. | |
PRE-REQUIREMENTS: | |
Set at secret_key in webapp2 config: |
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
#!/bin/bash | |
# | |
# Build a virtual environment suitable for running appengine. | |
# This uses virtualenvwrapper to make the virtual environment. | |
# Which you can activate with 'workon appengine' | |
# | |
# Everyone loves one-liners! | |
# Mac one-liner: | |
# $ curl -s https://raw.github.com/gist/3353248 | bash | |
# |
NewerOlder