Step 5: Start Blogging app

Close your text editor for now, and go back to your Terminal. 

If you still have the site open in Firefox, and opened it with Terminal, just close it.  You don't even need to bookmark it because the next time we look at the site we are going to be running your own server (thanks Django). 

We left off in our template directory and we want to go back to the 'zing' directory to create our application.  Type the following:

vernon@slick:~/project/zing/template$ cd ../

Double dots '..' refers in Linux file system to the parent directory.  You could get back all the way by chaining them together "cd ../../../" Anyway, lets get back to building our blog. 

vernon@slick:~/project/zing$ python manage.py startapp blog
vernon@slick:~/project/zing$ ls
blog  __init__.pyc  settings.py  template
__init__.py  manage.py  settings.pyc  urls.py

If you are familiar with Python, you'll know those .pyc files are just compiled version of the normal .py files in Python.  Each time a file is run for the first time, Python makes you a compiled version (compiled bytecode).  Type:

vernon@slick:~/project/zing$ cat settings.pyc

See, crazy stuff for your computer to read.  You'll get use to it, when you look at your python directories, you'll sort of look only for the .py. 

More importantly, when you ran the 'ls' command, you saw the new 'blog' directory sitting there.  Django was kind enough to write some stuff for you in there already.  Have a look with this command:

vernon@slick:~/project/zing$ ls blog
__init__.py models.py tests.py views.py

There is another '__init__.py file that you know already.  We are not going to touch the test.py file (you can delete if if you like everything neat and clean.  You'll get to know the rest later. 

Please, if you feel a little overwhelmed at this point, don't give up.  If you get stuck, please give me some feedback - you can just send me a tweet at @sandcurves or contact me through the contact page.


Share |
« Previous Page  |  Return To Contents Page  |  Next Page »

 

Thank you for visiting

This is my personal blog, but I try to write things that you may find interesting or useful.  I'm currently working on a six month long project digging into the elements that make a blog meaningful. For more on that, visit MEANINGFUL BLOG PROJECT page

You may want to know a little about me personally, so start at the about page. 

If you find some of what is here interesting, or you want to follow the project through, why not subscribe.

Tweet