PyBBM requires the following packages:
- unidecode (for slugifying instances for nicer urls)
By installing PyBBM with
easy_install, all the above dependencies will be installed automatically:
pip install pybbm
The following dependencies are optional. You can install them with
For better perfomance and easy images thumbnailing you can use any thumbnail django application. PyBBM by default uses
sorl.thumbnailif it is installed and included in your
INSTALLED_APPSsetting. It is used for defining the avatar field in the PybbProfile model and for resizing the avatar in the
pybb/avatar.htmltemplate. If you decide to install
sorl.thumbnailwith django 1.7 you have to install at least 11.12.1b version with:
pip install "sorl-thumbnail>=11.12.1b"
PIL(Python Imaging Library) or its more up-to-date fork
Pillowis optional if you configure
sorl.thumbnailto use different backend or don’t use
sorl.thumbnailin general, but remember that using an ImageField in forms requires the Python Imaging Library to be installed (i.e. you should install it if you use the built-in profile).
PyBBM emulates the behavior and functionality of
django-pure-pagination, but we recommend to install it in your project.
markdownlibraries if you use one of the attached to pybbm markup engines. For more information see Markup
If you start a new project based on pybbm, checkout pybbm.org website codebase from https://github.com/hovel/pybbm_org and skip the next steps.
Enable applications and edit settings¶
Add the following apps to your
INSTALLED_APPSto enable pybbm and required applications:
INSTALLED_APPS = ( .... 'pybb', ... )
TEMPLATE_CONTEXT_PROCESSORS = ( ... 'pybb.context_processors.processor', ... )
MIDDLEWARE_CLASSES = ( ... 'pybb.middleware.PybbMiddleware', ... )
Enable PyBBM urlconf¶
include('pybb.urls', namespace='pybb')) into main project
urlpatterns = [ .... (r'^forum/', include('pybb.urls', namespace='pybb')), .... ]
Enable your site profile¶
Setup forum’s profile model and
If you have no site profile, dafault settings will satisfy your needs.
If you have a custom user model, which stores all profile fields itself, or if you have custom site profile model, then check that it inherits from
pybb.profiles.PybbProfile or contains all fields and properties from this class.
None for custom user model, or to related_name
from OneToOne field related to User from custom site profile model.
For more information see how to use custom user model with pybbm
Since django 1.7 release you have several combinations of installed packages that affect database migrations:
django >= 1.7 Django since 1.7 version has it’s own migration engine. Pybbm fully supports django 1.7 migrations, so just run:
python manage.py migrate pybb
We recommend to use database engine that supports transaction management (all django backends except sqlite). Otherwise you have small chance to face some inconsistency in DB after failed post/topic creation.