manage.py 701 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/usr/bin/env python
  2. from __future__ import print_function
  3. # Set the path
  4. from os import path
  5. import sys
  6. sys.path.append(path.abspath(path.join(path.dirname(__file__), '..')))
  7. from flask_script import Manager, Server
  8. from flask_script.commands import InvalidCommand
  9. from flask_migrate import MigrateCommand
  10. def create_app(quiet=False):
  11. from project import app
  12. return app
  13. manager = Manager(create_app)
  14. # Turn on debugger by default and reloader
  15. manager.add_command("runserver", Server(
  16. use_debugger = True,
  17. use_reloader = True,
  18. host = '0.0.0.0')
  19. )
  20. manager.add_command('db', MigrateCommand)
  21. from accounts.commands import *
  22. if __name__ == "__main__":
  23. manager.run()