We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
http://flask.pocoo.org/docs/blueprints/
Each blueprint has it's own static and template file paths
The text was updated successfully, but these errors were encountered:
#!/usr/bin/env python import os import flask main_dir = os.path.dirname(os.path.abspath(__name__)) a_blueprint = flask.Blueprint('a', 'a', \ template_folder=os.path.join(main_dir, 'a'), \ static_folder=os.path.join(main_dir, 'a', 'static')) b_blueprint = flask.Blueprint('b', 'b', \ template_folder=os.path.join(main_dir, 'b'), \ static_folder=os.path.join(main_dir, 'b', 'static')) app = flask.Flask(__name__) @a_blueprint.route('/') def get_a(): return flask.render_template('index.html') @b_blueprint.route('/') def get_b(): return flask.render_template('index.html') app.register_blueprint(a_blueprint, url_prefix='/a') app.register_blueprint(b_blueprint, url_prefix='/b') if __name__ == '__main__': app.run(debug=True)
Sorry, something went wrong.
No branches or pull requests
http://flask.pocoo.org/docs/blueprints/
Benefits
Each blueprint has it's own static and template file paths
The text was updated successfully, but these errors were encountered: