How long does the additional fire damage of an oil flask last?

Here’s the text of an oil flask:

Oil usually comes in a clay flask that holds 1 pint. As an action, you can splash the oil in this flask onto a creature within 5 feet of you or throw it up to 20 feet, shattering it on impact. Make a ranged attack against a target creature or object, treating the oil as an improvised weapon. On a hit, the target is covered in oil. If the target takes any fire damage before the oil dries (after 1 minute), the target takes an additional 5 fire damage from the burning oil. You can also pour a flask of oil on the ground to cover a 5-foot-square area, provided that the surface is level. If lit, the oil burns for 2 rounds and deals 5 fire damage to any creature that enters the area or ends its turn in the area. A creature can take this damage only once per turn.

The description provides a duration that oil burns while poured onto a surface, but not for oil that’s lit while splashed onto a creature. Does a creature covered in oil take the additional 5 fire damage every time it takes fire damage for the one-minute duration until the oil dries, or only the first time?

5e is usually pretty literal about this, and it doesn’t say ‘the first time the target takes fire damage,’ so I’m inclined to think it’s the latter. But that seems pretty powerful for adventuring gear that costs a single silver piece, even if it does take an action to set up.

Flask en localhost permite pasar variables entre routes, pero en produccion borra la data entre consultas. soluciones sin BD?

tengo una webapp en flask, la trabaje probando en localhost y me di cuenta que los datos entre consulta se iban almacenando (trabaje con lista de datos) y base todo el trabajo en esa modalidad, ahora cuando hice un deploy de la app, me di cuenta que entre cada consulta, flask borra esos datos (las listas se reinician sin datos) por lo que la app no funciona, se que lo ideal es ocupar base de datos, pero los datos que manejo son muy variables, por lo que no me sirve almacenarlos, solo trabajo con ellos entre las consultas. hay alguna forma de hacer un deploy y evitar ese reinicio? o tener alguna solucion para evitar la perdida de la información de esas listas que se van generando?? gracias”

Flask, доступ к расширениям, обьявленным create_app через Blueprint

Имеется примерно такой файл init.py:

def create_app():     app = flask.Flask(name)     avatar = flask_avatar.Avatars(app)     return app 

В произвольном блюпринте user необходимо обратиться к методу обьекта avatar, ранее объявленного в create_app() Каким способом это можно сделать?

Service worker / caching a whole API in a Flask app?

I’m building a small scale app based on the Flask micro framework. In it, I have a service worker that caches the basic shell of my app (HTML, CSS and JS). However, I have dynamic content that is updated when some event occurs (i.e. click on a button which sends a request to the API endpoint, the backend does a bit of filtering and then it sends the processed data back to the UI).

How can I approach the caching of this API and is that possible at all? One way I thought of was to cache request by request until, gradually, I cache all of the possible responses. However, I’m not sure if there is another solution to make my app more accessible when in offline mode.

How do I link my python code into HTML without using flask (it doesn’t work on my computer)?

I’m thinking of making a GitHub website with python, but I’m not sure how to link python code into HTML.

I’ve tried several tutorials and searched through 3 pages of google search results (you know I’m desperate once I’ve done that). Please help me!

How do I link my python code into HTML without using flask (it doesn’t work on my computer)?

I’m thinking of making a GitHub website with python, but I’m not sure how to link python code into HTML.

I’ve tried several tutorials and searched through 3 pages of google search results (you know I’m desperate once I’ve done that). Please help me!

Pesquisa no Banco de Dados com valor de SelectField flask

Criei um campo de pesquisa usando SelectField mas ele não mostra o resultado no templates. o que estou fazendo de errado

Meu form

class FiltroForm(FlaskForm):     filtro = SelectField('Escolha a cidade', choices=[('Aracaju (SBAR)', 'Aracaju (SBAR)'), ('Aracaju (SBAR)', 'Aracaju (SBAR)'), ('Belém (SBBE)', 'Belém (SBBE)')])     submit = SubmitField('Selecionar') 

Banco de dados

class Listadevoo(db.Model):     id = db.Column(db.Integer, primary_key=True)     voo = db.Column(db.String(120))     origem = db.Column(db.String(120))     destino = db.Column(db.String(120))     aeronave = db.Column(db.String(120))     partida = db.Column(db.String(120))     chegada = db.Column(db.String(120)) 

Minha rota

@app.route('/voo', methods=["GET", "POST"]) def voo():     form = FiltroForm()         post = Listadevoo.query.filter_by(origem=form.filtro.data).all()     if form.validate_on_submit():         return redirect(url_for('voo'))     return render_template('voo.html', form=form, post=post) 

Templates

