First we need to setup Apache and mod_python to serve our blog. Enter the directory where Apache looks for configuration of available sites:
$ cd /etc/apache2/sites-available
Use your favorite editor to create and edit file byteflow:
NameVirtualHost *
<VirtualHost *>
ServerAdmin your_mail@domain
ServerName blog.your_domain
<Location "/">
SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE settings
PythonDebug On
PythonPath "['/home/yourname/devel/byteflow' ] + sys.path"
</Location>
Alias /static/ /home/yourname/devel/byteflow/static/
<Location "/static">
SetHandler None
</Location>
Alias /admin-media/ /home/yourname/devel/django_trunk/django/contrib/admin/media/
<Location "/admin-media">
SetHandler None
</Location>
ErrorLog /var/log/apache2/error.log
LogLevel warn
CustomLog /var/log/apache2/access.log combined
</VirtualHost>
Note that domain name blog.your_domain must point to IP of server where Byteflow installed.
Run following commands to enable created site and reload Apache:
$ sudo a2ensite byteflow
$ sudo /etc/init.d/apache2 reload
Next we must create database for Byteflow.
I will use MySql in this example.
Run mysql command shell
$ mysql -u root -p
Enter password:
End enter command to create database:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1973
Server version: 5.0.45-3 (Debian)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> create database blog_database character set utf8;
Use appropriate mysql utility to create database user and grant him access rights for new database.
So, every dependency is installed and configured and we can setup Byteflow blog engine.
Enter directory where you installed Byteflow:
$ cd ~/devel/byteflow
and copy template settings file to settings_local.py
$ cp settings_local.py.template settings_local.py
Open it with your favorite editor (Remember: text in this file must be in UTF-8 encoding).
$ emacs settings_local.py
Set configuration variables to apropriate values:
DATABASE_ENGINE = 'mysql'
# name of database you created earlier
DATABASE_NAME = 'blog_database'
# name of database user you created earlier
DATABASE_USER = 'database_user_name'
# password of database user
DATABASE_PASSWORD = 'database_user_password'
# Title of your blog
BLOG_NAME = 'Generic Byteflow Blog'
# I suggest to fill it too or else something bad
# happens to default page layout
TAGLINE = 'Everyone will like it'
# email address in From: field
# of outgoing messages
DEFAULT_FROM_EMAIL = 'Generic Byteflow Blog <byteflow@your.dom>'
# I suggest to leave it default for now
THEME = 'default'
# Comment this out. We will discuss it later.
# Sample static pages links
#STATIC_PAGES = (
# ('About', '/about/', 'About me'),
# ('Blog', '/blog/', 'Main place'),
# ('Dev', 'http://byteflow.su/', 'Take a look at the code and development'),
# ('', '', ''),
# ('Alfa Romeo SZ', '/blog/sz/', 'One of the best cars in the world'),
# )
Add next variable:
BLOG_URLCONF_ROOT = '' # we don't want to add /blog/ to our URL
You can leave other variable at their default values.
Save files and close your favorite editor.
Now we must create all needed tables. Run this command from directory where Byteflow installed:
$ ./manage.py syncdb
It will suggest to create admin user. Do as it says.
Congratulations! Basic configuration of Byteflow engine completed. Open URL http://blog.your_domain/ in your favorite browser and see working (albeit empty) blog.
UPDATE (6.02.2008):
We need to change Django Sites setting to avoid problems with links on feeds etc.
Open URL http://blog.your_domain/admin/ in your favorite browser and enter admin account login and password you created after running command manage.py syncdb.
This will open admin interface of your Byteflow. For now we interested in Sites section.
Click on "Change" button in Sites section.
Then click on domain name link and enter your domain in both fields and click on Save button.