Code of this site

Code of this site

If you have even been interested in my site source code, it is in public access now. The site itself consist from a few different applications, which can be used on its own:

  • AVKGallery
  • blog
  • PersonalWebSite (this application uses above two)

PersonalWebSite is nothing more then application which provides urls, structure and some custom views - ties Gallery and Blog together. When AVKGallery and blog are separate products which has been made to be used as embedding into your own application, PersonalWebSite is a result of such embedding.

We also use DjHDGutils - a set of common Django code by Halogen D.G.

How to install

The source code of this site is available under Subversion access. To checkout:

svn co http://code.koval.kharkov.ua/svn/repos/PersonalWebSite/trunk some.site.org

When asked for password for svn3.halogen-dg.com enter the following:

  • Username: guest
  • Password: guest

Next, you will need to configure it. Edit the following files and settings within them:

Copy PersonalWebSite/example-settings.py to settings.py

Copy example-local\paths.py to local\paths.py and edit

  • SITE\ROOT

As a next step you create your database. It is optional if you selected SQLite as database backend. For a postgreSQL I first create role (createuser ) and then createdb .

createuser someuser -U postgres
createdb someuserpws

Next step is to create our database structure. Django does this by running:

./manage.py syncdb

Running site & starting customizing it

Django comes in with a handy development server which could be run as:

./manage.py runserver

When server is running it will display the message:

Django version 0.97-pre-SVN-7092, using settings 'PersonalWebSite.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

When you look in your browser, you will see:

No Tag matches the given query.

This is normal, and that means you need to come to http://127.0.0.1:8000/admin/, add a few posts, add a tag named 'homepage' and tag one of you blog posts with this tag. Then, homepage content will appear.

Normally, next step is to change design. I am doing it every year, and it typically takes around 2 hours to change templates HTML code in 'templates' folder. This work is done by going to Open Source Web Design directory and choosing look & feel which you like. All designs are free to use.

Enjoy! And send me your questions and please comment!

Update 2008.06.25:

  • People ask me to list dependencies for this site. In fact, thats not easy to list, because I am running my site on our main servers, where it seems most of things are installed by default. Here is short try to list it:
    • Django itself (starting from 0.96 to latest trunk version)
    • Python (of course!): 2.4 at least
    • PIL (Python Imaging Library)
    • some database of your choice (from a list which Django supports) - MySQL, PostgreSQL, SQLite3.

    Tell me if I've missed anything. Please note, normally all internal utils are pulled by default via svn:externals so normally you should not worry about installing Django dependency applications like DjHDGutils manually.

  • To answer Licensing question: code is under GNU License by default. If this is not good for you, tell me, and I will find an option.

Update 2008.06.29: Some people seems to be puzzled by question how to add photos to gallery. The answer is that it follows absolutely different convention then many galleries. Since I run my site on the same computer where photos are, I see no reason to duplicate gigabytes of my photos. So, you just specify the location of photos and index them. Indexing process is the following: just add photo album and specify folder name in 'folder'. Upon save, it will index your photos to web site.

Comments

Comments powered by Disqus