<div class="container-fluid">         <h1>voo</h1>         <form method="post" action="">           {{ form.hidden_tag() }}                 <p>{{ form.filtro.label }} {{ form.filtro }} {{ form.submit }}</p>        <hr>        <table>         <tr>           <th>Voo</th>           <th>Origem</th>           <th>Destino</th>           <th>Aeronave</th>           <th>Partida</th>           <th>Chegada</th>                   </tr>         {% for post in post %}         <tr>           <td>{{ post.voo }}</td>           <td>{{ post.origem }}</td>           <td>{{ post.destino }}</td>           <td><font color="#e3068f">{{ post.aeronave }}</font></td>           <td>{{ post.partida }}</td>           <td>{{ post.chegada }}</td>         </tr>         {% endfor %}       </table>          </div> 

Uma observação se eu remover form.filtro.data e colocar uma string ele mostra o resultado. Mas gostaria de usar aa função SelectField

@app.route('/voo', methods=["GET", "POST"]) def voo():     form = FiltroForm()         post = Listadevoo.query.filter_by(origem='São Paulo (SBSP)').all()     if form.validate_on_submit():         return redirect(url_for('voo'))     return render_template('voo.html', form=form, post=post) 

inserir a descrição da imagem aqui

Long term viability: Django vs Flask [on hold]

I recently had a frustrating discussion at work where a non-technical person insisted we switch from Flask to Django in my project because “Django scales better,” meaning it’s easier to hire django developers, easier to get them started (because django has more rules), and easier to hire agencies to work on django.

I spent a lot of time feeling incredulous of all the points above, but I’m curious, are they true? How would a person even measure such things?

Python flask static status 304

Estou tendo um problema com o flask, ele esta me retornando um erro 304 para arquivos CSS.

<!DOCTYPE html> <html lang="pt-br"> <head>     <meta charset="UTF-8">     <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">      <!-- Bootstrap CSS -->     <!--<link rel="stylesheet" href="{{ url_for('static', filename='css/bootstrap/bootstrap-reboot.min.css') }}">-->     <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/bootstrap/bootstrap.min.css') }}">     <!--<link rel="stylesheet" href="{{ url_for('static', filename='css/bootstrap/bootstrap-grid.min.css') }}">-->     <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/bootstrap/dataTables.bootstrap4.min.css') }}">     <!-- Ga.IA -->     <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/gaia/main.css') }}">     <title>Ga.IA</title> </head> <body>      <div class="container">     {% block content %}     {% endblock %}     </div>  <footer class="footer">     <p class="navbar-brand">Versão: {{ sistema['versao'] }} - 2019 (c) - Bruno La Porta</p> </footer>      <!-- jQuery primeiro, depois Popper.js, depois Bootstrap JS -->     <script type="text/plain" src="{{ url_for('static', filename='js/jquery/jquery-3.4.1.min.js') }}"></script>     <script type="text/plain" src="{{ url_for('static', filename='js/jquery/jquery.mask.min.js') }}"></script>     <!--<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>-->     <script type="text/plain" src="{{ url_for('static', filename='js/bootstrap/bootstrap.min.js') }}"></script>     <!-- DataTable -->     <script type="text/plain" src="{{ url_for('static', filename='js/jquery/jquery.dataTables.min.js') }}"></script>     <script type="text/plain" src="{{ url_for('static', filename='js/bootstrap/dataTables.bootstrap4.min.js') }}"></script>     <!-- Sweet Alert -->     <script type="text/plain" src="{{ url_for('static', filename='js/sweet_alert/sweetalert.min.js') }}"></script>     <!-- Ga.IA -->     <script type="text/plain" src="{{ url_for('static', filename='js/gaia/main.js') }}"></script>     <script type="text/plain" src="{{ url_for('static', filename='js/gaia/usuario.js') }}"></script>     <script type="text/plain" src="{{ url_for('static', filename='js/gaia/cliente.js') }}"></script> </body> </html>  

O retorno no console é o seguinte:

127.0.0.1 – – [13/Jun/2019 22:55:07] “GET /destino/17 HTTP/1.1” 200 –
127.0.0.1 – – [13/Jun/2019 22:55:07] “GET /static/css/bootstrap/bootstrap.min.css HTTP/1.1” 304 –
127.0.0.1 – – [13/Jun/2019 22:55:07] “GET /static/css/bootstrap/dataTables.bootstrap4.min.css HTTP/1.1” 304 –
127.0.0.1 – – [13/Jun/2019 22:55:07] “GET /static/css/gaia/main.css HTTP/1.1” 304 –

Obs.: Os arquivos JS tem que ficar como type="text/plain", caso contrario retornam o mesmo problema, já tentei usar este type no css e até mesmo deixar sem nenhum, o erro é o mesmo.