M
M
Mikhail Mikhail2016-03-03 09:05:57
Python
Mikhail Mikhail, 2016-03-03 09:05:57

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()

in the wsgi file I write
#!/usr/bin/python3.4
import sys
import logging
logging.basicConfig(stram=sys.stderr)
sys.path.insert(0,"var/www/FlaskApp/")

the full scale of the tragedy
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

I can’t understand what needs to be added to wsgi so that he even tries to launch the site

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sim3x, 2016-03-03
@sim3x

flask.pocoo.org/docs/0.10/deploying/uwsgi

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question