Answer the question
In order to leave comments, you need to log in
How to setup fmanager(flask) and wsgi?
Good afternoon.
wrote a small website (flask jinja2 python3.4) and still can't run it on the hosting (ubuntu 15.10x64)
the project uses manager:
executable file run.py
import os
from app import create_app, db
from app.model import User, Role, Post, Comment
from flask.ext.script import Manager, Shell
from flask.ext.migrate import Migrate, MigrateCommand
app = create_app(os.getenv('FLASK_CONFIG') or 'default')
manager = Manager(app)
migrate = Migrate(app, db)
def make_shell_context():
return dict(app=app, db=db, User=User, Role=Role, Post=Post, Comment=Comment)
@manager.command
def test():
import unittest
tests = unittest.TestLoader().discover('tests')
unittest.TextTestRunner(verbosity=2).run(tests)
manager.add_command("shell", Shell(make_context=make_shell_context))
manager.add_command('db', MigrateCommand)
if __name__ == '__main__':
manager.run()
#!/usr/bin/python3.4
import sys
import logging
logging.basicConfig(stram=sys.stderr)
sys.path.insert(0,"var/www/FlaskApp/")
FlaskApp
├── app
│ ├── auth
│ │ ├── forms.py
│ │ ├── __init__.py
│ │ └── views.py
│ ├── decorators.py
│ ├── email.py
│ ├── exceptions.py
│ ├── __init__.py
│ ├── __init__.pyc
│ ├── main
│ │ ├── errors.py
│ │ ├── forms.py
│ │ ├── __init__.py
│ │ └── views.py
│ ├── model.py
│ ├── __pycache__
│ │ ├── decorators.cpython-34.pyc
│ │ ├── decorators.cpython-35.pyc
│ │ ├── email.cpython-34.pyc
│ │ ├── email.cpython-35.pyc
│ │ ├── exceptions.cpython-34.pyc
│ │ ├── exceptions.cpython-35.pyc
│ │ ├── __init__.cpython-34.pyc
│ │ ├── __init__.cpython-35.pyc
│ │ ├── model.cpython-34.pyc
│ │ └── model.cpython-35.pyc
│ ├── static
│ └── templates
│ └── *.html
├── config.py
├── data.db
├── requiment.txt
├── requirements.txt
├── run.py
├── tests
└── __init__.py
flaskapp.wsgi
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question