Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
Loading items

Target

Select target project
  • hodorsec/hodor-backend
  • Vasanth/hodor-webapp
  • skamath/hodor-backend
  • techtocore/hodor-backend
4 results
Select Git revision
Loading items
Show changes
# coding=utf-8
# coding=utf-8
import os
class Config(object):
"""Parent configuration class."""
DEBUG = False
CSRF_ENABLED = True
TESTING = False
SECRET = os.getenv('SECRET')
SQLALCHEMY_DATABASE_URI = os.getenv('DATABASE_URL')
class DevelopmentConfig(Config):
"""Configurations for Development."""
DEBUG = True
SQLALCHEMY_DATABASE_URI = 'postgresql://localhost/hodor_test'
SECRET = "ChangeThisStringIfYouWant"
TESTING = True
class TestingConfig(Config):
"""Configurations for Testing, with a separate test database."""
TESTING = True
SQLALCHEMY_DATABASE_URI = 'postgresql://localhost/test_db'
DEBUG = True
SECRET = 'ChangeMeMaybe'
class StagingConfig(Config):
"""Configurations for Staging."""
DEBUG = True
class ProductionConfig(Config):
"""Configurations for Production."""
DEBUG = False
TESTING = False
SQLALCHEMY_DATABASE_URI = 'postgresql://localhost/hodor_prod'
SECRET = "TODO: ChangeMeInProduction"
app_config = {
'development': DevelopmentConfig,
'testing': TestingConfig,
'staging': StagingConfig,
'production': ProductionConfig,
}
\ No newline at end of file
from flask_script import Manager # class for handling a set of commands
from flask_migrate import Migrate, MigrateCommand
from hodor import db, app
migrate = Migrate(app, db)
manager = Manager(app)
manager.add_command('db', MigrateCommand)
if __name__ == '__main__':
manager.run()
#!/usr/bin/env python #!/bin/env python
# -*- coding: utf-8 -*-
import os
from hodor import app from hodor import app
if __name__ == '__main__': if __name__ == '__main__':
port = int(os.environ.get("PORT", 8080)) app.run()
app.run('0.0.0.0', port=port)