Smug is built in the Django framework. If you aren't familiar with Django, I highly recommend that you familiarize yourself with the Django documentation. I'll repeat some of the steps here, but it's really best if you're already familiar with the process.
Smug is a Django app and will need to be installed somewhere on your PYTHONPATH. If you don't know what this means, create a "python" directory in your home directory. This python directory will contain both Smug and your Django project module.
To create a Django project module, go to the python directory and run "django-admin.py startproject mysite", where "mysite" can be replaced by whatever name you wish to call your project (just don't call it "django" or "smug"). This will create a directory with a few configuration files. Edit the basic settings in the settings.py file. The Django documentation contains instructions about modifying this file.
Next, check out Smug. Go to the python directory and run "git clone git://mcnabbs.org/smug.git". This will create a directory called Smug that has all of the Smug source code.
If you're using the Django development server, you must make sure that your PYTHONPATH is set appropriately before proceeding further. Otherwise, Python wouldn't be able to find either "mysite" or "smug".
If you're using the Django development server, just add "export PYTHONPATH=$HOME/python" to your bashrc (and load your changes). You can then cd to "mysite", run "python manage.py runserver", and go to "http://localhost:8000/" in a web browser. Note that the Django documentation has a lot of information about setting this up.
If you're using Apache, you will need to set Python as the handler. you might have something like the following in httpd.conf (and if you want authenticated sessions to go over SSL, as I recommend, it should also go in ssl.conf).
<Location "/you/pick/the/location/">
SetHandler python-program
PythonPath "['/path/to/pythonpath/directory'] + sys.path"
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE mysite.settings
#PythonDebug On
</Location>
In this example, it really is important to have both "mysite" and "smug" in "/path/to/pythonpath/directory". Otherwise, Python won't know where to find these modules.
The Git repository you use for Smug should be a bare repository.
If you are using Apache, you should probably create a system group containing both your username and "apache". To create the repository, you should probably run the following:
mkdir /path/to/repository.git cd /path/to/repository.git git --bare init --shared=group chgrp -R shared_group_name .
where /path/to/repository.git and shared_group_name are replaced by the values you choose. If you don't want a group, then leave off the "--shared=group" option.
Before you actually use the repository in Smug or even clone it with Git, it must have an initial commit. To do this, go into some other repository and do:
git push /path/to/repository.git master
Changes to settings.py:
If you want to use Smug for your whole site, change urls.py in your project to include:
(r'', include('smug.urls'))
If you have some sublocation for it, then the line should look like:
(r'^(?P<basepath>where/smug/goes/)', include('smug.urls'))