Note: The code in the video does not set the host properly. Use the code below for your bookmarklet:
We are at an unprecedented point in American history, and I'm concerned we
may lose sight of the American Dream.
img
s in that page.Board
. Basically, a user can create any number boards. Each board has a title, which the user can set. The user can add any number of his pins to any one of his boards (a pin can be in more than one board). GET / | when logged-in, shows links to "My Pins" (/pin) and "My Boards" (/board) |
GET /pin | lists all the users' pins and links us to each one, as before. Also, this page should let the user add a new pin. |
POST /pin | creates a new pin, as before |
GET /pin/123 | shows pin 123, and a form for editing it, as before. |
POST /pin/123 | updates pin 123 (caption or url), or deletes it, as before. |
GET /board | lists all my boards. If not logged in re-direct to /, and do similarly for all the other URLs. Also, this page should let the user add a new board. |
POST /board | Creates a new board and then redirects the user to it. |
GET /board/123 | If my board then list all the pins in the board and a form for editing it. If not mine but public then list the pins in the board. If not mine and private then re-direct to / |
POST /board/123 | Update board 123's information. The possible changes are: new title, add pin, delete pin, mark as private/public, delete board. Then redirect the user back to GET /board/123 |
Key
, which works the same way as a key in a hash table (an index in an array). The keys can be generated from an item's ID
and its entity type. I explain below:/pic
in your project and add a few of your favorite jpegs from the net. You will use these when debugging your app. They will save you time as your browser will not have to keep fetching images from the net (and, you can code offline).Pin(db.Model)
with imgUrl
, caption
, date
, and owner
properties. That is, each Pin will have a URL, a caption, a date of creation, and an owner associated with it. Each pin will also have a unique id
, but you can just use the built-in key
. That is, the Pin's id will be given by self.key().id()
.self.redirect()
) to the new pin's page: /pin/1234 (or, whatever number you have the pin).GET / | when logged-in, shows a form for adding a pin | ||||||
GET /pin | lists all the users' pins and links us to each one. | ||||||
POST /pin | creates a new pin | ||||||
GET /pin/123 | shows pin 123, and a form for editing it | ||||||
POST /pin/123 | updates pin 123 (caption or url), or deletes it |
href="/css/style.css"
then the browser is going to do a GET /css/style.css
. But, since you are running the app engine this means that, by default, this will go to your Python file where it will look to see if there is a handler defined for /css/style.css
.app.yaml
and tell it which files or directories you want to be static. Read the docs on Static File and Directory handlers for the details. Basically, you add something like:- url: /css static_dir: css
app.yaml
file.
users
library to provide login and logout capabilities.