-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #141 from lucyparsons/develop
Release v0.1.2
- Loading branch information
Showing
782 changed files
with
45,683 additions
and
588 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
language: python | ||
python: | ||
- "2.7" | ||
install: | ||
before_script: | ||
- pip install -e . | ||
- pip install -r requirements.txt | ||
- pip install coveralls | ||
- cd OpenOversight | ||
script: | ||
- py.test -v --cov=app | ||
after_success: | ||
- coveralls |
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
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
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,29 @@ | ||
from flask import Flask | ||
from flask import Flask, render_template | ||
from flask_sqlalchemy import SQLAlchemy | ||
from config import config | ||
|
||
app = Flask(__name__) | ||
app.config.from_object('config') | ||
db = SQLAlchemy(app) | ||
def create_app(config_name='default'): | ||
app = Flask(__name__) | ||
app.config.from_object(config[config_name]) | ||
config[config_name].init_app(app) | ||
from .models import db | ||
db.init_app(app) | ||
|
||
from app import views, models, utils | ||
from .main import main as main_blueprint | ||
app.register_blueprint(main_blueprint) | ||
|
||
@app.errorhandler(404) | ||
def page_not_found(e): | ||
return render_template('404.html'), 404 | ||
|
||
@app.errorhandler(403) | ||
def forbidden(e): | ||
return render_template('403.html'), 403 | ||
|
||
@app.errorhandler(500) | ||
def internal_error(e): | ||
return render_template('500.html'), 500 | ||
|
||
return 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import os | ||
from os.path import expanduser | ||
from dotenv import load_dotenv, find_dotenv | ||
|
||
load_dotenv(find_dotenv()) | ||
|
||
basedir = os.path.abspath(os.path.dirname(__file__)) | ||
|
||
|
||
class BaseConfig(object): | ||
# DB SETUP | ||
SQLALCHEMY_MIGRATE_REPO = os.path.join(basedir, 'db_repository') | ||
SQLALCHEMY_TRACK_MODIFICATIONS = False | ||
|
||
# File Upload Settings | ||
UNLABELLED_UPLOADS = 'uploads/' | ||
ALLOWED_EXTENSIONS = set(['png', 'jpg', 'jpeg', 'mpeg', 'mp4']) | ||
|
||
# pagination | ||
OFFICERS_PER_PAGE = os.environ.get('OFFICERS_PER_PAGE', 20) | ||
|
||
# Form Settings | ||
WTF_CSRF_ENABLED = True | ||
SECRET_KEY = 'changemeplzorelsehax' | ||
|
||
NUM_OFFICERS = 15000 | ||
SEED = 666 | ||
|
||
@staticmethod | ||
def init_app(app): | ||
pass | ||
|
||
|
||
class DevelopmentConfig(BaseConfig): | ||
DEBUG = True | ||
SQLALCHEMY_DATABASE_URI = os.environ.get('SQLALCHEMY_DATABASE_URI') | ||
|
||
|
||
class TestingConfig(BaseConfig): | ||
TESTING = True | ||
SQLALCHEMY_DATABASE_URI = 'sqlite:///:memory:' | ||
WTF_CSRF_ENABLED = False | ||
|
||
|
||
class ProductionConfig(BaseConfig): | ||
SQLALCHEMY_DATABASE_URI = os.environ.get('SQLALCHEMY_DATABASE_URI') | ||
|
||
@classmethod | ||
def init_app(cls, app): # pragma: no cover | ||
Config.init_app(app) | ||
|
||
|
||
config = { | ||
'development': DevelopmentConfig, | ||
'testing': TestingConfig, | ||
'production': ProductionConfig, | ||
'default': DevelopmentConfig | ||
} |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
This is a database migration repository. | ||
|
||
More information at | ||
http://code.google.com/p/sqlalchemy-migrate/ |
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env python | ||
from migrate.versioning.shell import main | ||
|
||
if __name__ == '__main__': | ||
main() |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
[db_settings] | ||
# Used to identify which repository this database is versioned under. | ||
# You can use the name of your project. | ||
repository_id=database repository | ||
|
||
# The name of the database table used to track the schema version. | ||
# This name shouldn't already be used by your project. | ||
# If this is changed once a database is under version control, you'll need to | ||
# change the table name in each database too. | ||
version_table=migrate_version | ||
|
||
# When committing a change script, Migrate will attempt to generate the | ||
# sql for all supported databases; normally, if one of them fails - probably | ||
# because you don't have that database installed - it is ignored and the | ||
# commit continues, perhaps ending successfully. | ||
# Databases in this list MUST compile successfully during a commit, or the | ||
# entire commit will fail. List the databases your application will actually | ||
# be using to ensure your updates to that database work properly. | ||
# This must be a list; example: ['postgres','sqlite'] | ||
required_dbs=[] | ||
|
||
# When creating new change scripts, Migrate will stamp the new script with | ||
# a version number. By default this is latest_version + 1. You can set this | ||
# to 'true' to tell Migrate to use the UTC timestamp instead. | ||
use_timestamp_numbering=False |
Empty file.
Oops, something went wrong.