Installation
============

The package is listed in the `Python Package Index`_. You can use your
favorite package manager like easy_install or pip::

    pip install django_nomadblog

You can alternatively download the source code for the latest release or
development version here::

    http://bitbucket.org/nabucosound/django-nomadblog/downloads/

.. _Python Package Index: http://pypi.python.org/pypi/django-nomadblog/

Mercurial checkout
------------------

Install Mercurial_ if you don't have it yet, and clone the repository::

    hg clone http://bitbucket.org/nabucosound/django-nomadblog/
    
For the old-school guys, symlink to the folder called ``nomadblog`` inside
``django-nomadblog`` from somewhere in your PYTHONPATH -- could be the
system-wide ``site-packages`` python folder, or the path your Virtualenv_
project is using, if you are using it (which I strongly encourage). And if you
do and are also using Virtualenvwrapper_ then you can easily ``add2virtualenv``.

.. _Mercurial: http://www.selenic.com/mercurial/
.. _Virtualenv: http://pypi.python.org/pypi/virtualenv/
.. _Virtualenvwrapper: http://www.doughellmann.com/projects/virtualenvwrapper/


Configuration
=============

Add ``nomadblog`` to the ``INSTALLED_APPS`` setting of your settings file,
and ``syncdb`` your database if you need to::

	INSTALLED_APPS = (
		...
		'nomadblog',
	)

Include this two lines of code in your root ``urls.py``::

	# Put it somewhere in the beginning of the file
	NOMADBLOG_MULTIPLE_BLOGS = getattr(settings, 'NOMADBLOG_MULTIPLE_BLOGS', False)
	
	# Add this pattern into your url conf
	urlpatterns = patterns('',
		...
	    (r'^blog/', include('nomadblog.urls')) if not NOMADBLOG_MULTIPLE_BLOGS \
            else (r'^blogs/(?P<blog_slug>[-\w]+)/', include('nomadblog.urls')),
	)

You can change the ``blog/`` or ``blogs/`` initial part but do not modify
``(?P<blog_slug>\w+)``, because it is used by the app to differenciate which
blog is being accessed, in case multiblog is used.

Setting multiblog
=================

Define the variable ``NOMADBLOG_MULTIPLE_BLOGS`` in your project settings.py
as ``True`` if you want a Multiple blog configuration::

    NOMADBLOG_MULTIPLE_BLOGS = True

