blog_my details
Mar 01, 2007

Why oh Why?!

Because the world needs more blog/website engines. We especially need more written in python.

WTF, no database?

No database. All the stuff is stored as flat-files. They look like this:

posts/post_17.xml                <--- post 17
posts/post_17_comments.json      <--- comments for post 17 (comments are stored as json!)
posts/post_19.xml                <--- post 19
posts/post_19_autosave.xml       <--- (post 19 is in the middle of an edit.)

Where is post 18? It's not. The id number is unique across all items, regardless of type. Item 18 might be books/book_18.xml.

The file date is the item's timestamp.

blog_my automatically creates several directories upon startup:

sessions/                <--- session information
files/                   <--- uploaded files go here
posts/                   <--- posts go here, assuming they're enabled (see below)
quotes/                  <--- likewise for quotes
books/                   <--- ditto for books
???/                     <--- and for any other item types you have defined

Item types

In config.py, there's a line that looks like this:

item_types = ['book','post','quote']

If you don't care about books, just remove that item from the list. All the books stuff goes away.

To add a new item type, like "cat", just create a cat.py file (copy post.py and change the fields to appropriate cat fields. Add 'cat' to the item_types list. That's all.

Pages

Pages are a special item type. They act just like the other items, except they don't have id numbers. They have names.

The urls look a little different, like http://www.daltonlp.com/blog_my_details (blog_my_details is the page name). The contents are stored like this:

pages/blog_my_details.xml                <--- page data
pages/blog_my_details_comments.json      <--- page comments
pages/blog_my_details_autosave.xml       <--- if page is being edited

Tags

Tags can't be added to items. Maybe someday.