<commit_before>---
title: Elizabeth's Flaskr
layout: post
author: epeele
categories: post
---

So here is my flask site ![Flask](http://www.unc.edu/~epeele/file/flask_pic.png)  But, getting to this point is a longer explanation.

First, I couldn't get my 'about' section to work.  Everytime I tried to view it, I kept getting this ![Debug](http://www.unc.edu/~epeele/file/pic.png)  I looked up this error message, and all the boards said it was because flask couldn't find the about function so it didn't know what it was supposed to be doing.  I couldn't understand since I had done what the instructions said.  However, when I talked to Elliott, he explained that since I had the @app.route at the end of the flaskr.py file that it wasn't reading right.  The last statement needs to be <code>if __name__ == '__main__':  init_db()  app.run()</code> because that corresponds to the beginning tag and the code knows to look for that if statement and read everything in the file and process it.  Since I had my 'about' section underneath this, the program wasn't even reading it.

But, this problem led to a bigger problem when I tried to post the problem code on github.  I kept getting email after email saying 'page build error' and when I ran <code>jekyll serve --watch</code>, I kept getting something about angle brackets or a block.  This is one of the many error messages I received ![Screen](http://www.unc.edu/~epeele/file/peele_screenpage.png)  Elliott posted to the Google Plus page that the way to solve it would be to add  <code>{% raw %}</code> and {% endraw %} tags around my code so that Liquid would quit trying to process the code and just show it like I wanted to.  The finished code looks like the below.

In my templates/layout.html:

```
{% raw %}
<!doctype html>
<title>Flaskr</title>
<link rel=stylesheet type=text/css href="{{url_for('static', filename='style.css')}}">
<div class=page>
  <h1>Flaskr</h1>
  <div class=metanav>
  #Add this line:
  <a href="{{url_for('about')}}">about</a>
  {% if not session.logged_in %}
    <a href="{{ url_for('login') }}">log in</a>
  {% else %}<commit_msg>Update 2013-11-05-Elizabeths-Flaskr.md<commit_after>---
title: Elizabeth's Flaskr
layout: post
author: epeele
categories: post
---

So here is my flask site ![Flask](http://www.unc.edu/~epeele/file/flask_shot.png)  But, getting to this point is a longer explanation.

First, I couldn't get my 'about' section to work.  Everytime I tried to view it, I kept getting this ![Debug](http://www.unc.edu/~epeele/file/pic.png)  I looked up this error message, and all the boards said it was because flask couldn't find the about function so it didn't know what it was supposed to be doing.  I couldn't understand since I had done what the instructions said.  However, when I talked to Elliott, he explained that since I had the @app.route at the end of the flaskr.py file that it wasn't reading right.  The last statement needs to be <code>if __name__ == '__main__':  init_db()  app.run()</code> because that corresponds to the beginning tag and the code knows to look for that if statement and read everything in the file and process it.  Since I had my 'about' section underneath this, the program wasn't even reading it.

But, this problem led to a bigger problem when I tried to post the problem code on github.  I kept getting email after email saying 'page build error' and when I ran <code>jekyll serve --watch</code>, I kept getting something about angle brackets or a block.  This is one of the many error messages I received ![Screen](http://www.unc.edu/~epeele/file/screenpage.png)  Elliott posted to the Google Plus page that the way to solve it would be to add  <code>{% raw %}</code> and {% endraw %} tags around my code so that Liquid would quit trying to process the code and just show it like I wanted to.  The finished code looks like the below.

In my templates/layout.html:

```
{% raw %}
<!doctype html>
<title>Flaskr</title>
<link rel=stylesheet type=text/css href="{{url_for('static', filename='style.css')}}">
<div class=page>
  <h1>Flaskr</h1>
  <div class=metanav>
  #Add this line:
  <a href="{{url_for('about')}}">about</a>
  {% if not session.logged_in %}
    <a href="{{ url_for('login') }}">log in</a>
  {% else %}
{'fraction_non_alphanumeric': 0.10554771979313587, 'fraction_numerical': 0.0028208744710860366, 'mean_word_length': 4.1953601953601956, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5619491', 'n_tokens_mistral': 1308, 'n_tokens_neox': 1229, 'n_words': 607}