Permalink
Browse files

Fix instructions to work as intended

  • Loading branch information...
1 parent 3008a19 commit b81dd4c5139556252ff74e2b755f91d2e2cb1d05 Daniel Mizyrycki committed Jan 21, 2012
Showing with 16 additions and 13 deletions.
  1. +16 −13 README.rst
View
@@ -15,8 +15,8 @@ class, the cloned noiselist is the full solution so you can view the commit log
how the app was built step by step. To get the first step::
> git clone git://github.com/noisebridge/flask-noiselist.git
- > git checkout ba4ebf111f
> cd flask-noiselist
+ > git checkout ba4ebf111f
> python bootstrap.py
> ./bin/buildout
@@ -30,9 +30,12 @@ placeholder.
Take a minute to notice the differences between this app and web2py. There is
no admin console and no formatting by default. Flask is really a micro framwork.
-Notice as well that starting we are in foreground mode, and that you don't
-have to kill a process or terminal to restart. Simply Ctl-C to restart. This
-also means that any pdbing will take you directly to this console.
+Notice as well that we are starting in foreground mode, and that you don't
+have to kill a process or terminal to restart. Foreground mode will autodetect
+changes and reload new code automatically. In doubt, simply Ctrl-C and restart
+the server with './bin/flask-ctl debug fg'. This also means that any pdbing
+will take you directly to this console.
+
Modifying These Instructions
----------------------------
@@ -76,7 +79,7 @@ First we need to create a directory for holding our templates::
And lets take our Hello page and make it into a template by adding a template::
- > touch hello.html
+ > touch templates/hello.html
In that file, let's add a few lines to show how our list will look in the end::
@@ -91,18 +94,18 @@ In that file, let's add a few lines to show how our list will look in the end::
<li>Finish evaluating pull requests</li>
<li>Finish writing up class work</li>
<li>Swim and enjoy the sun</li>
- <ul>
+ </ul>
<form action="" method="POST" id="add_to_todo_list">
<input type="text" name="todo_item"/>
<input type="submit" name="add_todo_submit" value="Add to List!"/>
</form>
</body>
</html>
-And then in __init__.py, we will connect the index page with that tempalte by
-adding a decorator::
+And then in __init__.py, we will connect the index page with that template
+doing the following modifications::
- from flask import render_template
+ from flask import Flask, request, render_template
...
@@ -120,7 +123,7 @@ css, and othe image files.
Let's start by hooking up some styles. Since it's all the craze with kids these days, we will
use twitters Bootstrap library.
-First let's add the default styles to the top of hello.html. The firs link is hostted by twitter
+First let's add the default styles to the top of hello.html. The first link is hosted by twitter
and the second link will be hosted by us::
<head>
@@ -236,7 +239,7 @@ a bit of a different twist. Edit model.py to say::
def __repr__(self):
return '<TODO %r>' % self.description
-Next we need to initialize the database. Initializeing the database will sync the model
+Next we need to initialize the database. Initializing the database will sync the model
we created with the database, making sure that all the columns and tables we need are
there and ready to use*. In __init__.py::
@@ -275,7 +278,7 @@ empty list.
Submitting Data
---------------
Because this is our second time adding data to a database, let's also introduce the
-concept of routing. Let's have our from page form submit to a url that is not the
+concept of routing. Let's have our front page form submit to a url that is not the
index page, process the data, and then redirect. First things first, let's add a
new route that the form can submit to. This is just a matter of creating a function
and testing that it goes to the right place. In __init__.py::
@@ -315,7 +318,7 @@ commit is REQUIRED!::
def add_todo():
if 'todo_item' in request.form:
todo = TodoItem(description=request.form['todo_item'])
- db.session.add(todob)
+ db.session.add(todo)
db.session.commit()
return "Got it!"
return "Unknown Error"

0 comments on commit b81dd4c

Please sign in to comment.