forked from oyd/Adunatio
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
752 B
27 lines
752 B
from flask import Flask
|
|
from flask_admin.contrib.mongoengine import ModelView
|
|
from mongoengine import connect
|
|
|
|
from models.Group import Group
|
|
from models.Union import Union
|
|
from models.User import User
|
|
from restapi import MongoApi
|
|
from flask_admin import Admin
|
|
"""
|
|
Mongodb connection string
|
|
"""
|
|
connect('adunatio', host='mongo',username="xcoder",password="4dun4710", authentication_source='admin')
|
|
|
|
|
|
app = Flask(__name__)
|
|
app.secret_key = "secret_key+secret_key"
|
|
api = MongoApi(app)
|
|
api.register_model(User,uri="/api/user")
|
|
api.register_model(Union,uri="/api/union")
|
|
adm = Admin(app)
|
|
adm.add_view(ModelView(User))
|
|
adm.add_view(ModelView(Union))
|
|
adm.add_view(ModelView(Group))
|
|
|
|
if __name__ == '__main__':
|
|
app.run(host="0.0.0.0",port=5000,debug=True) |