uwsgi with flask-script Manager
up vote
0
down vote
favorite
I use docker-compose to tie every image for launch once.
- nginx
- python
In python, I used uwsgi to deploy flask web server.
[manage.py]
import unittest
from app.main import create_app, db
from app.main.model import user
from flask_script import Manager
from app import blueprint
app = create_app(os.getenv('BOILERPLATE_ENV') or 'dev')
app.register_blueprint(blueprint)
app.app_context().push()
manager = Manager(app)
@manager.command
def run():
app.run(host='0.0.0.0')
@manager.command
def test():
"""Runs the unit tests."""
tests = unittest.TestLoader().discover('app/test', pattern='test*.py')
result = unittest.TextTestRunner(verbosity=2).run(tests)
if result.wasSuccessful():
return 0
return 1
if __name__ == '__main__':
manager.run()
As you know, I use flask-script Manager.
So when I execute flaks server, command like this -> python3 manage.py run
[uwsgi.ini]
[uwsgi]
chdir = /home
http-socket = :5001
chmod-socket = 777
logto = /home/web.log
process = 2
wsgi-file = manage.py
callable = manager
daemonize = /home/uwsgi.log
lazy-apps = true
pyargv = run
I set wsgi-file = manage.py
and callable = manager
.
Also set pyargv = run
to same effect with python3 manage.py run
But when I run server and access the web, it throws error.
TypeError: __call__() takes from 1 to 2 positional arguments but 3 were given
Full log here.
root@web_project_dev:/home# uwsgi --ini config/uwsgi.ini
[uWSGI] getting INI configuration from config/uwsgi.ini
root@web_project_dev:/home# tail -f uwsgi.log
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 72920 bytes (71 KB) for 1 cores
*** Operational MODE: single process ***
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI worker 1 (and the only) (pid: 65, cores: 1)
WSGI app 0 (mountpoint='') ready in 0 seconds on interpreter 0x55588beca210 pid: 65 (default app)
TypeError: __call__() takes from 1 to 2 positional arguments but 3 were given
[pid: 65|app: 0|req: 1/1] 192.168.192.4 () {40 vars in 746 bytes} [Tue Nov 13 05:20:44 2018] GET / => generated 0 bytes in 0 msecs (HTTP/1.0 500) 0 headers in 0 bytes (0 switches on core 0)
How can I insert command line parameter to uwsgi.ini?
Thanks.
python uwsgi flask-script
add a comment |
up vote
0
down vote
favorite
I use docker-compose to tie every image for launch once.
- nginx
- python
In python, I used uwsgi to deploy flask web server.
[manage.py]
import unittest
from app.main import create_app, db
from app.main.model import user
from flask_script import Manager
from app import blueprint
app = create_app(os.getenv('BOILERPLATE_ENV') or 'dev')
app.register_blueprint(blueprint)
app.app_context().push()
manager = Manager(app)
@manager.command
def run():
app.run(host='0.0.0.0')
@manager.command
def test():
"""Runs the unit tests."""
tests = unittest.TestLoader().discover('app/test', pattern='test*.py')
result = unittest.TextTestRunner(verbosity=2).run(tests)
if result.wasSuccessful():
return 0
return 1
if __name__ == '__main__':
manager.run()
As you know, I use flask-script Manager.
So when I execute flaks server, command like this -> python3 manage.py run
[uwsgi.ini]
[uwsgi]
chdir = /home
http-socket = :5001
chmod-socket = 777
logto = /home/web.log
process = 2
wsgi-file = manage.py
callable = manager
daemonize = /home/uwsgi.log
lazy-apps = true
pyargv = run
I set wsgi-file = manage.py
and callable = manager
.
Also set pyargv = run
to same effect with python3 manage.py run
But when I run server and access the web, it throws error.
TypeError: __call__() takes from 1 to 2 positional arguments but 3 were given
Full log here.
root@web_project_dev:/home# uwsgi --ini config/uwsgi.ini
[uWSGI] getting INI configuration from config/uwsgi.ini
root@web_project_dev:/home# tail -f uwsgi.log
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 72920 bytes (71 KB) for 1 cores
*** Operational MODE: single process ***
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI worker 1 (and the only) (pid: 65, cores: 1)
WSGI app 0 (mountpoint='') ready in 0 seconds on interpreter 0x55588beca210 pid: 65 (default app)
TypeError: __call__() takes from 1 to 2 positional arguments but 3 were given
[pid: 65|app: 0|req: 1/1] 192.168.192.4 () {40 vars in 746 bytes} [Tue Nov 13 05:20:44 2018] GET / => generated 0 bytes in 0 msecs (HTTP/1.0 500) 0 headers in 0 bytes (0 switches on core 0)
How can I insert command line parameter to uwsgi.ini?
Thanks.
python uwsgi flask-script
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I use docker-compose to tie every image for launch once.
- nginx
- python
In python, I used uwsgi to deploy flask web server.
[manage.py]
import unittest
from app.main import create_app, db
from app.main.model import user
from flask_script import Manager
from app import blueprint
app = create_app(os.getenv('BOILERPLATE_ENV') or 'dev')
app.register_blueprint(blueprint)
app.app_context().push()
manager = Manager(app)
@manager.command
def run():
app.run(host='0.0.0.0')
@manager.command
def test():
"""Runs the unit tests."""
tests = unittest.TestLoader().discover('app/test', pattern='test*.py')
result = unittest.TextTestRunner(verbosity=2).run(tests)
if result.wasSuccessful():
return 0
return 1
if __name__ == '__main__':
manager.run()
As you know, I use flask-script Manager.
So when I execute flaks server, command like this -> python3 manage.py run
[uwsgi.ini]
[uwsgi]
chdir = /home
http-socket = :5001
chmod-socket = 777
logto = /home/web.log
process = 2
wsgi-file = manage.py
callable = manager
daemonize = /home/uwsgi.log
lazy-apps = true
pyargv = run
I set wsgi-file = manage.py
and callable = manager
.
Also set pyargv = run
to same effect with python3 manage.py run
But when I run server and access the web, it throws error.
TypeError: __call__() takes from 1 to 2 positional arguments but 3 were given
Full log here.
root@web_project_dev:/home# uwsgi --ini config/uwsgi.ini
[uWSGI] getting INI configuration from config/uwsgi.ini
root@web_project_dev:/home# tail -f uwsgi.log
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 72920 bytes (71 KB) for 1 cores
*** Operational MODE: single process ***
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI worker 1 (and the only) (pid: 65, cores: 1)
WSGI app 0 (mountpoint='') ready in 0 seconds on interpreter 0x55588beca210 pid: 65 (default app)
TypeError: __call__() takes from 1 to 2 positional arguments but 3 were given
[pid: 65|app: 0|req: 1/1] 192.168.192.4 () {40 vars in 746 bytes} [Tue Nov 13 05:20:44 2018] GET / => generated 0 bytes in 0 msecs (HTTP/1.0 500) 0 headers in 0 bytes (0 switches on core 0)
How can I insert command line parameter to uwsgi.ini?
Thanks.
python uwsgi flask-script
I use docker-compose to tie every image for launch once.
- nginx
- python
In python, I used uwsgi to deploy flask web server.
[manage.py]
import unittest
from app.main import create_app, db
from app.main.model import user
from flask_script import Manager
from app import blueprint
app = create_app(os.getenv('BOILERPLATE_ENV') or 'dev')
app.register_blueprint(blueprint)
app.app_context().push()
manager = Manager(app)
@manager.command
def run():
app.run(host='0.0.0.0')
@manager.command
def test():
"""Runs the unit tests."""
tests = unittest.TestLoader().discover('app/test', pattern='test*.py')
result = unittest.TextTestRunner(verbosity=2).run(tests)
if result.wasSuccessful():
return 0
return 1
if __name__ == '__main__':
manager.run()
As you know, I use flask-script Manager.
So when I execute flaks server, command like this -> python3 manage.py run
[uwsgi.ini]
[uwsgi]
chdir = /home
http-socket = :5001
chmod-socket = 777
logto = /home/web.log
process = 2
wsgi-file = manage.py
callable = manager
daemonize = /home/uwsgi.log
lazy-apps = true
pyargv = run
I set wsgi-file = manage.py
and callable = manager
.
Also set pyargv = run
to same effect with python3 manage.py run
But when I run server and access the web, it throws error.
TypeError: __call__() takes from 1 to 2 positional arguments but 3 were given
Full log here.
root@web_project_dev:/home# uwsgi --ini config/uwsgi.ini
[uWSGI] getting INI configuration from config/uwsgi.ini
root@web_project_dev:/home# tail -f uwsgi.log
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 72920 bytes (71 KB) for 1 cores
*** Operational MODE: single process ***
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI worker 1 (and the only) (pid: 65, cores: 1)
WSGI app 0 (mountpoint='') ready in 0 seconds on interpreter 0x55588beca210 pid: 65 (default app)
TypeError: __call__() takes from 1 to 2 positional arguments but 3 were given
[pid: 65|app: 0|req: 1/1] 192.168.192.4 () {40 vars in 746 bytes} [Tue Nov 13 05:20:44 2018] GET / => generated 0 bytes in 0 msecs (HTTP/1.0 500) 0 headers in 0 bytes (0 switches on core 0)
How can I insert command line parameter to uwsgi.ini?
Thanks.
python uwsgi flask-script
python uwsgi flask-script
asked Nov 13 at 5:22
Hide
322111
322111
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53274309%2fuwsgi-with-flask-script-manager%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown