GitXplorerGitXplorer
m

RateBeers

public
2 stars
1 forks
8 issues

Commits

List of commits on branch master.
Unverified
f17593370b421b5deaad3f816a1cb444b4e981fd

use typography

hhagenburger committed 12 years ago
Unverified
03fe47b111e46166fdfc6b0b157651403f101450

fixed html

hhagenburger committed 12 years ago
Unverified
815ab917ce2bc74dcc8ba44c1ba63c8eab8b0c20

unified html coding style

hhagenburger committed 12 years ago
Unverified
02cab11a979365b5ba42e47c9844283748784798

optimized css: shorter selectors; code style; order; dry

hhagenburger committed 12 years ago
Unverified
36baa875cb2151b195e672df93a49fdefe6e4d05

on macs: works with sudo only

hhagenburger committed 12 years ago
Unverified
5255cd99b1ebb7d12a9b2aced976f5a6d6308cc5

Add a sudo where necessary and also create link that will show up on Github.

mmpdaugherty committed 13 years ago

README

The README file for this repository.
  • RateBeers

RateBeers is a very simple, relatively ugly Django application.

** Use Case Description

Using RateBeers, you can vote for your favorite beers! The homepage shows a list of popular beers, along with their current likes and dislikes.

Clicking ‘Like’ or ‘Dislike’ will register your vote. You can also click on the title of the beer to view only that beer and send the link to your friends.

** Installation

If your system has python 2.7 installed, installation should be very easy:

#+BEGIN_SRC shell git clone cd sudo easy_install pip sudo pip install -r requirements.txt python manage.py syncdb python manage.py runserver #+END_SRC

You can now visit [[http://localhost:8000/][http://localhost:8000/]] to view and rate your beers!

** Code overview

RateBeers is written in Python, using the Django framework. This is a quick overview of how a Django application works:

*** Models

Models define the data and represent the information stored in the database. We have one model, Beer, which is located in ratebeers/beers/models.py.

*** Views

Views are Python functions that perform an action or calculate a result in response to an HTTP request. These are located in ratebeers/beers/views.py. They are mapped to specific URLs via ratebeers/urls.py.

Generally, a view renders a template to generate HTML at the end of the function. When it does that, it passes a “context” dictionary to the template, which provides data that the template can use.

*** Templates

Django templates are just HTML with a little extra syntax. Anything inside of {{ }} is calculated using the context provided by the view and is output into the HTML. Anything inside {% %} is also interpreted specially, but not output directly. {% %} can be used for for…in loops, etc.

*** Static files

Images, CSS, JavaScripts, etc. are all located in ratebeers/beers/static/. If you add an item to the static directory, you can get its URL in a template via {% static path/to/item %}.

** Django & Python Links