简体   繁体   中英

Error in running uwsgi with Flask on Ubuntu

I have trouble setting up my project on DigitalOcean. i'm new on Python. Currently using flask to create a simple app.

My directory in the ubuntu server is as such: ~/kaboong/{{all files}}

the main py file is called main.py:

from flask import Flask, render_template, request, redirect,jsonify, url_for, flash
app = Flask(__name__)

if __name__ == '__main__':
  app.debug = True
  app.run(host = '0.0.0.0', port = 8000)

Inside my wsgi.py file:

from main import app
if __name__ == '__main__':
    app.run()

I tried running the wsgi as such :

uwsgi --socket 0.0.0.0:8000 --protocol=http -w wsgi

I got an error saying:

* no app loaded. going in full dynamic mode *

Whats the problem here?

can you try this?

uwsgi --socket 0.0.0.0:8000 --protocol=http -w wsgi:app --callable app

if does not works, can you show more info such log console full?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM