Muestra las diferencias entre dos versiones de la página.
| Ambos lados, revisión anterior Revisión previa Próxima revisión | Revisión previa | ||
|
wiki2:python:flask [2015/08/11 07:28] alfred [To redirect...] |
wiki2:python:flask [2020/05/09 09:25] (actual) |
||
|---|---|---|---|
| Línea 1: | Línea 1: | ||
| ====== Flask ====== | ====== Flask ====== | ||
| + | ===== Extensions ===== | ||
| + | |||
| + | * [[wiki2:python:flask:sqlalchemy|Flask SQLAlchemy]] | ||
| + | * [[wiki2:python:flask:restful|Flask RESTful]] | ||
| + | * [[wiki2:python:flask:mongoalchemy|Flask MongoAlchemy]] | ||
| + | * [[wiki2:python:flask:flaskmongoengine|Flask Mongo Engine]] | ||
| + | * [[wiki2:python:flask:flasklogin|Flask Login]] | ||
| + | * [[wiki2:python:flask:testing|Flask Testing]] | ||
| + | * [[wiki2:python:flask:used_libraries|Flask used libraries]] | ||
| ===== Some elements ===== | ===== Some elements ===== | ||
| Línea 300: | Línea 309: | ||
| For static files: | For static files: | ||
| <code python> | <code python> | ||
| - | url_for('static', filename='path/to/fil | + | url_for('static', filename='path/to/file') |
| + | # In blueprints | ||
| + | url_for('admin.static', filename='style.css') | ||
| </code> | </code> | ||
| You also can use it in templates. | You also can use it in templates. | ||
| <code> | <code> | ||
| <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='bootstrap/bootstrap.min.css') }}"> | <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='bootstrap/bootstrap.min.css') }}"> | ||
| + | </code> | ||
| + | In blueprints: | ||
| + | <code python> | ||
| + | # this blueprint -> printable function | ||
| + | url_for('.printable') | ||
| + | # blueprint: resume, resource FUNCTION: printable_resume | ||
| + | url_for('resume.printable_resume') | ||
| + | </code> | ||
| + | You can get the absolute url: | ||
| + | <code python> | ||
| + | url_for('settings', _external=True) | ||
| </code> | </code> | ||