Created
June 26, 2015 18:57
-
-
Save mrjoes/8a60db1ac7136d58f020 to your computer and use it in GitHub Desktop.
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 import Flask | |
from mongoengine import connect | |
from flask.ext.admin import Admin | |
from flask.ext.admin.contrib.mongoengine import ModelView | |
from flask.ext.mongoengine import MongoEngine | |
class Config(object): | |
DEBUG = True | |
MONGODB_SETTINGS = { | |
'DB': 'db', | |
'HOST': 'mongodb://localhost:27017/db', 'alias': 'default' | |
} | |
SECRET_KEY = 'dogrj0e94jt0pjfpa8jw3rq098jw' | |
app = Flask(__name__) | |
app.config.from_object(Config) | |
db = MongoEngine(app) | |
admin = Admin(app) | |
class Model(db.Document): | |
text = db.StringField(verbose_name='Sid', max_length=255) | |
stock_count = db.IntField(required=True, default=0) | |
admin.add_view(ModelView(Model, name='Apps')) | |
print app.config | |
app.run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Same issue with this too.