Browse Source

fix structure; running

master
Julio Biason 7 years ago
parent
commit
1fe94f3d65
  1. 33
      flask-40mins.html

33
flask-40mins.html

@ -594,14 +594,14 @@ STORAGE='/home/jbiason/src/ata/contents'</code></pre>
<h3><code>index.html</code></h3>
<pre><code>{% extends "layout.html" %}
{% block maincontent %}
{% block maincontent %}
&lt;div class='entry'&gt;
{% for entry, text in data %}
&lt;a href="{{ url_for('show_entry', entry_name=entry) }}"&gt;{{ entry }}&lt;/a&gt;
{{ text|safe }}
{% endfor %}
&lt;/div&gt;
{% endblock %}</code></pre>
{% endblock %}</code></pre>
<aside class="notes">
O arquivo apresentado na raíz da aplicação.
@ -616,12 +616,12 @@ STORAGE='/home/jbiason/src/ata/contents'</code></pre>
<h3><code>entry.html</code></h3>
<pre><code>{% extends "layout.html" %}
{% block maincontent %}
{% block maincontent %}
&lt;div class="entry"&gt;
&lt;div class="title"&gt;{{ entry }}&lt;/div&gt;
{{ output|safe }}
&lt;/div&gt;
{% endblock %}</code></pre>
{% endblock %}</code></pre>
<aside class="notes">
Como apresentar somente uma entrada.
@ -633,9 +633,9 @@ STORAGE='/home/jbiason/src/ata/contents'</code></pre>
<h3><code>page_not_found.html</code></h3>
<pre><code>{% extends "layout.html" %}
{% block maincontent %}
{% block maincontent %}
&lt;h2&gt;Page not found&lt;/h2&gt;
{% endblock %}</code></pre>
{% endblock %}</code></pre>
<aside class="notes">
A página quando ocorrer um 404...
@ -647,15 +647,32 @@ STORAGE='/home/jbiason/src/ata/contents'</code></pre>
<h3><code>entry_not_found.html</code></h3>
<pre><code>{% extends "layout.html" %}
{% block maincontent %}
{% block maincontent %}
&lt;h2&gt;Entry not found&lt;/h2&gt;
{% endblock %}</code></pre>
{% endblock %}</code></pre>
<aside class="notes">
... e quando a entrada não existir
(que é a captura do nosso FileNotFoundError)
</aside>
</section>
</section>
<section>
<section>
<h2>Rodando</h2>
<h3>(Dev server)</h3>
<pre><code>
FLASK_APP=ata/main.py flask run
</code></pre>
<pre class="fragment"><code>
export FLASK_RUN=ata/main
flask run
</code></pre>
</section>
</section>
<section data-background='_images/thats-all-folks.jpg'>
<section>

Loading…
Cancel
Save