Apr-17-2019, 01:07 PM
(Apr-17-2019, 12:52 PM)DeaD_EyE Wrote: Please edit your original post. Put the code into code tags. Otherwise there is no indentation and no line numbers.I am not an expert, I didn't really understand. And how do I edit the post?[python] your code [/python]I think the problem is that you try to reuse the app object in the other module. You should look for blueprints: Example structure:web ├── app.py ├── __init__.py ├── __main__.py ├── pages.py └── __pycache__ ├── app.cpython-37.pyc ├── __main__.cpython-37.pyc └── pages.cpython-37.pycapp.py:from flask import Flask import pages app = Flask(__name__) app.register_blueprint(pages.bp) app.run()pages.pyfrom flask import Blueprint # this is the blueprint object which # have to registered with app bp = Blueprint('main_page', __name__, template_folder='templates') @bp.route('/') @bp.route('/test123') def index(): return 'index' @bp.route('/auth') def auth(): return 'auth' @bp.route('/info') def info(): return 'info'Additional ressources: