Guest User

Untitled

a guest
Jun 24th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. -instance
  2. -config.py
  3. -service
  4. -__init__.py
  5. -auth.py
  6. -db.py
  7. -tables.sql
  8. -venv
  9.  
  10. class DefaultConfig(object):
  11. DEBUG = True
  12. TESTING = False
  13. SECRET_KEY = 'this-really-needs-to-be-changed'
  14. HOST = "localhost"
  15. USER = "root"
  16. PASSWD = "hello"
  17. DB = "testdb"
  18.  
  19. class ProductionConfig(DefaultConfig):
  20. DEBUG = False
  21.  
  22. import os
  23. from flask import Flask
  24.  
  25. def create_app(config=None):
  26. # create and configure the app
  27. app = Flask(__name__, instance_relative_config=True)
  28. app.config.from_object('config.ProductionConfig')
  29.  
  30. try:
  31. os.makedirs(app.instance_path)
  32. except OSError:
  33. pass
  34.  
  35. from . import db
  36. db.init_app(app)
  37.  
  38. from . import auth
  39. app.register_blueprint(auth.bp)
  40.  
  41. return app
  42.  
  43. Debugged import:
  44.  
  45. - 'config' not found.
  46.  
  47. Original exception:
  48.  
  49. ModuleNotFoundError: No module named 'config'
Add Comment
Please, Sign In to add comment