Source

byteflow / docs / install_virtualenv.txt

Full commit
.. -*- mode: rst -*-
.. _install:

Installation Using Virtualenv & Pip
===================================

Byteflow Dependencies
---------------------

 * Python >=2.4

Your Project's Dependencies
---------------------------

 * Either `MySQLdb <http://mysql-python.sourceforge.net/>`_ or `psycopg2 <http://pypi.python.org/pypi/psycopg2>`_ if you're using mysql or postgresql.
 * `ElementTree <http://effbot.org/zone/element-index.htm>`_, if you are using python < 2.5
 * `Python Imaging Library <http://www.pythonware.com/products/pil/>`_, if you need to use CAPTCHA (reCAPTCHA does not need it)
 * `feedparser <http://www.feedparser.org/>`_, if you want to use friends list


Setup
-----
This tutorial describes installing Byteflow as an app library inside a virtualenv, separate from your Django project. This makes version control, backup, development & deployment much easier.

 * Install pip using your package manager of choice (apt-get, portmaster, easy_install, etc.)

 * Install virtualenv using your package manager of choice (apt-get, portmaster, easy_install, etc.) or pip:

    pip install virtualenv

 * Create a new folder to house your virtualenv & Django blog project (this is to help you get started; your virtualenv & project don't require specific locations):

    mkdir myblog_project && cd myblog_project

 * Create a virtualenv:

    virtualenv --no-site-packages myblog-virtualenv

 * Create a requirements.txt for pip, and add packages to it as needed for your project. For example, here's mine:

    -e hg+http://bitbucket.org/tehfink/byteflow#egg=byteflow
    PIL
    psycopg2

 * Tell pip to use requirements.txt to install the required apps into your virtualenv: 

    pip install -E myblog-virtualenv -r requirements.txt

 * Activate your virtualenv:

    source myblog-virtualenv/bin/activate

 * Create your Django project:

     django-admin.py startproject myblog

 * Add this to the top of myblog/settings.py; this will suck in all the Byteflow defaults:

    from byteflow.settings import *

Then override them for your Django project like so:

    THEME = 'mytheme'

Make sure you remove the settings Django automatically generates for you, such as INSTALLED_APPS, MIDDLEWARE_CLASSES, TEMPLATE_LOADERS, etc., as these will overwrite the Byteflow defaults.

If you want to install apps in addition to the Byteflow defaults, add them like so:

    INSTALLED_APPS += (
        'myapp',
    )

 * Add the following to the top of myblog/urls.py; this will suck in all the Byteflow defaults:
    from byteflow.urls import *

If you want to include urlpatterns in addition to the byteflow defaults, add them like so:

    from django.conf.urls.defaults import patterns
    urlpatterns += patterns(
        ...
    )

 * Put your Byteflow theme in myblog/themes, as normal.

 * Follow the standard Byteflow docs for available settings.