Flask application with Blueprints+uWSGI+nginx returning 404's (no routing?)

前端 未结 1 1375
野的像风
野的像风 2021-01-26 22:44

Having successfully deployed a minimal Flask app with nginx+uWSGI, I am stumped by this.

from flask import Flask
from bsfdash.users import users
from bsfdash.das         


        
相关标签:
1条回答
  • 2021-01-26 23:43

    Could you give us more information about your app structure ? I have a working Flask app with Blueprints that looks like, if it can help you.

    App/run.py :

    import sys
    sys.path.append("/subone")
    
    from iel import app, manager
    from flask.ext.migrate import MigrateCommand
    
    manager.add_command('db', MigrateCommand)
    
    app.debug = True
    manager.run()
    

    App/subone/__init__.py

    from flask import Flask
    from flask.ext.script import Manager
    from subone import models
    
    app = Flask(__name__)
    app.config.from_object('settings')
    
    manager = Manager(app)
    
    #Blueprints
    from catalog.views import catalog
    app.register_blueprint(catalog)
    
    from login.views import login
    app.register_blueprint(login,url_prefix="/login")
    
    if __name__ == '__main__':
      app.run(debug=True)
    

    App/subone/catalog/__init__.py :

    from flask import Blueprint
    
    0 讨论(0)
提交回复
热议问题