# Path: seoul_serenity/app.py
# def create_app(config_object=ProdConfig):
#     '''An application factory, as explained here:
#         http://flask.pocoo.org/docs/patterns/appfactories/
# 
#     :param config_object: The configuration object to use.
#     '''
#     app = Flask(__name__)
#     app.config.from_object(config_object)
#     register_extensions(app)
#     register_blueprints(app)
#     register_errorhandlers(app)
#     return app
# 
# Path: seoul_serenity/user/models.py
# class User(UserMixin, SurrogatePK, Model):
# 
#     __tablename__ = 'users'
#     username = Column(db.String(80), unique=True, nullable=False)
#     firstname = Column(db.String(30), nullable=True)
#     lastname = Column(db.String(30), nullable=True)
#     email = Column(db.String(80), unique=True, nullable=False)
#     #: The hashed password
#     password = Column(db.String(128), nullable=True)
#     created_at = Column(db.DateTime, nullable=False, default=dt.datetime.utcnow)
#     active = Column(db.Boolean(), default=False)
#     is_admin = Column(db.Boolean(), default=False)
#     user_type = Column(db.Integer, default=0)
# 
#     # TODO : next plan
#     # user_projects = db.relationship('User_project', backref='users',lazy='dynamic')
#     
#     def __init__(self, username, email, password=None, **kwargs):
#         db.Model.__init__(self, username=username, email=email, **kwargs)
#         if password:
#             self.set_password(password)
#         else:
#             self.password = None
# 
#     def set_password(self, password):
#         self.password = bcrypt.generate_password_hash(password)
# 
#     def check_password(self, value):
#         return bcrypt.check_password_hash(self.password, value)
# 
#     def get_id(self):
#         return unicode(self.id)
#             
#     def __repr__(self):
#         return '<User({username!r})>'.format(username=self.username)
# 
# Path: seoul_serenity/settings.py
# class DevConfig(Config):
#     """Development configuration."""
#     ENV = 'dev'
#     DEBUG = True
#     DB_NAME = 'dev.db'
#     # Put the db file in project root
#     DB_PATH = os.path.join(Config.PROJECT_ROOT, DB_NAME)
#     SQLALCHEMY_DATABASE_URI = 'sqlite:///{0}'.format(DB_PATH)
#     DEBUG_TB_ENABLED = True
#     ASSETS_DEBUG = True  # Don't bundle/minify static assets
#     CACHE_TYPE = 'simple'  # Can be "memcached", "redis", etc.
# 
# class ProdConfig(Config):
#     """Production configuration."""
#     ENV = 'prod'
#     DEBUG = False
#     # TODO 서영태 : heroku에서는 DATABASE_URL로 매팅
#     # SQLALCHEMY_DATABASE_URI = 'postgresql://localhost/example'  # TODO: Change me
#     SQLALCHEMY_DATABASE_URI = os_env['DATABASE_URL']
#     DEBUG_TB_ENABLED = False  # Disable Debug toolbar


import os
import sys
import subprocess
    import pytest
from flask.ext.script import Manager, Shell, Server
from flask.ext.migrate import MigrateCommand
from seoul_serenity.app import create_app
from seoul_serenity.user.models import User
from seoul_serenity.settings import DevConfig, ProdConfig
from seoul_serenity.database import db
#!/usr/bin/env python
# -*- coding: utf-8 -*-


if os.environ.get("SEOUL_SERENITY_ENV") == 'prod':
    app = create_app(ProdConfig)
else:

# Path: seoul_serenity/app.py
# def create_app(config_object=ProdConfig):
#     '''An application factory, as explained here:
#         http://flask.pocoo.org/docs/patterns/appfactories/
# 
#     :param config_object: The configuration object to use.
#     '''
#     app = Flask(__name__)
#     app.config.from_object(config_object)
#     register_extensions(app)
#     register_blueprints(app)
#     register_errorhandlers(app)
#     return app
# 
# Path: seoul_serenity/user/models.py
# class User(UserMixin, SurrogatePK, Model):
# 
#     __tablename__ = 'users'
#     username = Column(db.String(80), unique=True, nullable=False)
#     firstname = Column(db.String(30), nullable=True)
#     lastname = Column(db.String(30), nullable=True)
#     email = Column(db.String(80), unique=True, nullable=False)
#     #: The hashed password
#     password = Column(db.String(128), nullable=True)
#     created_at = Column(db.DateTime, nullable=False, default=dt.datetime.utcnow)
#     active = Column(db.Boolean(), default=False)
#     is_admin = Column(db.Boolean(), default=False)
#     user_type = Column(db.Integer, default=0)
# 
#     # TODO : next plan
#     # user_projects = db.relationship('User_project', backref='users',lazy='dynamic')
#     
#     def __init__(self, username, email, password=None, **kwargs):
#         db.Model.__init__(self, username=username, email=email, **kwargs)
#         if password:
#             self.set_password(password)
#         else:
#             self.password = None
# 
#     def set_password(self, password):
#         self.password = bcrypt.generate_password_hash(password)
# 
#     def check_password(self, value):
#         return bcrypt.check_password_hash(self.password, value)
# 
#     def get_id(self):
#         return unicode(self.id)
#             
#     def __repr__(self):
#         return '<User({username!r})>'.format(username=self.username)
# 
# Path: seoul_serenity/settings.py
# class DevConfig(Config):
#     """Development configuration."""
#     ENV = 'dev'
#     DEBUG = True
#     DB_NAME = 'dev.db'
#     # Put the db file in project root
#     DB_PATH = os.path.join(Config.PROJECT_ROOT, DB_NAME)
#     SQLALCHEMY_DATABASE_URI = 'sqlite:///{0}'.format(DB_PATH)
#     DEBUG_TB_ENABLED = True
#     ASSETS_DEBUG = True  # Don't bundle/minify static assets
#     CACHE_TYPE = 'simple'  # Can be "memcached", "redis", etc.
# 
# class ProdConfig(Config):
#     """Production configuration."""
#     ENV = 'prod'
#     DEBUG = False
#     # TODO 서영태 : heroku에서는 DATABASE_URL로 매팅
#     # SQLALCHEMY_DATABASE_URI = 'postgresql://localhost/example'  # TODO: Change me
#     SQLALCHEMY_DATABASE_URI = os_env['DATABASE_URL']
#     DEBUG_TB_ENABLED = False  # Disable Debug toolbar


# Path: manage.py
import os
import sys
import subprocess
    import pytest
from flask.ext.script import Manager, Shell, Server
from flask.ext.migrate import MigrateCommand
from seoul_serenity.app import create_app
from seoul_serenity.user.models import User
from seoul_serenity.settings import DevConfig, ProdConfig
from seoul_serenity.database import db

#!/usr/bin/env python
# -*- coding: utf-8 -*-


if os.environ.get("SEOUL_SERENITY_ENV") == 'prod':
    app = create_app(ProdConfig)
else:

    app = create_app(DevConfig)