Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/j2labs/listsurf
Simple website implemented in Brubeck
https://github.com/j2labs/listsurf
Last synced: about 2 months ago
JSON representation
Simple website implemented in Brubeck
- Host: GitHub
- URL: https://github.com/j2labs/listsurf
- Owner: j2labs
- Created: 2011-05-31T05:56:45.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2013-08-11T12:42:44.000Z (about 11 years ago)
- Last Synced: 2024-07-19T22:50:22.852Z (2 months ago)
- Language: Python
- Homepage:
- Size: 940 KB
- Stars: 62
- Watchers: 3
- Forks: 11
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# List Surf
This is a simple project designed to demonstrate building websites with [Brubeck](http://brubeck.io).
Assuming you've already installed Brubeck you can turn on listsurf by checking out the repo, turning on MongoDB and typing `./listsurf.py`.
That looks like this.
$ mongod
$ git clone https://github.com/j2labs/listsurf.git
$ cd listsurf
$ ./listsurf.py# The Code
I have attempted to document the code clearly and hope you find it readable.
In `listsurf.py` you will find two main groups of logic: the URL map and Brubeck's config.
The URL map (aka `handler_tuples`) looks like this.
handler_tuples = [
(r'^/login', AccountLoginHandler),
(r'^/logout', AccountLogoutHandler),
(r'^/create', AccountCreateHandler),
(r'^/add_item', ListAddHandler),
(r'^/api', APIListDisplayHandler),
(r'^/$', ListDisplayHandler),
]So we see login/logout urls, a url for creating an account, a url for adding an item, an api url (provides a JSON feed) and finally the main url ('/') is an item list.
The next are of concern is the Brubeck config. The name of the values should speak for themselves so I will just copy the config here.
config = {
'msg_conn': Mongrel2Connection('tcp://127.0.0.1:9999','tcp://127.0.0.1:9998'),
'handler_tuples': handler_tuples,
'template_loader': load_jinja2_env('./templates'),
'db_conn': db_conn,
'login_url': '/login',
'cookie_secret': 'OMGSOOOOOSECRET',
'log_level': logging.DEBUG,
}# Screens
Not a particularly exciting design, but gets the job done. And hey, the design elements are big!
## Login screen
![Login screen](https://raw.github.com/j2labs/listsurf/master/media/screens/login_window.png)
## Create account
![Create account](https://raw.github.com/j2labs/listsurf/master/media/screens/create_account.png)
## List of links
![List of links](https://raw.github.com/j2labs/listsurf/master/media/screens/list_of_links.png)
## Adding a link
![Adding a link](https://raw.github.com/j2labs/listsurf/master/media/screens/adding_link.png)
## Bookmarklet
![Bookmarklet](https://raw.github.com/j2labs/listsurf/master/media/screens/bookmarklet.png)
## JSON API
![JSON API](https://raw.github.com/j2labs/listsurf/master/media/screens/api_output.png)