Pinax documentation — Pinax v0.9a2 documentation
● index● next |Pinax v0.9a2 documentation »
Pinax documentation
Pinax is an open-source platform built on the Django Web Framework.
By integrating numerous reusable Django apps to take care of the things that many sites have in common, it lets you focus on what makes your site different.
● Introduction�❍ Features�❍ History and Background
● Getting started�❍ Prerequisites�❍ Installation�❍ Creating a project�❍ Running a project�❍ Whatʼs next?
● Customization�❍ Choosing a Project�❍ pinax-admin setup_project�❍ Settings You Will (Possibly) Want To Override�❍ base.html versus site_base.html�❍ Changing Avatar/Gravatar defaults�❍ Adding Tabs
● Deployment�❍ Using mod_wsgi�❍ Sending Mail and Notices�❍ Media files
● Media Handling�❍ Basic media handling�❍ Locations of media files
http://pinaxproject.com/docs/dev/index.html (1 of 7) [12/8/10 1:14:50 AM]
Pinax documentation — Pinax v0.9a2 documentation
�❍ build_static management command�❍ resolve_static management command�❍ Serving static files during development
● Groups Overview�❍ Writing your own group aware domain objects�❍ Writing your own group app�❍ Appendix
● Settings�❍ ACCOUNT_OPEN_SIGNUP�❍ BBAUTH_APP_ID�❍ BBAUTH_SHARED_SECRET�❍ BEHIND_PROXY�❍ COMBINED_INBOX_COUNT_SOURCES�❍ EMAIL_CONFIRMATION_DAYS�❍ FEEDUTIL_SUMMARY_LEN�❍ FORCE_LOWERCASE_TAGS�❍ LOGIN_REDIRECT_URLNAME�❍ NOTIFICATION_LANGUAGE_MODULE�❍ PINAX_ITEMS_PER_FEED�❍ PINAX_ROOT�❍ PINAX_THEME�❍ RESTRUCTUREDTEXT_FILTER_SETTINGS�❍ SERVE_MEDIA�❍ STATIC_ROOT�❍ STATIC_URL�❍ STATICFILES_DIRS�❍ STATICFILES_PREPEND_LABEL_APPS�❍ STATICFILES_MEDIA_DIRNAMES�❍ STATICFILES_STORAGE�❍ URCHIN_ID�❍ MARKUP_CHOICES
● Dependencies�❍ Pinax Apps�❍ External Apps�❍ Pinax Apps Within Projects
http://pinaxproject.com/docs/dev/index.html (2 of 7) [12/8/10 1:14:50 AM]
Pinax documentation — Pinax v0.9a2 documentation
�❍ External Libraries● FAQ
�❍ Does Pinax work on Django 1.1?�❍ Does Pinax work on Django 1.2?�❍ How do I change the references to example.com�❍ Why wonʼt my e-mail send?
● Contributing�❍ Getting started�❍ Staying up-to-date�❍ Running the tests�❍ Committing code�❍ Coding style
● Buildout�❍ Intro�❍ Virtualenv (optional)�❍ Building�❍ Running
● Installing PIL● Tab Navigation
�❍ Quick Start�❍ Details
Documentation for Individual Apps
● External Apps�❍ django-email-confirmation�❍ django-timezones
■ How-to Use django-timezones�❍ django-threadedcomments
■ Using django-threadedcomments in Pinax�❍ django-ajax-validation
■ Usage■ Serving Ajax Validation With Your Static Media Server
�❍ django-flags
http://pinaxproject.com/docs/dev/index.html (3 of 7) [12/8/10 1:14:50 AM]
Pinax documentation — Pinax v0.9a2 documentation
�❍ django-pagination■ Installing the latest development version of django-pagination■ Installing via setup.py■ Installing via setuptools■ How to use django-pagination■ A Note About Uploads■ Optional Settings
�❍ django-oembed■ django-oembed■ Installing django-oembed■ Usage
�❍ django-notification■ Usage
�❍ django-mailer■ Usage
�❍ django-dbtemplates■ Database template loader for Django
�❍ django-robots■ Robots exclusion application for Django
�❍ django-announcements■ Usage
�❍ django-messages■ Installing django-messages■ Using django-messages■ Customizing django-messages
● Pinax Apps�❍ pinax.apps.account
■ Getting started■ Reference
�❍ pinax.apps.analytics■ Getting started■ Reference
�❍ pinax.apps.authsub■ Getting started■ Reference
http://pinaxproject.com/docs/dev/index.html (4 of 7) [12/8/10 1:14:50 AM]
Pinax documentation — Pinax v0.9a2 documentation
�❍ pinax.apps.autocomplete_app■ Getting started■ Reference
�❍ pinax.apps.basic_profiles■ Getting started■ Reference
�❍ pinax.apps.bbauth■ Getting started■ Reference
�❍ pinax.apps.blog■ Getting started■ Reference
�❍ pinax.apps.photos■ Getting started■ Reference
�❍ pinax.apps.profiles■ Getting started■ Reference
�❍ pinax.apps.projects■ Getting started■ Reference
�❍ pinax.apps.signup_codes■ Getting started■ Reference
�❍ pinax.apps.tagging_utils■ Getting started■ Reference
�❍ pinax.apps.tasks■ Getting started■ Reference
�❍ pinax.apps.threadedcomments_extras■ Getting started■ Reference
�❍ pinax.apps.topics■ Getting started
http://pinaxproject.com/docs/dev/index.html (5 of 7) [12/8/10 1:14:50 AM]
Pinax documentation — Pinax v0.9a2 documentation
■ Reference�❍ pinax.apps.tribes
■ Getting started■ Reference
�❍ pinax.apps.voting_extras■ Getting started■ Reference
�❍ pinax.apps.waitinglist■ Getting started■ Reference
Release Notes
● current release notes
● Pinax Release Notes�❍ 0.5.1
Table Of Contents
● Pinax documentation�❍ Documentation for Individual Apps�❍ Release Notes
Next topicIntroduction
http://pinaxproject.com/docs/dev/index.html (6 of 7) [12/8/10 1:14:50 AM]
Pinax documentation — Pinax v0.9a2 documentation
This Page● Show Source
● index● next |Pinax v0.9a2 documentation »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/index.html (7 of 7) [12/8/10 1:14:50 AM]
Index — Pinax v0.9a2 documentation
● indexPinax v0.9a2 documentation »
Index
● indexPinax v0.9a2 documentation »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/genindex.html [12/8/10 1:15:04 AM]
Introduction — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »
Introduction
Pinax is an open-source platform built on the Django Web Framework.
By integrating numerous reusable Django apps to take care of the things that many sites have in common, it lets you focus on what makes your site different.
While our initial development was focused around a demo social networking site, Pinax is suitable for a wide variety of websites. We are working on number of editions tailored to intranets, event management, learning management, software project management and more.
Features
At this stage, there is:
● openid support● e-mail verification● password management● site announcements● a notification framework● user-to-user messaging● friend invitation (both internal and external to the site)● a basic twitter clone● oembed support● gravatar support● interest groups (called tribes)● projects with basic task and issue management● threaded discussions● wikis with multiple markup support● blogging● bookmarks● tagging● contact import (from vCard, Google or Yahoo)● photo management
http://pinaxproject.com/docs/dev/intro.html (1 of 2) [12/8/10 1:15:18 AM]
Introduction — Pinax v0.9a2 documentation
and much more coming...
History and Background
You can learn more about the history and motivation for Pinax in an interview with James Tauber on This Week in Django as well as his talk on Pinax at DjangoCon 2008 and talk on Pinax at PyCon 2009.
Table Of Contents
● Introduction�❍ Features�❍ History and Background
Previous topicPinax documentation
Next topicGetting started
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/intro.html (2 of 2) [12/8/10 1:15:18 AM]
Getting started — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »
Getting started
This guide is designed to point you to the best information about getting started with Pinax. Pinax is built on top of Python and Django. We leverage these technologies to their fullest. It is ideal you have some level of experience with these tools before moving on. Here are some good first resources if you need to learn about Python and Django:
● Python: Official Python tutorial● Python: Dive into Python● Django: Official Django tutorial● Django: Official Django documentation
Those resources will be excellent reading material if you are not familiar with Python or Django. The Django tutorial is especially important as many core Pinax concepts are simply ones you find in Django.
Prerequisites
To get started with Pinax you must have the following installed:
● Python 2.4+ — many OSes come with an adequate version of Python. If you are on Windows you will need to install it from python.org. Do not install Python 3+. Pinax is not compatible with Python 3 yet.
● virtualenv 1.4.7+● pysqlite — this is only required if you are running Python 2.4. Later versions of Python have
this bundled.● PIL — this is only required if you are using a project which requires imaging capabilites
(includes projects which support avatars and/or photos). It is likely the best idea to install it anyways.
Installation
Pinax highly encourges the use of virtual environments. We will use a tool called virtualenv which provides a way to create isolated Python environments.
Create yourself a virtual environment and activate it:
http://pinaxproject.com/docs/dev/gettingstarted.html (1 of 4) [12/8/10 1:15:34 AM]
Getting started — Pinax v0.9a2 documentation
$ virtualenv mysite-env$ source mysite-env/bin/activate(mysite-env)$
If you use Windows this will become:
$ virtualenv mysite-env$ mysite-env\Scripts\activate.bat(mysite-env)$
The directory mysite-env is the environment for your project. It is recommended you do not edit or create new files/directories within it. The reason this is important is that this directory should remain reproducible at all times. Reproducible environments is a good idea.
Notice the (mysite-env) bit? This is done for you by the activate script to help you identify which environment is currently activated. Under the hood your PATH has been modified to use the Python binary for this environment.
Go ahead and install Pinax:
(mysite-env)$ pip install Pinax
Note pip install Pinax is a development version
Currently, only our development version is available with pip install. Previous versions of Pinax were not available with pip install.
Keep in mind the development version may not be 100% stable. If you are looking to help out with development you should read our contributing documentation.
pip you say? pip is a tool bundled with virtualenv to install Python packages. It is super handy and it is used in Pinax extensively to handle dependencies. You should become very familiar with this tool.
Pinax is now installed!
Creating a project
Now that Pinax is installed the next step is to create a project. A project is not much more than a Django project. Pinax provides many more defaults for you out of the box.
(mysite-env)$ pinax-admin setup_project mysite
http://pinaxproject.com/docs/dev/gettingstarted.html (2 of 4) [12/8/10 1:15:34 AM]
Getting started — Pinax v0.9a2 documentation
This will create a new project named mysite. By default it will install dependencies for you. You can turn that behavior off by giving setup_project the --no-reqs option.
Pinax comes with many different project bases. The default project based is what we call layer zero. It is simply a Django project with some extra integrated dependencies that will make getting started faster.
Specifying a different project base
To see what Pinax has to offer run:
(mysite-env)$ pinax-admin setup_project -l
This will list all available project bases and a short description about each. To base your project off of any of these youʼd run:
(mysite-env)$ pinax-admin setup_project -b basic mysite
In many cases the default (zero) is enough to get you going, but others may provide a better starting point for your project.
Running a project
At this point you are now working with Django. Pinax has helped you bootstrap your project into life. Inside your project you should run:
(mysite-env)$ python manage.py syncdb(mysite-env)$ python manage.py runserver
syncdb will create a SQLite database named dev.db in your current directory. Weʼve configured your project to do this, but you can change this simply by modifying settings.py where DATABASES dictionary is constructed. You can find more information about this at the get your database running Django documentation.
runserver runs an embedded webserver to test your site with. By default it will run on http://localhost:8000. This is configurable and more information can be found on runserver in Django documentation.
What’s next?
Look at our customization documentation to learn how you might customize your project. If you
http://pinaxproject.com/docs/dev/gettingstarted.html (3 of 4) [12/8/10 1:15:34 AM]
Getting started — Pinax v0.9a2 documentation
are ready to deploy your project check out the deployment documentation.
Table Of Contents
● Getting started�❍ Prerequisites�❍ Installation�❍ Creating a project■ Specifying a different project base�❍ Running a project�❍ Whatʼs next?
Previous topicIntroduction
Next topicCustomization
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/gettingstarted.html (4 of 4) [12/8/10 1:15:34 AM]
Customization — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »
Customization
As more sites are built using Pinax, more best practices will emerge, but for now what we recommend is:
● Always work off a stable release. The most current release is 0.7.1.● Use the pinax-admin setup_project command.● Make necessary changes to the settings.py and urls.py files in your copied directory.● Change the domain and display name of the Site in the admin interface.● Develop your custom apps under your new project or anywhere on Python path.● Develop your own templates under your new project.
Choosing a Project
Pinax provides several projects to use as a starting point for customization. Depending on your development style, you may prefer one project over the other.
basicThis project comes with the bare minimum set of applications and templates to get you started. It includes no extra tabs, only the profile and notices tabs are included by default. From here you can add any extra functionality and applications that you would like.
cms_companyA very simple CMS that lets you set up templates and then edit content, including images, right in the frontend of the site.
The sample media, templates and content including in the project demonstrate a basic company website.
cms_holidayhouseA very simple CMS that lets you set up templates and then edit content, including images, right in the frontend of the site.
The sample media, templates and content including in the project demonstrate a basic site for holiday house rentals.
codeThis project demonstrates group functionality and the tasks, wiki and topics apps. It is intended to
http://pinaxproject.com/docs/dev/customization.html (1 of 5) [12/8/10 1:15:49 AM]
Customization — Pinax v0.9a2 documentation
be the starting point for things like code project management where each code project gets its own wiki, task tracking system and threaded discussions.
intranetThis project demonstrates a closed site requiring an invitation to join and not exposing any information publicly. It provides a top-level task tracking system, wiki and bookmarks. It is intended to be the starting point of sites like intranets.
private_betaThis project demonstrates the use of a waiting list and signup codes for sites in private beta. Otherwise it is the same as basic_project.
sample_groupThis project demonstrates group functionality with a barebones group containing no extra content apps as well as two additional group types, tribes and projects, which show different membership approaches and content apps such as topics, wiki, photos and task management.
socialThis project demonstrates a social networking site. It provides profiles, friends, photos, blogs, tribes, wikis, tweets, bookmarks, swaps, locations and user-to-user messaging.
In 0.5 this was called complete_project.
zeroThis project lays the foundation for all other Pinax starter projects. It provides the project directory layout and some key infrastructure apps on which the other starter projects are based.
pinax-admin setup_project
Pinax provides you with pinax-admin, a command line utility. With pinax-admin you can quickly generate a cloned project. For example, to get started quickly with Pinax you could simply do the following:
(mysite-env)$ pinax-admin setup_project mysite
Or if you want to use the basic project base you could do:
(mysite-env)$ pinax-admin setup_project -b basic mysite
Settings You Will (Possibly) Want To Override
http://pinaxproject.com/docs/dev/customization.html (2 of 5) [12/8/10 1:15:49 AM]
Customization — Pinax v0.9a2 documentation
Pinax-specific:
● PINAX_THEME● CONTACT_EMAIL● URCHIN_ID● BBAUTH_APP_ID● BBAUTH_SHARED_SECRET● SITE_NAME● MAILER_PAUSE_SEND● SERVE_MEDIA● ACCOUNT_OPEN_SIGNUP● ACCOUNT_REQUIRED_EMAIL● ACCOUNT_EMAIL_VERIFICATION● EMAIL_CONFIRMATION_DAYS● LOGIN_REDIRECT_URLNAME
General to Django:
● DEBUG● TEMPLATE_DEBUG● LOGGING_OUTPUT_ENABLED● ADMINS● MANAGERS● DATABASE_ENGINE● DATABASE_NAME● DATABASE_USER● DATABASE_PASSWORD● DATABASE_HOST● TIME_ZONE● SECRET_KEY● DEFAULT_FROM_EMAIL● SERVER_EMAIL● SEND_BROKEN_LINK_EMAILS● EMAIL_HOST● EMAIL_HOST_USER● EMAIL_HOST_PASSWORD● EMAIL_SUBJECT_PREFIX● LOGIN_URL
base.html versus site_base.html
In the sample projects, templates/base.html is intended for overall page structure whereas templates/site_base.html is intended for adding site-specific content that is to be found on all
http://pinaxproject.com/docs/dev/customization.html (3 of 5) [12/8/10 1:15:49 AM]
Customization — Pinax v0.9a2 documentation
pages (things like logo, navigation or footers).
If you are writing a theme to be used across multiple sites, you should modify base.html, not site_base.html. If you want to keep a particular theme but modify content for a specific site, you should modify site_base.html.
Changing Avatar/Gravatar defaults
By default Pinax assigns to users the Gravatar icon and uses the Gravatar icon system. If you want your own personal site avatar default, simply go to the settings.py in your project root and add these two lines of code:
# avatar controlsAVATAR_DEFAULT_URL = MEDIA_URL + '<our_custom_avatar.jpg>'AVATAR_GRAVATAR_BACKUP = False
Adding Tabs
See Tab Navigation
Table Of Contents
● Customization�❍ Choosing a Project�❍ pinax-admin setup_project�❍ Settings You Will (Possibly) Want To Override
http://pinaxproject.com/docs/dev/customization.html (4 of 5) [12/8/10 1:15:49 AM]
Customization — Pinax v0.9a2 documentation
�❍ base.html versus site_base.html�❍ Changing Avatar/Gravatar defaults�❍ Adding Tabs
Previous topicGetting started
Next topicDeployment
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/customization.html (5 of 5) [12/8/10 1:15:49 AM]
Pinax v0.9a2 documentation—Deployment
● index● next |● previous |Pinax v0.9a2 documentation »
Deployment
In short:
● Create a local_settings.py alongside settings.py for your host-specific settings (like database connection, e-mail, etc).
● Configure mod_wsgi.● Set up cron job for mailer and asynchronous notifications.
Using mod_wsgi
If you are using mod_wsgi, which we recommend, you will need to provide a WSGI script. All projects include a deploy/ directory which contains this script named pinax.wsgi. You may modify this file as it best suits you.
Here is a basic configuration for Apache (assuming you are using Python 2.5):
WSGIDaemonProcess mysite-production python-path=/path/to/virtualenvs/pinax-env/lib/python2.5/site-packagesWSGIProcessGroup mysite-production
WSGIScriptAlias / /path/to/project/deploy/pinax.wsgi<Directory /path/to/project/deploy> Order deny,allow Allow from all</Directory>
The above configuration will likely need to be modified before use. Most specifically make sure the python-path option points to the right Python version. We encourage you to read about WSGIDaemonProcess to learn more about what you can configure.
Sending Mail and Notices
http://pinaxproject.com/docs/dev/deployment.html (1 of 4) [12/8/10 1:16:04 AM]
Pinax v0.9a2 documentation—Deployment
Both mail messages and (some) notifications are queued for asynchronous delivery. To actually deliver them you need to run:
python manage.py send_mail
and:
python manage.py emit_notices
on a frequent, regular basis.
Because failed mail will be deferred, you need an additional, less frequent, run of:
python manage.py retry_deferred
We recommend setting up some scripts to run these commands within your virtual environment. You can use the following shell script as the basis for each management command:
#!/bin/sh
WORKON_HOME=/home/user/virtualenvsPROJECT_ROOT=/path/to/project
# activate virtual environment. $WORKON_HOME/pinax-env/bin/activate
cd $PROJECT_ROOTpython manage.py send_mail >> $PROJECT_ROOT/logs/cron_mail.log 2>&1
Letʼs assume the scripts you create from above are stored in $PROJECT_ROOT/cron. You can now setup the cron job similar to:
* * * * * /path/to/project/cron/send_mail.sh* * * * * /path/to/project/cron/emit_notices.sh
0,20,40 * * * * /path/to/project/cron/retry_deferred.sh
This runs send_mail and emit_notices every minute and retry_deferred every 20 minutes.
http://pinaxproject.com/docs/dev/deployment.html (2 of 4) [12/8/10 1:16:04 AM]
Pinax v0.9a2 documentation—Deployment
Media files
Pinax makes it very easy to combine all your applicationsʼ media files into one single location (see Media Handling for details). Serving them more or less comes down again to how you do it with Django itself.
There is an example on how to serve those files with the development server in Serving static files during development.
In a production environment you, too, have to merge those files before you can serve them. Regarding actually serving those files then, see Djangoʼs deployment documentation for details.
Table Of Contents
● Deployment�❍ Using mod_wsgi�❍ Sending Mail and Notices�❍ Media files
Previous topicCustomization
Next topicMedia Handling
This Page
http://pinaxproject.com/docs/dev/deployment.html (3 of 4) [12/8/10 1:16:04 AM]
Pinax v0.9a2 documentation—Deployment
● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/deployment.html (4 of 4) [12/8/10 1:16:04 AM]
Media Handling — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »
Media Handling
This document explains how Pinax handles media files across external and internal applications and themes.
Pinax places static media (css, js, and images such as backgrounds, icons and logos) in a separate directory from the normal Django media directory (uploads and other user generated content stored on the file server). This is done in order to allow for easy server optimization and improved security.
Basic media handling
If you want to override default media files, place yours under <project_name>/media/... with the same path. For example:
Original file:
src/pinax/media/default/pinax/img/logo.png
Your file:
<project_name>/media/pinax/img/logo.png
Locations of media files
If you want to use Pinaxʼ media handling with your own Django apps, please make sure you put the media files like JavaScript, cascading stylesheets (CSS) and images in the following directory structure:
<app_name>/media/<app_name>/(js|img|css)
Doubling your <app_name> is required to prevent name collision of media files while deploying.http://pinaxproject.com/docs/dev/media.html (1 of 4) [12/8/10 1:16:19 AM]
Media Handling — Pinax v0.9a2 documentation
Site specific media files goes to:
<project_name>/media/siteExample.js
The special static file service view should be able to serve the media files in development.
build_static management command
The build_static script collects the media files from Pinax and all the installed apps and arranges them under the <project_name>/site_media/static folder.
The command:
<project_name>/python manage.py build_static
will collect the media files from Pinax and all the apps and places them in the folder defined in the STATIC_ROOT setting.
Please also refer to the help of the build_static management command by running:
<project_name>/python manage.py build_static --help
resolve_static management command
To quickly resolve the absolute path of a media file on the filesystem, you can pass its expected path(s) to the resolve_static management command, e.g.:
$ ./manage resolve_media pinax/css/base.css/Users/Jannis/.virtualenvs/mysite/lib/python2.6/site-packages/Pinax-0.9alpha1-py2.6.egg/pinax/media/default/pinax/css/base.css
If multiple locations are found which match the given path it will list all of them, sorted by its importance.
Serving static files during development
http://pinaxproject.com/docs/dev/media.html (2 of 4) [12/8/10 1:16:19 AM]
Media Handling — Pinax v0.9a2 documentation
The staticfiles app provides the static file serving view to handle the app and theme media as well as other media files found in the MEDIA_ROOT directory. Make sure your projectsʼ urls.py contains the following snippet below the rest of the url configuration:
from django.conf import settingsif settings.SERVE_MEDIA: urlpatterns += patterns("", (r"", include("staticfiles.urls")), )
Table Of Contents
● Media Handling�❍ Basic media handling�❍ Locations of media files�❍ build_static management command�❍ resolve_static management command�❍ Serving static files during development
Previous topicDeployment
Next
http://pinaxproject.com/docs/dev/media.html (3 of 4) [12/8/10 1:16:19 AM]
Media Handling — Pinax v0.9a2 documentation
topicGroups Overview
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/media.html (4 of 4) [12/8/10 1:16:19 AM]
Pinax v0.9a2 documentation—Groups Overview
● index● next |● previous |Pinax v0.9a2 documentation »
Groups Overview
Groups in Pinax are simply container application/models that contain other application/models. For example, if we had something called ʻProjectʼ it might have ʻTasksʼ within it. The Pinax Groups system is designed to make this scenario easy to implement. It allows you to convert an application and model to become a container, henceforce called respectively a Group App and the model is called a ʻGroup Modelʻ. It also allows you to convert an application and associated models to become ʻGroup-Awareʻ, which if done properly makes it capable of working inside a group or as a stand-alone application.
To summarize, Pinax gives you the ability to:
● Create a Group App that can hold another application that is Group-Aware.● Create a Group-Aware application that can either stand-alone or be held inside a Group App.
Pinax comes with a number of built-in applications of both Group Apps and Group-Aware apps detailed in this pageʼs appendix, but its easy enough to create your own.
Writing your own group aware domain objects
First lets make a Task application. Please keep in mind that our example, when complete, can be quicklybrought into any Pinax Group-App, not just projects:
import datetime
from django.db import modelsfrom django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import Userfrom django.contrib.contenttypes import genericfrom django.contrib.contenttypes.models import ContentType
class Task(models.Model): """ We don't use anything Pinax specific in this model. In fact, we
http://pinaxproject.com/docs/dev/groups.html (1 of 10) [12/8/10 1:16:39 AM]
Pinax v0.9a2 documentation—Groups Overview
make a point with the *get_absolute_url* method of making it able to handle being in a group or as a stand-alone Django application. """
# Some sample fields below to show individual distinction of this model title = models.CharField(max_length=140) description = models.TextField(max_length=140) creator = models.ForeignKey(User, verbose_name=_("creator"), related_name="%(class)s_created" ) created = models.DateTimeField(_("created"), default=datetime.datetime.now)
# The following three fields are required for being group aware. # We use a nullable generic foreign key to enable it to be optional # and we don't know what group model it will point to. object_id = models.IntegerField(null=True) content_type = models.ForeignKey(ContentType, null=True) group = generic.GenericForeignKey("content_type", "object_id")
def __unicode__(self): return self.title
def get_absolute_url(self, group=None): kwargs = {"id": self.id} # We check for attachment of a group. This way if the Task object # is not attached to the group the application continues to function. if group: return group.content_bridge.reverse("task_detail", group, kwargs) return reverse("task_detail", kwargs=kwargs)
Forms
We donʼt want to display the special object_id, content_type, and group fields to end clients and users. So we use Django forms to control what is displayed:
from django import formsfrom django.utils.translation import ugettext as _
from pinax.apps.tasks.models import Task
class TaskForm(forms.ModelForm):http://pinaxproject.com/docs/dev/groups.html (2 of 10) [12/8/10 1:16:39 AM]
Pinax v0.9a2 documentation—Groups Overview
""" Our Task form is just like the Task model in that it can work with groups or independantly. """
def __init__(self, user, group=None, *args, **kwargs): self.user = user self.group = group super(TaskForm, self).__init__(*args, **kwargs)
def save(self, commit=True): return super(TaskForm, self).save(commit)
class Meta: model = Task fields = ["title", "description"] # only display 2 fields
def clean(self): self.check_group_membership() return self.cleaned_data
def check_group_membership(self): """ We only let valid group members add new tasks. If the Task is *not* attached to a group then it ignores this step. """ group = self.group if group and not self.group.user_is_member(self.user): raise forms.ValidationError(_("You must be a member to create new Tasks"))
Views
Just like the models and forms, we build our Task views in such a way that they can handle being within or without a group:
from django.core.exceptions import ObjectDoesNotExistfrom django.http import Http404from django.template import RequestContextfrom django.shortcuts import render_to_response
from pinax.apps.tasks.models import Task
http://pinaxproject.com/docs/dev/groups.html (3 of 10) [12/8/10 1:16:39 AM]
Pinax v0.9a2 documentation—Groups Overview
def task_list(request, group_slug=None, bridge=None):
# if a bridge is supplied but does not exist in the database that # means someone is trying to look at a non-existant object. if bridge is not None: try: group = bridge.get_group(group_slug) except ObjectDoesNotExist: raise Http404 else: group = None
# If we are in a group we fetch the Task list of content via a special # utility method. Otherwise we just use a standard ORM call. if group: tasks = group.content_objects(Task) else: tasks = Task.objects.all()
# Is the user a member of the parent group? if not request.user.is_authenticated(): is_member = False else: if group: is_member = group.user_is_member(request.user) else: is_member = True
return render_to_response("tasks/task_list.html", { "group": group, "blogs": blogs, "is_member": is_member, }, context_instance=RequestContext(request))
In many cases you might want to check if the authenticated user has membership in the group. To do this:
if not request.user.is_authenticated(): is_member = Falseelse: is_member = group.user_is_member(request.user)
URLshttp://pinaxproject.com/docs/dev/groups.html (4 of 10) [12/8/10 1:16:39 AM]
Pinax v0.9a2 documentation—Groups Overview
The urls.py file of your app will not need anything special. Most of that is handled by Pinax. However, URL reversal needs to be group aware. We have some helpers to help you work with this easily.
Letʼs say you have the following code in tasks.urls.py:
from django.conf.urls.defaults import *
urlpatterns = patterns("", url(r"^tasks/$", "pinax.apps.tasks.views.task_list", name="task_list"), url(r"^tasks/(?P<slug>[-\w]+)/$", "pinax.apps.tasks.views.blog_detail", name="task_detail"),)
To ensure URLs to task_list are correctly generated you will need to use reverse located on the ContentBridge object:
def some_view_with_redirect(request, bridge=None): ... return HttpResponseRedirect(bridge.reverse("blog_list", group))
The reverse method work almost identical to Djangoʼs reverse. It is essentially a wrapper. To reverse the taskdetail URL:
task = Task.objects.get(pk=1)bridge.reverse("task_detail", group, kwargs={"slug": task.slug})
Note You should be aware that only kwargs work with the bridge reverse. This is significant because URLs with args mapping will fail reversal. The reason behind this is because Django does not allow mixing of args and kwargs when performing URL reversal.
There are some cases when you donʼt have easy access to the ContentBridge. You may only have access to a domain object instance. You can get access to the ContentBridge from the instance. For example:
task = Task.objects.get(pk=1)task.content_bridge.reverse(...)
URL reversal in templates
http://pinaxproject.com/docs/dev/groups.html (5 of 10) [12/8/10 1:16:39 AM]
Pinax v0.9a2 documentation—Groups Overview
In Django you may be familiar with the {% url %} templatetag. This is basically a wrapper around reverse. We provide a similar tag, but works with our ContentBridge.reverse. Here is how you might use it:
{% load group_tags %}
<a href="{% groupurl task_detail group slug=task.slug %}">{{ task.title }}</a>
The {% groupurl %} templatetag will fall back to normal Django URL reversal if the value of the passed in group is None. This enables the ability to work with no group association.
Writing your own group app
We will continue with the Project/Task corollary. Our group application will be a Project (which contain tasks, members, and more):
from django.core.urlresolvers import reversefrom django.contrib.auth.models import Userfrom django.db import modelsfrom django.utils.translation import ugettext_lazy as _
from groups.base import Group
class Project(Group): """ Doesn't inherit the normal *models.Model*. Group comes with a title, description, created, creator and some glue pieces and utility methods built in for convenience. """
members = models.ManyToManyField(User, related_name = "projects", verbose_name=_("members") )
def get_absolute_url(self): return reverse("group_detail", kwargs={ "group_slug": self.slug })
def get_url_kwargs(self): return {"group_slug": self.slug}
http://pinaxproject.com/docs/dev/groups.html (6 of 10) [12/8/10 1:16:39 AM]
Pinax v0.9a2 documentation—Groups Overview
Adding in a a group-aware project
In order for a group-app to be able to display a group-aware application there needs to be a bridge. We take a sample projects.urls.py:
# Standard urlsconf importfrom django.conf.urls.defaults import *
# Create your normal project url viewsurlpatterns = patterns("", url(r"^add_project$", "pinax.apps.projects.views.add", name="project_add"), url(r"^your_projects/$", "pinax.apps.projects.views.your_project", name="your_projects"), url(r"^(?P<slug>[-\w]+)$", "pinax.apps.projects.views.project_detail", name="project_detail"), url(r"^$", "pinax.apps.projects.views.projects", name="project_list"), ...)
So we can render a URL such as /projects/<my-project>.
And then we add in the following code underneath the urlpatterns definition:
# Pinax groups special objectfrom groups.bridge import ContentBridge
# Fetch the group-aware modelfrom pinax.apps.tasks.models import Task
# Create the bridge objectbridge = ContentBridge(Task, "tasks")
# Add in the bridged urlurlpatterns += bridge.include_urls("task.urls", r"^projects/(?P<group_slug>[-\w]+)/tasks")
And that lets us render a URL such as /projects/<my-project>/tasks.
http://pinaxproject.com/docs/dev/groups.html (7 of 10) [12/8/10 1:16:39 AM]
Pinax v0.9a2 documentation—Groups Overview
Appendix
Appendix A - Group Apps provided by Pinax
Pinax comes bundled with two types of group-apps:
● tribes — used in social_project● projects — used in code_project
Appendix B - Group Aware Apps provided by Pinax
Pinax includes several apps that are group aware:
● photos● tasks● topics
Appendix C - Group Apps available on PyPI
● pinax-dances (tutorial application)
Appendix D - Group Aware Apps available on PyPI
● pinax-wall (tutorial application)
Table Of Contents
● Groups Overview�❍ Writing your own group aware domain
http://pinaxproject.com/docs/dev/groups.html (8 of 10) [12/8/10 1:16:39 AM]
Pinax v0.9a2 documentation—Groups Overview
objects■ Forms■ Views■ URLs■ URL reversal in templates�❍ Writing your own group app■ Adding in a a group-aware project�❍ Appendix■ Appendix A - Group Apps provided by Pinax■ Appendix B - Group Aware Apps provided by Pinax■ Appendix C - Group Apps available on PyPI
http://pinaxproject.com/docs/dev/groups.html (9 of 10) [12/8/10 1:16:39 AM]
Pinax v0.9a2 documentation—Groups Overview
■ Appendix D - Group Aware Apps available on PyPI
Previous topicMedia Handling
Next topicSettings
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/groups.html (10 of 10) [12/8/10 1:16:39 AM]
Settings — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »
Settings
Depending on what profile and which apps out of it youʼre using with your Pinax project you have a collection of options for your settings.py at your disposal. This listing only includes those that are supported by the internal applications or are used in the sample project settings (excluding those that are already described by Djangoʼs settings reference. If you want to know the available settings for any of the external apps, please refer to its docoumentation.
ACCOUNT_OPEN_SIGNUP
Applications: pinax.apps.signup_codes
This setting lets you configure whether the site should allow new users to register accounts if they donʼt provide any kind of signup code.
BBAUTH_APP_ID
Applications: pinax.apps.bbauth
This setting is used to allow auth through Yahoo!ʼs Browser-Based Authentication service.
BBAUTH_SHARED_SECRET
Applications: pinax.apps.bbauth
This setting is used to allow auth through Yahoo!ʼs Browser-Based Authentication service.
BEHIND_PROXY
Applications: pinax.apps.blog
If your site is behind a proxy server, set this setting accordingly so that the usersʼ real IP addresses
http://pinaxproject.com/docs/dev/settings.html (1 of 8) [12/8/10 1:16:58 AM]
Settings — Pinax v0.9a2 documentation
are stored when they create blog posts. When activated the blog takes the userʼs IP addresse from request.META['HTTP_X_FORWARDED_FOR'] instead of request.META['REMOTE_ADDR'].
COMBINED_INBOX_COUNT_SOURCES
Applications: pinax.apps.misc
With this setting you can specify a list applications that write to the users inbox in order to get the current inbox count for the current user. In fact you donʼt specify the application but a context processor function which you specify here. If you for example create a project based on the social_project template, the messages, notification and friends_app all provide information that affects the inbox count.
Such a context processor should return a dictionary with one or more entries for the additional inbox count.
EMAIL_CONFIRMATION_DAYS
Applications: emailnotification (external)
This way you can configure the number of days, confirmation email should be valid. For further details please see the documentation of the application itself.
FEEDUTIL_SUMMARY_LEN
Applications: feedutil (external)Default: 150
Number of characters used for summary-attributes in feeds.
FORCE_LOWERCASE_TAGS
Applications: tagging (external)Default: False
If set to True all tags will first be converted to lowercase before they are saved to the database.
http://pinaxproject.com/docs/dev/settings.html (2 of 8) [12/8/10 1:16:58 AM]
Settings — Pinax v0.9a2 documentation
LOGIN_REDIRECT_URLNAME
Applications: pinax.apps.account
This setting is used by pinax.apps.account and allows you to specify the name of a named URL as redirection target. If it is not set, LOGIN_REDIRECT_URL will get used instead.
NOTIFICATION_LANGUAGE_MODULE
Application: notification (external)Default: False
This way you can specify what model holds the language selection of a specific user – e.g. account.Account. The model has to have a foreign key to the the user model (user) and also provide a language field, which is then used by the notification application.
PINAX_ITEMS_PER_FEED
Applications: pinax.apps.blog
Default: 20
With this option the number of posts that should be served in the feeds generated by Pinaxʼ blogging application can be configured.
PINAX_ROOT
Application: staticfiles
Normally you shouldnʼt need to change this setting. Itʼs a reference to where Pinax itself is installed so that you can easily re-use for instance templates from that location or work with the original static files like the build_media command does. There this settng is used to find the media files of those internal applications used in your project, which are then copied into one central location.
For more on this topic take a look at Media Handling.
It is also used by default in project settings for determining a template directory.
http://pinaxproject.com/docs/dev/settings.html (3 of 8) [12/8/10 1:16:58 AM]
Settings — Pinax v0.9a2 documentation
PINAX_THEME
Applications:Default: "default"
With Pinax your site can have multiple themes available. This option now determines, which one of these should be used. In practice the value of PINAX_THEME becomes part of the file-paths the build_media command is looking for when trying to combine all your media files into one single location. A small example:
src/pinax/media/default/pinax/img/logo.png
is a file that is specific to the “default” theme for Pinax while:
src/pinax/media/new_hotness/pinax/img/logo.png
would only be available in the “new_hotness” theme.
This setting is also used for the core templates that are provided with Pinax by default. The default settings.py files provided by Pinax for instance load templates from following locations:
TEMPLATE_DIRS = [ os.path.join(PROJECT_ROOT, "templates"), os.path.join(PINAX_ROOT, "templates", PINAX_THEME),]
Note that this setting only applies to Pinaxʼ core media files and templates and is not used either in the internal nor the external apps by default.
RESTRUCTUREDTEXT_FILTER_SETTINGS
Applications: pinax.apps.blog
Default: {}
Using this option you can pass additional settings as dictionary through the restructuredtext template library to the underlying docutils.core.publish_parts function.
http://pinaxproject.com/docs/dev/settings.html (4 of 8) [12/8/10 1:16:58 AM]
Settings — Pinax v0.9a2 documentation
SERVE_MEDIA
This option is used in the standard projectsʼ URLconf to determine, if django.views.static.serve should be used to serve static files. By default this settings is bound to the DEBUG setting in the default settings.py.
STATIC_ROOT
Default: "<PROJECT_ROOT>/site_media/static"
The absolute path to the directory that holds static files like app media:
STATIC_ROOT = "/home/polls.com/polls/site_media/static/"
This is only used by the default static files storage (i.e. if you use a different STATICFILES_STORAGE_, you donʼt need to set this).
STATIC_URL
Default: "/site_media/static/"
URL that handles the files served from STATIC_ROOT, e.g.:
STATIC_URL = "/site_media/static/"
Note that this should always have a trailing slash.
STATICFILES_DIRS
This setting defines the additional locations the staticfiles app will traverse when looking for media files, e.g. if you use the build_static or resolve_static management command or use the static file serving view.
It should be defined as a sequence of paths to static file directories, e.g.:
STATICFILES_DIRS = [
http://pinaxproject.com/docs/dev/settings.html (5 of 8) [12/8/10 1:16:58 AM]
Settings — Pinax v0.9a2 documentation
os.path.join(PROJECT_ROOT, "media"), os.path.join(PINAX_ROOT, "media", PINAX_THEME),]
In case you specifically want to load media from a certain location you can prefix the path of the media file by using a (prefix, path) tuple instead, e.g.:
STATICFILES_DIRS = [ os.path.join(PROJECT_ROOT, "media"), os.path.join(PINAX_ROOT, "media", PINAX_THEME), ("xmas", "/var/www/xmax-special/media"),]
In your HTML you then would be able to use the following snippet to load the fancy christmas stylesheet:
<link rel="stylesheet" href="{{ STATIC_URL }}xmas/css/base.css" type="text/css" media="screen" />
The directory /var/www/xmax-special would look like this:
media/`-- css `-- base.css
STATICFILES_PREPEND_LABEL_APPS
Default: ["django.contrib.admin"]
A sequence of app paths that have the media files in <app>/media, not in <app>/media/<app>, e.g. django.contrib.admin.
STATICFILES_MEDIA_DIRNAMES
Default: ["media"]
A sequence of directory names to be used when searching for media files in installed apps, e.g. if an app has its media files in <app>/static use:
http://pinaxproject.com/docs/dev/settings.html (6 of 8) [12/8/10 1:16:58 AM]
Settings — Pinax v0.9a2 documentation
STATICFILES_MEDIA_DIRNAMES = [ "media", "static",]
STATICFILES_STORAGE
Default: "staticfiles.storage.StaticFileStorage"
The storage backend to use for copying static files to a single location.
URCHIN_ID
Applications: pinax.apps.analytics
Used by pinax.apps.analytics as part of your account information on Google Analytics. Based on this setting the JavaScript is generated that is then embedded into your website to allow Google Analytics to track your traffic.
Tracking code will not be outputted if DEBUG is True to prevent unnecessary tracking.
MARKUP_CHOICES
Applications: pinax.apps.blog, pinax.apps.tasks
Default: [("restructuredtext", u"reStructuredText"), ("textile", u"Textile"), ("markdown", u"Markdown"), ("creole", u"Creole")]
Table Of Contents
● Settings�❍ ACCOUNT_OPEN_SIGNUP�❍ BBAUTH_APP_ID�❍ BBAUTH_SHARED_SECRET�❍ BEHIND_PROXY�❍ COMBINED_INBOX_COUNT_SOURCES�❍ EMAIL_CONFIRMATION_DAYS
http://pinaxproject.com/docs/dev/settings.html (7 of 8) [12/8/10 1:16:58 AM]
Settings — Pinax v0.9a2 documentation
�❍ FEEDUTIL_SUMMARY_LEN�❍ FORCE_LOWERCASE_TAGS�❍ LOGIN_REDIRECT_URLNAME�❍ NOTIFICATION_LANGUAGE_MODULE�❍ PINAX_ITEMS_PER_FEED�❍ PINAX_ROOT�❍ PINAX_THEME�❍ RESTRUCTUREDTEXT_FILTER_SETTINGS�❍ SERVE_MEDIA�❍ STATIC_ROOT�❍ STATIC_URL�❍ STATICFILES_DIRS�❍ STATICFILES_PREPEND_LABEL_APPS�❍ STATICFILES_MEDIA_DIRNAMES�❍ STATICFILES_STORAGE�❍ URCHIN_ID�❍ MARKUP_CHOICES
Previous topicGroups Overview
Next topicDependencies
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/settings.html (8 of 8) [12/8/10 1:16:58 AM]
Dependencies — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »
Dependencies
This documents what apps use what other apps and what external libs. It is divided into the Pinax core apps and dependent apps that are loaded as part of the install process.
Pinax Apps
These are the apps you will find within the Pinax package.
accountuses apps emailconfirmation, friends, profiles, timezones, microblogging, openid
analyticsno dependencies outside Django
authsubuses library gdata
autocomplete_appuses avatar, basic_profiles, friends, notification, profiles
basic_profilesuses app notification
bbauthuses library ybrowserauth
bloguses apps friends, notification, tagging, threadedcomments and libraries atomformat, creole, docutils
groupsno dependencies outside Django
photosuses apps photologue, projects, tagging, tribes
profilesuses apps account, friends, gravatar, notification, photos, timezones, microblogging
http://pinaxproject.com/docs/dev/dependencies.html (1 of 6) [12/8/10 1:17:12 AM]
Dependencies — Pinax v0.9a2 documentation
projectsuses apps friends, notification, photos, tagging, things, threadedcomments, wiki
signup_codesuses account
tagging_utilsuses tagging
tasksuses attachments, dpaste, notification, tagging, tagging_utils, threadedcomments, and library atomformat
threadedcomments_extrasno dependencies outside Django
topicsuses notification, tagging, threadedcomments
tribesuses apps groups, notification
voting_extrasuses voting
waitinglistno dependencies outside Django
External Apps
These are the external apps that Pinax uses.
biblion
django_ajax_validation
django_announcementsuses app notification and library atomformat
django_atomformat
django_attachments
http://pinaxproject.com/docs/dev/dependencies.html (2 of 6) [12/8/10 1:17:12 AM]
Dependencies — Pinax v0.9a2 documentation
django_avataruses library PIL
django_bookmarksuses apps tagging, voting and library atomformat
django_db_log
django_dbtemplates
django_email_confirmationuses app mailer
django_extensionsuses a wide range of libraries depends on command
django_filters
django_flag
django_friendsuses apps emailconfirmation, mailer, notification and libraries gdata, vobject, ybrowserauth
django_frontendadmin
django_generic_flatblocks
django_gravatar
django_groups
django_locations
django_mailer
django_markup
django_messagesuses app mailer, notification
django_microblogginguses apps account, notification, tribes and libraries atomformat, twitter
http://pinaxproject.com/docs/dev/dependencies.html (3 of 6) [12/8/10 1:17:12 AM]
Dependencies — Pinax v0.9a2 documentation
django_notificationuses app mailer and library atomformat
django_oembed
django_openiduses libraries openid, yadis
django_pagination
django_photologueuses app tagging and library PIL, EXIF
django_robots
django_sorting
django_staticfiles
django_swapsuses apps notification, tagging, threadedcomments
django_tagging
django_tagging_ext
django_threadedcomments
django_timezonesuses library pytz
django_uni_form
django_votinguses library simplejson
django_wakawaka
Pinax Apps Within Projects
http://pinaxproject.com/docs/dev/dependencies.html (4 of 6) [12/8/10 1:17:12 AM]
Dependencies — Pinax v0.9a2 documentation
friends_app (social_project)uses apps account, friends, notification
about
External Libraries
atom
creole
diff_match_patch
docutils
elementtree
gdata
geopy
markdown
pip
pygments
python_openid
python_twitter
python_yadis
pytz
smartypants
sorl
textilehttp://pinaxproject.com/docs/dev/dependencies.html (5 of 6) [12/8/10 1:17:12 AM]
Dependencies — Pinax v0.9a2 documentation
vobject
ybrowserauth
Table Of Contents
● Dependencies�❍ Pinax Apps�❍ External Apps�❍ Pinax Apps Within Projects�❍ External Libraries
Previous topicSettings
Next topicFrequently asked questions
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/dependencies.html (6 of 6) [12/8/10 1:17:12 AM]
Frequently asked questions — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »
Frequently asked questions
Does Pinax work on Django 1.1?
Yes. Pinax 0.7 ships with Django 1.0.4 by default. Django 1.1 came too late in our 0.7 release cycle. However, we tested it on Django 1.1 to ensure it works and it works well. To use Django 1.1 in your Pinax project simply follow our installation documentation and once you are in the virtual environment run:
pip install -U Django==1.1.1
This will install Django 1.1.1 over 1.0.4.
Does Pinax work on Django 1.2?
Yes and no. Our stable release 0.7.X (at 0.7.2) does not support Django 1.2. We will attempt to make 0.7.3 compatible to run on Django 1.2. Installing Django 1.2 over 1.0 that ships with 0.7 will work the same way as seen above. We hope to release 0.7.3 soon. There are no timelines.
On the other hand our development version of Pinax will ship with Django 1.2. Stay tuned for more news regarding the releases of 0.9.
How do I change the references to example.com
example.com is the default value for Site.objects.get(pk=settings.SITE_ID).domain. This comes from the Django contrib app named sites. It is enabled in Pinax by default. Pinax uses this value to construct URLs back to your site in e-mails, for example. There are two ways to change this value. First, you can modify it in the shell (using python manage.py shell):
>>> from django.conf import settings>>> from django.contrib.sites.models import Site>>> site = Site.objects.get(pk=settings.SITE_ID)>>> site.domain = "localhost:8000">>> site.name = "Development site">>> site.save()
Alternatively, you can perform the same action through the admin interface.
http://pinaxproject.com/docs/dev/faq.html (1 of 4) [12/8/10 1:17:36 AM]
Frequently asked questions — Pinax v0.9a2 documentation
Why won’t my e-mail send?
Pinax queues all e-mail for delivery. This is the behavior of django-mailer. All messages are stored in the database. This enables you to view what will be sent via the admin during development.
http://pinaxproject.com/docs/dev/faq.html (2 of 4) [12/8/10 1:17:36 AM]
Frequently asked questions — Pinax v0.9a2 documentation
To send the messages that are queued you should use the send_mail management command. To invoke this you would run:
python manage.py send_mail
Be sure you have set the appropriate EMAIL_* settings. A full list of these settings can be found in Django settings documentation. Our deployment documentation gives instructions on how to set this up on a cron.
Also, some e-mail may occur as a result of notifications. Some notifications are queued. Be sure you run:
python manage.py emit_notices
to clear the notification queue and get those e-mails queued.
Table Of Contents
● Frequently asked questions�❍ Does Pinax work
http://pinaxproject.com/docs/dev/faq.html (3 of 4) [12/8/10 1:17:36 AM]
Frequently asked questions — Pinax v0.9a2 documentation
on Django 1.1?�❍ Does Pinax work on Django 1.2?�❍ How do I change the references to example.com�❍ Why wonʼt my e-mail send?
Previous topicDependencies
Next topicContributing to Pinax
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/faq.html (4 of 4) [12/8/10 1:17:36 AM]
Contributing to Pinax — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »
Contributing to Pinax
We are always looking for people wanting to improve Pinax itself. This document outlines the necessary bits to begin contributing to Pinax.
Getting started
The Pinax source code is hosted on GitHub. This means you must have git installed locally. We recommend you create an account on GitHub allowing you to watch and fork the Pinax source code.
You will want to be sure that your git configuration is set for making commits to a repository. Check the following:
git config user.namegit config user.email
If the output of any of the two commands above are not entirely correct you can easily correct them:
git config --global user.name "First Last"git config --global user.email "[email protected]"
It is critical you set this information up correctly. It helps us identify who you are when you start giving us those awesome patches.
Grabbing the source code
Once you have forked the Pinax source code you can now make a clone of it to your local disk. To do this:
git clone [email protected]:<username>/pinax.git
This will create new directory named pinax which now contains the Pinax source tree ready for you to get started.
Setting up your environment
http://pinaxproject.com/docs/dev/contributing.html (1 of 7) [12/8/10 1:17:53 AM]
Contributing to Pinax — Pinax v0.9a2 documentation
Now that youʼve cloned the source code you are ready to get your environment setup to work on Pinax. You should be a running a recent release of virtualenv to setup Pinax. Weʼll assume that your current working directory is from within the clone (the pinax directory):
virtualenv ../pinax-devsource ../pinax-dev/bin/activatepip install -e .
Finally, you need to install the dependencies for the development version:
pip install --no-deps --requirement requirements/development.txt
In order to run the test suite, youʼll also need PIL installed:
pip install PIL
Staying up-to-date
The development version of Pinax is always being updated. Youʼll want to make sure you keep up. Your clone of Pinax can easily stay in-sync using git. You will need to setup a git remote to pull in changes from upstream Pinax:
git remote add upstream git://github.com/pinax/pinax.git
Now you will be able to merge in changes that are made upstream:
git fetch upstreamgit merge upstream/master
The above will pull in all changes upstream and merge them with your current branch. This can be simplified:
git pull upstream master
To keep your virtual environment in-sync you will need to use pip (make sure you are inside your virtual environment):
pip install --no-deps --requirement requirements/external_apps.txt
Running the testshttp://pinaxproject.com/docs/dev/contributing.html (2 of 7) [12/8/10 1:17:53 AM]
Contributing to Pinax — Pinax v0.9a2 documentation
Before you begin committing code youʼll want to make sure the Pinax test suite passes. Running the test suite is simple. At the root of your Pinax clone run:
python tests/runner.py
You must be inside the development virtual environment for this to work. If you only want to run a subset of tests (all tests are inside apps) you can specify them explicitly:
python tests/runner.py tasks projects
This useful while developing. However, be sure to run the full suite before committing any code to ensure it doesnʼt break other parts of Pinax.
Note The test runner is new as of November 29, 2009. There are currently many failing tests. We are working on it. This message will be removed when the test suite is generally usable for contributors.
Committing code
The great thing about using a distributed versioning control system like git is that everyone becomes a committer. When other people write good patches it makes it very easy to include their fixes/features and give them proper credit for the work.
We recommend that you do all your work on Pinax in a separate branch. When you are ready to work on a bug or a new feature create yourself a new branch. The reason why this is important is you can commit as often you like. When you are ready you can merge in the change. Letʼs take a look at a common workflow:
git checkout -b task-566... fix and git commit often ...git push origin task-566
The reason we have created two new branches is to stay off of master. Keeping master clean of only upstream changes makes yours and ours lives easier. You can then send us a pull request for the fix/feature. Then we can easily review it and merge it when ready.
Writing commit messages
Writing a good commit message makes it simple for us to identify what your commit does from a high-level. We are not too picky, but there are some basic guidelines weʼd like to ask you to follow.
http://pinaxproject.com/docs/dev/contributing.html (3 of 7) [12/8/10 1:17:53 AM]
Contributing to Pinax — Pinax v0.9a2 documentation
Fixed #1 — added some feature
We ask that you indicate which task you have fixed (if the commit fixes it) or if you are working something complex you may want or be asked to only commits parts:
Refs #1 — added part one of feature X
As said earlier we are not too picky (some core developers may change commit messages before pulling in your changes), but as you get the basics down you make the process of getting your patch into core faster.
Another critical part is that you keep the first line as short and sweet as possible. This line is important because when git shows commits and it has limited space or a different formatting option is used the first line becomes all someone might see. If you need to explain why you made this change or explain something in detail use this format:
Fixed #13 — added time travel
You need to be driving 88 miles per hour to generate 1.21 gigawatts ofpower to properly use this feature.
Coding style
When writing code to be included in Pinax keep our style in mind:
● Follow PEP8 — there are some cases where we do not follow PEP8. It is an excellent starting point.● Follow Djangoʼs coding style — weʼre pretty much in agreement on Django style outlined there.
We would like to enforce a few more strict guides not outlined by PEP8 or Djangoʼs coding style:
● PEP8 tries to keep line length at 80 characters. We follow it when we can, but not when it makes a line harder to read. It is okay to go a little bit over 80 characters if not breaking the line improves readability.
● Use double quotes not single quotes. Single quotes are allowed in cases where a double quote is needed in the string. This makes the code read cleaner in those cases.
● Blank lines are indented to the appropriate level for the block they are in.● Docstrings always use three double quotes on a line of their own, so, for example, a single line
docstring should take up three lines not one.● Imports are grouped specifically and ordered alphabetically. This is shown in the example below.● Always use reverse and never @models.permalink.● Tuples should be reserved for positional data structures and not used where a list is more appropriate.● URL patterns should use the url() function rather than a tuple.
http://pinaxproject.com/docs/dev/contributing.html (4 of 7) [12/8/10 1:17:53 AM]
Contributing to Pinax — Pinax v0.9a2 documentation
Here is an example of these rules applied:
# first set of imports are stdlib imports# non-from imports go first then from style import in their own groupimport csv
from datetime import datetime
# second set of imports are Django imports with contrib in their own# group.from django.core.urlresolvers import reversefrom django.db import modelsfrom django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
# third set of imports are Pinax importsfrom pinax.utils.examplelib import function_name
# forth set of imports are external apps (if applicable)from tagging.fields import TagField
# fifth set of imports are local appsfrom pinax.apps.tasks.fields import MarkupField
class Task(models.Model): """ A model for storing a task. """
creator = models.ForeignKey(User) created = models.DateTimeField(default=datetime.now) modified = models.DateTimeField(default=datetime.now)
objects = models.Manager()
class Meta: verbose_name = _("task") verbose_name_plural = _("tasks")
def __unicode__(self): return self.summary
def save(self, **kwargs): self.modified = datetime.now() super(Task, self).save(**kwargs)
def get_absolute_url(self):
http://pinaxproject.com/docs/dev/contributing.html (5 of 7) [12/8/10 1:17:53 AM]
Contributing to Pinax — Pinax v0.9a2 documentation
return reverse("task_detail", kwargs={"task_id": self.pk})
# custom methods
class TaskComment(models.Model): # ... you get the point ... pass
Table Of Contents
● Contributing to Pinax�❍ Getting started■ Grabbing the source code■ Setting up your environment�❍ Staying up-to-date�❍ Running the tests�❍ Committing code■ Writing commit messages�❍ Coding style
Previous topicFrequently asked
http://pinaxproject.com/docs/dev/contributing.html (6 of 7) [12/8/10 1:17:53 AM]
Contributing to Pinax — Pinax v0.9a2 documentation
questions
Next topicBuildout
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/contributing.html (7 of 7) [12/8/10 1:17:53 AM]
Buildout — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »
Buildout
Intro
The de facto Pinax build process has a couple manual steps but the bulk of the work is done by the pinax-boot.py script. The 0.7 series introduced the use of pip which installs python parts into the site-packages directory, presuming a virtualenv to avoid polluting the system python.
Many folks like using zc.buildout, a generic tool frequently used to build projects, especially when there are a number of components involved. It came from the Zope world and is heavily used by the Plone community for building sites. Rather than installing libraries into site-packages, interpreters and running systems have their sys.path set to include all the eggs and libraries and parts as required by the buildout definitions.
The Django community has typically not been big on using buildout, but recently Jacob Kaplan-Moss has written a couple enthusiastic tutorials on how to use it.
Pinax has many many components so it seems a natural candidate for buildout.
Virtualenv (optional)
In the bad old days developers installed libraries into the system Pythonʼs site-packages; your operating system packager may have done the same thing for their own needs. This of course leads to problems akin to “DLL Hell”, with different applications needing different libraries or versions.
Virtualenv creates a private copy of your python with its own site-packages directory so you can install as a normal user and each project can have itʼs own set of libraries.
I tend to install a very minimal set of critical tools into my system python: setuptools and virtualenv. All my applicationʼs libraries are installed into the running codeʼs sys.path by buildout, so I donʼt end up with conflicts.
http://pinaxproject.com/docs/dev/buildout.html (1 of 5) [12/8/10 1:18:08 AM]
Buildout — Pinax v0.9a2 documentation
If, however, you do keep a bunch of libraries in your system site-packages, they will be visible to an application you create with buildout – buildout doesnʼt isolate you from site-packages [why not?]. Itʼs safest to create a virtual environment:
virtualenv --no-site-packages .
The dot indicates to create the virtualenv in this current directory, where our Pinax build will be done. Then activate it:
source bin/activate
Now when you say “python” it should get your private python.
Building
Before you can start to bootstrap the buildout you need to get the necessary files by cloning the Git repository pinax-buildout:
$ git clone git://github.com/pinax/pinax-buildout.git
Since itʼs a good idea to create a new buildout for each Pinax based project donʼt hesitate to rename the pinax-buildout directory to your liking.
Bootstrap
If you created and activated a virtual python, or want to use the system one thatʼs on your PATH, bootstrap the buildout:
$ python bootstrap.py
If you create a private python or need to use a specific one (e.g., a non-default python version) do something like:
$ /path/to/specific/python bootstrap.py
http://pinaxproject.com/docs/dev/buildout.html (2 of 5) [12/8/10 1:18:08 AM]
Buildout — Pinax v0.9a2 documentation
This creates the bin/buildout command used next:
Creating directory '/path/to/pinax-buildout/bin'.Creating directory '/path/to/pinax-buildout/parts'.Creating directory '/path/to/pinax-buildout/eggs'.Creating directory '/path/to/pinax-buildout/develop-eggs'.Generated script '/path/to/pinax-buildout/bin/buildout'.
You should only need to do this once, before you run your buildout.
Buildout
Now you can run the buildout. It uses the configuration buildout.cfg file to drive the build. You can create layered buildout config files, like for the project base then variants for development and deployment, but weʼll only worry about a single configuration here.
The buildout.cfg file specifies various parts and dependencies. Run the buildout with a bit of verbosity like:
$ bin/buildout -v
Installing 'zc.buildout', 'setuptools'....Generated script '/path/to/pinax-buildout/bin/ipython'.Generated script '/path/to/pinax-buildout/bin/pinax-admin'.Generated script '/path/to/pinax-buildout/bin/django-admin'.
Since our buildout.cfg specifies a lot of pieces needed by Pinax, this can take a little time the first time its run. Subsequent times should take less time.
Iʼve specified parts in the buildout to build pieces that can be a bit troublesome, specifically PIL and the zlib that it depends on.
When finished, the buildout creates a bin/django-admin command thatʼs analogous to Djangoʼs django-admin.py. It also creates a bin/pinax-admin script to call clone_project for example.
You will need to re-rerun this if you modify the buildout.cfg – perhaps to add other components your application needs.
http://pinaxproject.com/docs/dev/buildout.html (3 of 5) [12/8/10 1:18:08 AM]
Buildout — Pinax v0.9a2 documentation
Running
After your buildout completes, you can use the bin/django-admin commands as to initialize your database and run your site.
Syncdb
At this point you should have the bin/pinax command and be able to create your database from the Pinax models:
$ bin/django-admin syncdb
Runserver
Then you can run your application:
$ bin/django-admin runserver
Python Interpreter
The buildout also creates a python interpreter that has all the eggs and libraries configured into it, which you can run like:
$ bin/python
Table Of Contents
● Buildout�❍ Intro�❍ Virtualenv (optional)
http://pinaxproject.com/docs/dev/buildout.html (4 of 5) [12/8/10 1:18:08 AM]
Buildout — Pinax v0.9a2 documentation
�❍ Building■ Bootstrap■ Buildout�❍ Running■ Syncdb■ Runserver■ Python Interpreter
Previous topicContributing to Pinax
Next topicInstalling PIL
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/buildout.html (5 of 5) [12/8/10 1:18:08 AM]
Installing PIL — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »
Installing PIL
To be able to run the social_project or any photo support provided with Pinax you will need the Python Imaging Library (aka PIL). We donʼt install this for you because its installation will vary and requires compilation. First, check with your OS package manager (if applicable) to see if it can provide PIL for you. Windows users can simply use the binaries provided on the PIL website.
This command has worked for some users; it installs a tweaked version:
(pinax-env)$ pip install PIL
Of course youʼll need a C compiler libjpeg and libz libraries upon which PIL depends.
Note PIL will install without libjpeg and libz. It simply wonʼt support JPEGs or PNGs.
Previous topicBuildout
Next topicTab Navigation
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »
http://pinaxproject.com/docs/dev/pil.html (1 of 2) [12/8/10 1:18:22 AM]
Installing PIL — Pinax v0.9a2 documentation
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/pil.html (2 of 2) [12/8/10 1:18:22 AM]
Tab Navigation — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »
Tab Navigation
You can completely control the look and feel of your Pinax-based site via the templates, so if you donʼt like the way the tabs are done, you can always do it a completely different way.
But this is how tab navigation is done in most of the sample projects.
Quick Start
Here is how to add a new tab for your app myapp:
1. In site_base.html add a new li in the right_tabs block. Make sure that li has and id specific to that to that tab, e.g. tab_myapp
2. Create a myapps/base.html template that all pages under that tab will extend. Make sure it defines a block body_class with content myapp
3. edit the CSS file (site_tabs.css if it exists) and at the appropriate points add the selectors:�❍ body.myapp #tab_myapp�❍ body.myapp #tab_myapp a
Details
The global base.html (under pinax/templates/default/) has the following:
...<body class="{% block body_class %}{% endblock %}">
...<div id="tabhead"> ... <div id="left_tabs" >{% block left_tabs %}{% endblock %}</div> <div id="right_tabs" >{% block right_tabs %}{% endblock %}</div></div><div id="subnav" class="clearfix">{% block subnav_base %}{% block subnav %} {% endblock %}{% endblock %}</div>
Note that this defines five blocks:
● body_class
http://pinaxproject.com/docs/dev/tabs.html (1 of 4) [12/8/10 1:18:37 AM]
Tab Navigation — Pinax v0.9a2 documentation
● left_tabs● right_tabs● subnav
You shouldnʼt normally need to change this at all for your site unless you want to make a change like move where the subnav goes.
site_base.html in your projectʼs templates then overrides the left_tabs and or right_tabs blocks with the actual site-wide tabs. For example, here is a right_tabs with three tabs defined that only show when the user is logged in:
{% block right_tabs %} {% if user.is_authenticated %} <ul class="tabs">{% spaceless %} <li id="tab_profile"><a href="{% url profile_detail user.username %}">Profile</a></li> <li id="tab_blogs"><a href="{% url blog_list_user %}">Blogs</a></li> <li id="tab_bookmarks"><a href="{% url all_bookmarks %}">Bookmarks</a></li> {% endspaceless %}</ul> {% endif %}{% endblock %}
Note that each li is given an id specific to the tab, e.g. tab_bookmarks for the bookmarks tab.
Now, any page under the bookmarks tab extends the template bookmarks/base.html which looks something like this:
{% extends "site_base.html" %}
{% block body_class %}bookmarks{% endblock %}
{% block subnav %} <ul> <li><a href="{% url add_bookmark %}">Add Bookmark</a></li> <li><a href="{% url your_bookmarks %}">Your Bookmarks</a></li> <li><a href="{% url all_bookmarks %}">All Bookmarks</a></li> </ul>{% endblock %}
Notice that this bookmarks-specific base template defines the subnav block which provides the subnav for all bookmarks pages.
It also defines the body_class block we saw used by the global base.html.
Now all that remains is the CSS that ties the body in base.html with class="bookmarks” to the li http://pinaxproject.com/docs/dev/tabs.html (2 of 4) [12/8/10 1:18:37 AM]
Tab Navigation — Pinax v0.9a2 documentation
in site_base.html that has id="tab_bookmarks".
This is done in CSS.
/* SITE-SPECIFIC TAB STYLING */
body.profile #tab_profile a,body.blogs #tab_blogs a,body.bookmarks #tab_bookmarks a{ color: #000; /* selected tab text colour */}body.profile #tab_profile,body.blogs #tab_blogs,body.bookmarks #tab_bookmarks{ margin: 0; /* to compensate for border */ padding: 5px 0 5px; background-color: #DEF; /* selected tab colour */ border-left: 1px solid #000; /* tab border */ border-top: 1px solid #000; /* tab border */ border-right: 1px solid #000; /* tab border */}
Notice that the selector body.bookmarks #tab_bookmarks appears twice.
Table Of Contents
● Tab Navigation�❍ Quick Start�❍ Details
Previous topicInstalling PIL
Next topicExternal
http://pinaxproject.com/docs/dev/tabs.html (3 of 4) [12/8/10 1:18:37 AM]
Tab Navigation — Pinax v0.9a2 documentation
Apps
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/tabs.html (4 of 4) [12/8/10 1:18:37 AM]
External Apps — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »
External Apps
The majority of functionality in Pinax is provided by external, reusable Django apps.
● django-email-confirmation● django-timezones● django-threadedcomments● django-ajax-validation● django-flags● django-pagination● django-oembed● django-notification● django-mailer● django-dbtemplates● django-robots● django-announcements● django-messages
Previous topicTab Navigation
Next topicdjango-email-confirmation
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/external_apps.html [12/8/10 1:18:51 AM]
django-email-confirmation — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »
django-email-confirmation
This simple app is for cases where you donʼt want to require an email address to signup on your website but you do still want to ask for an email address and be able to confirm it for use in optional parts of your website.
A user can have zero or more email addresses linked to them. The user does not have to provide an email address on signup but, if they do, they are emailed with a link they must click on to confirm that the email address is theirs. A confirmation email can be resent at any time.
Whatʼs on the trunk here should be usable but I welcome feedback on how to make it better. The source contains a working project that shows all the features of the app as well as providing useful code for your own project (although Pinax is a more comprehensive example of how to use django-email-confirmation).
This code is based in part on django-registration and is essentially a replacement for it where your requirements are different.
http://pinaxproject.com/docs/dev/external/emailconfirmation/index.html (1 of 2) [12/8/10 1:19:05 AM]
django-email-confirmation — Pinax v0.9a2 documentation
Previous topicExternal Apps
Next topicdjango-timezones
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/external/emailconfirmation/index.html (2 of 2) [12/8/10 1:19:05 AM]
django-timezones — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »
django-timezones
This simple app is for localizing datetimes for the user. Timezone handling can be a bit tricky so the goal is to get rid of the guessing game and provide a simple interface to localizing datetimes for your users.
Contents:
● How-to Use django-timezones
Previous topicdjango-email-confirmation
Next topicHow-to Use django-timezones
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/external/timezones/index.html (1 of 2) [12/8/10 1:19:18 AM]
django-timezones — Pinax v0.9a2 documentation
http://pinaxproject.com/docs/dev/external/timezones/index.html (2 of 2) [12/8/10 1:19:18 AM]
How-to Use django-timezones — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »django-timezones »
How-to Use django-timezones
To get started using django-timezones make sure you have placed it on the PYTHONPATH somehow and that you have pytz installed.
Previous topicdjango-timezones
Next topicdjango-threadedcomments
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »django-timezones »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/external/timezones/how_to_use.html [12/8/10 1:19:32 AM]
Pinax v0.9a2 documentation—django-threadedcomments
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »
django-threadedcomments
Django-threadedcomments is a simple yet flexible threaded commenting system for Django. What it means to say that they are threaded is that commenters can reply not only to the original item, but to other comments as well. It becomes near-trivial to create a system similar to what Reddit or Digg have in their comments sections.
Contents:
● Using django-threadedcomments in Pinax
Previous topicHow-to Use django-timezones
Next topicUsing django-threadedcomments in Pinax
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »
http://pinaxproject.com/docs/dev/external/threadedcomments/index.html (1 of 2) [12/8/10 1:19:46 AM]
Pinax v0.9a2 documentation—django-threadedcomments
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/external/threadedcomments/index.html (2 of 2) [12/8/10 1:19:46 AM]
Using django-threadedcomments in Pinax — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »django-threadedcomments »
Using django-threadedcomments in Pinax
While itʼs perfectly feasible to use the standard threadedcomments templatetags and views, if youʼre using django-threadedcomments from within Pinax, itʼs even easier. Weʼve built a small abstraction on top of threadedcomments to build a standard comment form that integrates with the existing CSS and template layout.
To use this abstraction layer, in your templates, first make sure to load our abstraction layer:
{% load comments_tag %}
Then determine the object on which you would like to comment. In our example, it will be a context variable called post. Now, just include this tag:
{% comments post %}
And thatʼs it! Behind the scenes, the threadedcomments/comments.html template is being loaded and rendered with the following context variables:
object:The object on which to comment.
request:Djangoʼs standard request object.
user:The currently logged-in userʼs User instance.
http://pinaxproject.com/docs/dev/external/threadedcomments/pinax.html (1 of 2) [12/8/10 1:20:00 AM]
Using django-threadedcomments in Pinax — Pinax v0.9a2 documentation
Previous topicdjango-threadedcomments
Next topicdjango-ajax-validation
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »django-threadedcomments »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/external/threadedcomments/pinax.html (2 of 2) [12/8/10 1:20:00 AM]
django-ajax-validation — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »
django-ajax-validation
This is a fairly simple application for performing ajax validation of forms created using Djangoʼs forms system. Currently it only works with jQuery.
Contents:
● Usage● Serving Ajax Validation With Your Static Media Server
Previous topicUsing django-threadedcomments in Pinax
Next topicUsage
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/external/ajax-validation/index.html [12/8/10 1:20:14 AM]
Usage — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »django-ajax-validation »
Usage
To use, Ajax Validation requires only that you add a URL(one per form), and some javascript to any page with the form.
For example, if you had the following form:
from django import forms
class ContactForm(forms.Form): name = forms.CharField(label='Your Name') email = forms.EmailField(label='Your Email') message = forms.CharField(label='Your Message', widget=forms.Textarea)
You would need to add the following url to your urls.py(you also need to import the form class):
(r'^SOME/URL/$', 'ajax_validation.views.validate', {'form_class': ContactForm}, 'contact_form_validate')
The URL can take any arguments(named, or unamed), and you can also provide a callback function, this function is given request, *args, and **kwargs and should return a dictionary which is passed to the form constructor.
And then in the template in which you are displaying the form, you should add:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script>{% load jquery_validation %}{% include_validation %}<script type="text/javascript"> $(function() { $('#form').validate('{% url contact_form_validate %}', {type: 'ul', fields: ['email'], dom: $('#id_email'), event: 'keyup'}); $('#form').validate('{% url contact_form_validate %}', {type: 'ul'}); });
http://pinaxproject.com/docs/dev/external/ajax-validation/usage.html (1 of 3) [12/8/10 1:20:30 AM]
Usage — Pinax v0.9a2 documentation
</script>
As you can see, you need to have jQuery for this to work(here it is being loaded from google). In the javascript you use jQueryʼs selectors to select where the form is, and the validate method takes 5 parameters, all optional, first is the URL of the validation, here we reverse the URL we set up earlier. The second parameter is a dictionary, it is optional and should either provide type(ul, table, or p), this is the type of renderer you used for djangoʼs forms(form.as_p, etc.), the default is table if nothing is provided. It can also take a callback option which is a function that recieves data, which is the JSON representation of any errors, and form, which is the jquery object that you provided. Finally, it takes fields, which is a list of the fields that should be validated, it will not display errors that arenʼt in that list of fields. The last 2 options are dom and event, these allow you to choose when the validation will occur, dom should be a jQuery object(i.e.: $(ʻ#my_fieldʼ)), and event should be a jQuery event(listed here).
In addition you can provide a callable option, submitHandler. This recieves the form DOM object and can do whatever it pleases. If it returns true the form will be submitted, else it wonʼt.
Previous topicdjango-ajax-validation
Next topicServing Ajax Validation With Your Static Media Server
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »django-ajax-validation »http://pinaxproject.com/docs/dev/external/ajax-validation/usage.html (2 of 3) [12/8/10 1:20:30 AM]
Usage — Pinax v0.9a2 documentation
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/external/ajax-validation/usage.html (3 of 3) [12/8/10 1:20:30 AM]
Serving Ajax Validation With Your Static Media Server — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »django-ajax-validation »
Serving Ajax Validation With Your Static Media Server
By default, if you use the template tag included with Ajax Validation, the script will be placed inside HTML <script> tags and served up this way. This is usually fine for development, however for production it is reccomended you serve Ajax Validation with your seperate static media server.
To do this you should copy the jquery-ajax-validation.js file from ajax_validation/media/ajax_validation/js/ and put it somewhere in the directory structure where the rest of your siteʼs static media is. You should then replace all instances of {% include_validation %} with:
<script type="text/javascript" src="PATH_TO_FILE_HERE"></script>
where PATH_TO_FILE_HERE is the location your media server is serving the file from.
Previous topicUsage
Next topicdjango-flags
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »django-ajax-validation »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/external/ajax-validation/serving-ajax-validation-media-server.html [12/8/10 1:20:44 AM]
django-flags — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »
django-flags
This app lets users of your site flag content as inappropriate or spam.
(more here soon)
Previous topicServing Ajax Validation With Your Static Media Server
Next topicdjango-pagination
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/external/flag/index.html [12/8/10 1:20:58 AM]
django-pagination — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »
django-pagination
Django-pagination is a set of utilities for creating robust pagination tools throughout a django application.
Contents:
● Installing the latest development version of django-pagination● Installing via setup.py● Installing via setuptools● How to use django-pagination● A Note About Uploads● Optional Settings
http://pinaxproject.com/docs/dev/external/pagination/index.html (1 of 2) [12/8/10 1:21:12 AM]
django-pagination — Pinax v0.9a2 documentation
Previous topicdjango-flags
Next topicInstalling the latest development version of django-pagination
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/external/pagination/index.html (2 of 2) [12/8/10 1:21:12 AM]
Installing the latest development version of django-pagination — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »django-pagination »
http://pinaxproject.com/docs/dev/external/pagination/install.html (1 of 3) [12/8/10 1:21:26 AM]
Installing the latest development version of django-pagination — Pinax v0.9a2 documentation
Installing the latest development version of django-pagination
To install, first check out the latest version of the application from subversion:
svn co http://django-pagination.googlecode.com/svn/trunk django-pagination
Now, link the inner pagination project to your Python path:
sudo ln -s pwd/pagination SITE_PACKAGES_DIR/pagination
If you donʼt know the location of your site packages directory, this hack might do the trick for you:
sudo ln -s pwd/pagination python -c “from distutils.sysconfig import get_python_lib; print get_python_lib()”/pagination
Now itʼs installed! Please see usage.txt for information on how to use this application in your projects.
Installing via setup.py
Included with this application is a file named setup.py. Itʼs possible to use this file to install this application to your system, by invoking the following command:
sudo python setup.py install
Once thatʼs done, you should be able to begin using django-pagination at will.
Installing via setuptools
If you have setuptools installed, you can simply run the following command to install django-pagination:
sudo easy_install django-pagination
http://pinaxproject.com/docs/dev/external/pagination/install.html (2 of 3) [12/8/10 1:21:26 AM]
Installing the latest development version of django-pagination — Pinax v0.9a2 documentation
Table Of Contents
● Installing the latest development version of django-pagination● Installing via setup.py● Installing via setuptools
Previous topicdjango-pagination
Next topicHow to use django-pagination
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »django-pagination »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/external/pagination/install.html (3 of 3) [12/8/10 1:21:26 AM]
How to use django-pagination — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »django-pagination »
How to use django-pagination
django-pagination allows for easy Digg-style pagination without modifying your views.
There are really 5 steps to setting it up with your projects (not including installation, which is covered in INSTALL.txt in this same directory.)
1. List this application in the INSTALLED_APPS portion of your settings file. Your settings file might look something like:
INSTALLED_APPS = ( # ... 'pagination',)
2. Install the pagination middleware. Your settings file might look something like:
MIDDLEWARE_CLASSES = ( # ... 'pagination.middleware.PaginationMiddleware',)
3. If itʼs not already added in your setup, add the request context processor. Note that context processors are set by default implicitly, so to set them explicitly, you need to copy and paste this code into your under the value TEMPLATE_CONTEXT_PROCESSORS:
("django.core.context_processors.auth","django.core.context_processors.debug","django.core.context_processors.i18n","django.core.context_processors.media","django.core.context_processors.request")
4. Add this line at the top of your template to load the pagination tags:
{% load pagination_tags %}
http://pinaxproject.com/docs/dev/external/pagination/usage.html (1 of 4) [12/8/10 1:21:41 AM]
How to use django-pagination — Pinax v0.9a2 documentation
5. Decide on a variable that you would like to paginate, and use the autopaginate tag on that variable before iterating over it. This could take one of two forms (using the canonical object_list as an example variable):
{% autopaginate object_list %}
This assumes that you would like to have the default 20 results per page. If you would like to specify your own amount of results per page, you can specify that like so:
{% autopaginate object_list 10 %}
Note that this replaces object_list with the list for the current page, so you can iterate over the object_list like you normally would.
6. Now you want to display the current page and the available pages, so somewhere after having used autopaginate, use the paginate inclusion tag:
{% paginate %}
This does not take any arguments, but does assume that you have already called autopaginate, so make sure to do so first.
Thatʼs it! You have now paginated object_list and given users of the site a way to navigate between the different pages–all without touching your views.
A Note About Uploads
It is important, when using django-pagination in conjunction with file uploads, to be aware of when request.page is accessed. As soon as request.page is accessed, request.upload_handlers is frozen and cannot be altered in any way. Itʼs a good idea to access the page attribute on the request object as late as possible in your views.
Optional Settings
In django-pagination, there are no required settings. There are, however, a small set of optional settings useful for changing the default behavior of the pagination tags. Hereʼs an overview:
PAGINATION_DEFAULT_PAGINATION
The default amount of items to show on a page if no number is specified.
http://pinaxproject.com/docs/dev/external/pagination/usage.html (2 of 4) [12/8/10 1:21:41 AM]
How to use django-pagination — Pinax v0.9a2 documentation
PAGINATION_DEFAULT_WINDOW
The number of items to the left and to the right of the current page to display (accounting for ellipses).
PAGINATION_DEFAULT_ORPHANS
The number of orphans allowed. According to the Django documentation, orphans are defined as:
The minimum number of items allowed on the last page, defaults to zero.
PAGINATION_INVALID_PAGE_RAISES_404
Determines whether an invalid page raises an Http404 or just sets the invalid_page context variable. True does the former and False does the latter.
Table Of Contents
● How to use django-pagination● A Note About Uploads● Optional Settings
Previous topicInstalling the latest development version of django-pagination
Next topic
http://pinaxproject.com/docs/dev/external/pagination/usage.html (3 of 4) [12/8/10 1:21:41 AM]
How to use django-pagination — Pinax v0.9a2 documentation
django-oembed
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »django-pagination »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/external/pagination/usage.html (4 of 4) [12/8/10 1:21:41 AM]
django-oembed — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »
django-oembed
Django-oembed is a collection of Django tools which make it easy to change text filled with oembed links into the embedded objects themselves.
Contents:
● django-oembed● Installing django-oembed● Usage
Previous topicHow to use django-pagination
Next topicdjango-oembed
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »
http://pinaxproject.com/docs/dev/external/oembed/index.html (1 of 2) [12/8/10 1:21:54 AM]
django-oembed — Pinax v0.9a2 documentation
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/external/oembed/index.html (2 of 2) [12/8/10 1:21:54 AM]
django-oembed — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »django-oembed »
django-oembed
This is a collection of tools for Django to allow for replacing links in text with OEmbed. This application also provides utilities to make this process not prohibitively expensive CPU-wise.
For installation instructions, read INSTALL.txt.
Visit the google code page at http://django-oembed.googlecode.com/
Previous topicdjango-oembed
Next topicInstalling django-oembed
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »django-oembed »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/external/oembed/readme.html [12/8/10 1:22:08 AM]
Installing django-oembed — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »django-oembed »
Installing django-oembed
Thanks for downloading django-oembed!
To install it, first use subversion to check out the source code:
svn checkout http://django-oembed.googlecode.com/svn/trunk/ django-oembed
Now, link the included oembed directory to your pythonpath. On Debian variants, it would look something like this:
sudo ln -s `pwd`/django-oembed/oembed /usr/lib/python2.5/site-packages/
To use it with a Django installation, first place ʻoembedʼ in the INSTALLED_APPS tuple of your settings.py file like so:
INSTALLED_APPS = ( # ... 'oembed',)
Then syncdb, and here is sample usage in a template:
{% load oembed_tags %}{% oembed %} {% for link in links %}{{ link.href }}{% endfor %}{% endoembed %}
In the previous example, any link.href would be replaced with an OEmbed-fetched embed.
The templatetag takes one optional second argument, which you can figure out by looking at this usage:
{% oembed 320x240 %}
http://pinaxproject.com/docs/dev/external/oembed/installation.html (1 of 2) [12/8/10 1:22:22 AM]
Installing django-oembed — Pinax v0.9a2 documentation
Note that this application requires Python 2.3 or later, and Django later than 0.96. You can obtain Python from http://www.python.org/ and Django from http://www.djangoproject.com/.
Previous topicdjango-oembed
Next topicUsage
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »django-oembed »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/external/oembed/installation.html (2 of 2) [12/8/10 1:22:22 AM]
Usage — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »django-oembed »
Usage
First you must add it to your INSTALLED_APPS:
INSTALLED_APPS = ( .... 'oembed',)
Then in your template, include the oembed tags:
{% load oembed_tags %}
Then, surround something with the oembed tag. It will search for oembed-able links and replace them with the proper embed:
{% oembed %}There is this great video at http://www.viddler.com/explore/SYSTM/videos/49/{% endoembed %}
Will result in:
There is this great video at <objectclassid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="320"height="222" id="viddlerplayer-e5cb3aac"><param name="movie"value="http://www.viddler.com/player/e5cb3aac/" /><paramname="allowScriptAccess" value="always" /><param name="allowFullScreen"value="true" /><embed src="http://www.viddler.com/player/e5cb3aac/"width="320" height="222" type="application/x-shockwave-flash"allowScriptAccess="always" allowFullScreen="true"name="viddlerplayer-e5cb3aac" ></embed></object>
http://pinaxproject.com/docs/dev/external/oembed/usage.html (1 of 2) [12/8/10 1:22:36 AM]
Usage — Pinax v0.9a2 documentation
There is an optional width and height parameter, that can be invoked thusly:
{% oembed 320x240 %}...{% endoembed %}
Previous topicInstalling django-oembed
Next topicdjango-notification
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »django-oembed »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/external/oembed/usage.html (2 of 2) [12/8/10 1:22:36 AM]
Pinax v0.9a2 documentation—django-notification
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »
django-notification
Many sites need to notify users when certain events have occurred and to allow configurable options as to how those notifications are to be received.
The project aims to provide a Django app for this sort of functionality. This includes:
● Submission of notification messages by other apps.● Notification messages on signing in.● Notification messages via email (configurable by user).● Notification messages via feed.
Contents:
● Usage�❍ Creating Notice Types�❍ Notification templates�❍ Sending Notification
■ send_now vs. queue vs. send■ send_now■ queue■ send
■ Optional notification support
http://pinaxproject.com/docs/dev/external/notification/index.html (1 of 2) [12/8/10 1:22:51 AM]
Pinax v0.9a2 documentation—django-notification
Previous topicUsage
Next topicUsage
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/external/notification/index.html (2 of 2) [12/8/10 1:22:51 AM]
Usage — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »django-notification »
Usage
Integrating notification support into your app is a simple three-step process.
● create your notice types● create your notice templates● send notifications
Creating Notice Types
You need to call create_notice_type(label, display, description) once to create the notice types for your application in the database. label is just the internal shortname that will be used for the type, display is what the user will see as the name of the notification type and description is a short description.
For example:
notification.create_notice_type("friends_invite", "Invitation Received", "you have received an invitation")
One good way to automatically do this notice type creation is in a management.py file for your app, attached to the syncdb signal. Here is an example:
from django.conf import settingsfrom django.utils.translation import ugettext_noop as _
if "notification" in settings.INSTALLED_APPS: from notification import models as notification
def create_notice_types(app, created_models, verbosity, **kwargs): notification.create_notice_type("friends_invite", _("Invitation Received"), _("you have received an invitation")) notification.create_notice_type("friends_accept", _("Acceptance Received"), _("an invitation you sent has been accepted"))
signals.post_syncdb.connect(create_notice_types, sender=notification)else: print "Skipping creation of NoticeTypes as notification app not found"
http://pinaxproject.com/docs/dev/external/notification/usage.html (1 of 5) [12/8/10 1:23:07 AM]
Usage — Pinax v0.9a2 documentation
Notice that the code is wrapped in a conditional clause so if django-notification is not installed, your app will proceed anyway.
Note that the display and description arguments are marked for translation by using ugettext_noop. That will enable you to use Djangoʼs makemessages management command and use django-notificationʼs i18n capabilities.
Notification templates
There are four different templates that can to be written for the actual content of the notices:
● short.txt is a very short, text-only version of the notice (suitable for things like email subjects)● full.txt is a longer, text-only version of the notice (suitable for things like email bodies)● notice.html is a short, html version of the notice, displayed in a userʼs notice list on the website● full.html is a long, html version of the notice (not currently used for anything)
Each of these should be put in a directory on the template path called notification/<notice_type_label>/<template_name>. If any of these are missing, a default would be used. In practice, notice.html and full.txt should be provided at a minimum.
For example, notification/friends_invite/notice.html might contain:
{% load i18n %}{% url invitations as invitation_page %}{% url profile_detail username=invitation.from_user.username as user_url %}{% blocktrans with invitation.from_user as invitation_from_user %}<a href="{{ user_url }}">{{ invitation_from_user }}</a> has requested to add you as a friend (see <a href="{{ invitation_page }}">invitations</a>){% endblocktrans %}
and notification/friends_full.txt might contain:
{% load i18n %}{% url invitations as invitation_page %}{% blocktrans with invitation.from_user as invitation_from_user %}{{ invitation_from_user }} has requested to add you as a friend. You can accept their invitation at:
http://{{ current_site }}{{ invitation_page }}{% endblocktrans %}
The context variables are provided when sending the notification.
Sending Notification
http://pinaxproject.com/docs/dev/external/notification/usage.html (2 of 5) [12/8/10 1:23:07 AM]
Usage — Pinax v0.9a2 documentation
There are two different ways of sending out notifications. We have support for blocking and non-blocking methods of sending notifications. The most simple way to send out a notification, for example:
notification.send([to_user], "friends_invite", {"from_user": from_user})
One thing to note is that send is a proxy around either send_now or queue. They all have the same signature:
send(users, label, extra_context, on_site)
The parameters are:
● users is an iterable of User objects to send the notification to.● label is the label you used in the previous step to identify the notice type.● extra_content is a dictionary to add custom context entries to the template used to render to
notification. This is optional.● on_site is a boolean flag to determine whether an Notice object is created in the database.
send_now vs. queue vs. send
Lets first break down what each does.
send_now
This is a blocking call that will check each user for elgibility of the notice and actually peform the send.
queue
This is a non-blocking call that will queue the call to send_now to be executed at a later time. To later execute the call you need to use the emit_notices management command.
send
A proxy around send_now and queue. It gets its behavior from a global setting named NOTIFICATION_QUEUE_ALL. By default it is False. This setting is meant to help control whether you want to queue any call to send.
send also accepts now and queue keyword arguments. By default each option is set to False to honor the global setting which is False. This enables you to override on a per call basis whether it should call send_now or queue.
http://pinaxproject.com/docs/dev/external/notification/usage.html (3 of 5) [12/8/10 1:23:07 AM]
Usage — Pinax v0.9a2 documentation
Optional notification support
In case you want to use django-notification in your reusable app, you can wrap the import of django-notification in a conditional clause that tests if itʼs installed before sending a notice. As a result your app or project still functions without notification.
For example:
from django.conf import settings
if "notification" in settings.INSTALLED_APPS: from notification import models as notificationelse: notification = None
and then, later:
if notification: notification.send([to_user], "friends_invite", {"from_user": from_user})
Table Of Contents
● Usage�❍ Creating Notice Types�❍ Notification templates�❍ Sending Notification■ send_now vs. queue vs. send■ send_now■ queue■ send
http://pinaxproject.com/docs/dev/external/notification/usage.html (4 of 5) [12/8/10 1:23:07 AM]
Usage — Pinax v0.9a2 documentation
■ Optional notification support
Previous topicdjango-notification
Next topicdjango-mailer
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »django-notification »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/external/notification/usage.html (5 of 5) [12/8/10 1:23:07 AM]
django-mailer — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »
django-mailer
Contents:
● Usage�❍ Putting Mail On The Queue�❍ Clear Queue With Command Extensions
Previous topicUsage
Next topicUsage
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/external/mailer/index.html [12/8/10 1:23:21 AM]
Usage — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »django-mailer »
Usage
django-mailer is asynchronous so in addition to putting mail on the queue you need to periodically tell it to clear the queue and actually send the mail.
The latter is done via a command extension.
Putting Mail On The Queue
Because django-mailer currently uses the same function signature as Djangoʼs core mail support you can do the following in your code:
# favour django-mailer but fall back to django.core.mailfrom django.conf import settings
if "mailer" in settings.INSTALLED_APPS: from mailer import send_mailelse: from django.core.mail import send_mail
and then just call send_mail like you normally would in Django:
send_mail(subject, message_body, settings.DEFAULT_FROM_EMAIL, recipients)
Additionally you can send all the admins as specified in the ADMIN setting by calling:
mail_admins(subject, message_body)
or all managers as defined in the MANAGERS setting by calling:
mail_managers(subject, message_body)
Clear Queue With Command Extensions
With mailer in your INSTALLED_APPS, there will be two new manage.py commands you can run:http://pinaxproject.com/docs/dev/external/mailer/usage.html (1 of 3) [12/8/10 1:23:36 AM]
Usage — Pinax v0.9a2 documentation
● send_mail will clear the current message queue. If there are any failures, they will be marked deferred and will not be attempted again by send_mail.
● retry_deferred will move any deferred mail back into the normal queue (so it will be attempted again on the next send_mail).
You may want to set these up via cron to run regularly:
* * * * * (cd $PINAX; /usr/local/bin/python2.5 manage.py send_mail >> $PINAX/cron_mail.log 2>&1)0,20,40 * * * * (cd $PINAX; /usr/local/bin/python2.5 manage.py retry_deferred >> $PINAX/cron_mail_deferred.log 2>&1)
This attempts to send mail every minute with a retry on failure every 20 minutes.
manage.py send_mail uses a lock file in case clearing the queue takes longer than the interval between calling manage.py send_mail.
Note that if your project lives inside a virtualenv, you also have to execute this command from the virtualenv. The same, naturally, applies also if youʼre executing it with cron. The Pinax documentation explains that in more details.
Table Of Contents
● Usage�❍ Putting Mail On The Queue�❍ Clear Queue With Command Extensions
Previous topicdjango-mailer
http://pinaxproject.com/docs/dev/external/mailer/usage.html (2 of 3) [12/8/10 1:23:36 AM]
Usage — Pinax v0.9a2 documentation
Next topicdjango-dbtemplates
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »django-mailer »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/external/mailer/usage.html (3 of 3) [12/8/10 1:23:36 AM]
django-dbtemplates — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »
django-dbtemplates
dbtemplates is a Django app that comes with to parts: It allows you to create templates that are saved in your database, and it provides a so called template loader, a function that enables Django to find the templates you created in the database.
Contents:
● Database template loader for Django�❍ Setup�❍ Usage�❍ Example�❍ Caching
■ Using the default caching■ Writing your own caching backends
�❍ Versionizing your templates■ Short installation howto
�❍ Management commands�❍ Support
http://pinaxproject.com/docs/dev/external/dbtemplates/index.html (1 of 2) [12/8/10 1:23:50 AM]
django-dbtemplates — Pinax v0.9a2 documentation
Previous topicUsage
Next topicDatabase template loader for Django
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/external/dbtemplates/index.html (2 of 2) [12/8/10 1:23:50 AM]
Database template loader for Django — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »django-dbtemplates »
Database template loader for Django
dbtemplates is a Django app that comes with to parts: It allows you to create templates that are saved in your database, and it provides a so called template loader, a function that enables Django to find the templates you created in the database.
It also includes a extensible caching mechanism and supports version control of the templates saved in the database.
Table of Contents
● Database template loader for Django�❍ Setup�❍ Usage�❍ Example�❍ Caching
■ Using the default caching■ Writing your own caching backends
�❍ Versionizing your templates■ Short installation howto
�❍ Management commands�❍ Support
Setup
1. Get the source from the Mercurial repository or install it from the Python Package Index by running easy_install django-dbtemplates or pip django-dbtemplates.
2. Follow the instructions in the INSTALL file
3. Edit the settings.py of your Django site:
�❍ Add dbtemplates to the INSTALLED_APPS setting
Check if django.contrib.sites and django.contrib.admin are in INSTALLED_APPS and add if http://pinaxproject.com/docs/dev/external/dbtemplates/overview.html (1 of 7) [12/8/10 1:24:07 AM]
Database template loader for Django — Pinax v0.9a2 documentation
necessary.
It should look something like this:
INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.admin', 'django.contrib.flatpages', # .. 'dbtemplates',)
4. Add dbtemplates.loader.load_template_source to the TEMPLATE_LOADERS list in the settings.py of your Django project
It should look something like this:
TEMPLATE_LOADERS = ( 'django.template.loaders.filesystem.load_template_source', 'django.template.loaders.app_directories.load_template_source', 'dbtemplates.loader.load_template_source',)
5. Sync your database python manage.py syncdb
6. Restart your Django server
Usage
Creating database templates is pretty simple: Just open the admin interface of your Django-based site in your browser and click on “Templates” in the “Dbtemplates” section.
There you only need to fill in the name field with the identifier, Django is supposed to use while searching for templates, e.g. blog/entry_list.html. The content field should be filled with the content of your template.
Optionally, by leaving the content field empty you are able to tell dbtemplates to look for a template with the name by using Djangoʼs other template loaders. For example, if you have a template called blog/entry_list.html on your file system and want to save the templates contents
http://pinaxproject.com/docs/dev/external/dbtemplates/overview.html (2 of 7) [12/8/10 1:24:07 AM]
Database template loader for Django — Pinax v0.9a2 documentation
in the database, you just need to leave the content field empty to automatically populate it. Thatʼs especially useful if you donʼt want to copy and paste its content manually to the textarea.
Example
dbtemplates comes with an example Django project that letʼs you try it out. The example uses Djangoʼs own flatpages app to enable you to create a simple page using dbtemplates. Flat pages are a perfect fit to dbtemplates since they come prepackaged and are simple to use.
Here is how it works:
1. Open your command line and change to the example directory in the directory with the extracted source distribution.
2. Run python manage.py syncdb and follow the instructions.
3. Run python manage.py runserver and open your favorite browser with the address http://127.0.0.1:8000/admin/.
4. Next add a new Template object in the dbtemplates section and use flatpages/default.html as the value for the name field. For the content field use this example:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"><html><head><title>{{ flatpage.title }}</title></head><body>{{ flatpage.content }}</body></html>
5. Return to the home screen of the admin interface and add a new flat page. Use / (yep, just a forward slash) and whatever title and content you prefer. Please make sure you select the default site example.com before you save the flat page.
6. Visit http://127.0.0.1:8000/ and see the flat page you just created rendered with the flatpages/default.html template provided by dbtemplates.
Cachinghttp://pinaxproject.com/docs/dev/external/dbtemplates/overview.html (3 of 7) [12/8/10 1:24:07 AM]
Database template loader for Django — Pinax v0.9a2 documentation
Using the default caching
Dbtemplates comes with different backends for caching that are automatically created, updated and deleted when templates are saved in the database by using Djangoʼs signal framework.
To enable one of them you need to specify a setting called DBTEMPLATES_CACHE_BACKEND to one of the following values:
● dbtemplates.cache.FileSystemBackend – File system caching
The FileSystemBackend is a simple way to store the templates you have in the database on the filesystem. Thatʼs especially useful if you donʼt use a full caching framework like Django is providing.
To use this backend you need additionally create a setting DBTEMPLATES_CACHE_DIR that contains the full file system path to the directory where dbtemplates should create the cache files in.
● dbtemplates.cache.DjangoCacheBackend – Django cache
The DjangoCacheBackend is a thin wrapper around Djangoʼs caching framework that enables you to use advanced caching solutions like memcached or database caching. Please see the cache documentation if you want to know more about it.
Writing your own caching backends
Writing your own cache backends is perfectly easy since dbtemplates includes a easy-to-use base class in dbtemplates.cache.BaseCacheBackend.
Just subclass that base backend somewhere in your own code and provide the follwing three reuqired methods:
● load
Loads a template from the cache with the given name and returns its contents. Return None if nothing found.
Arguments:
�❍ name - name of the template● save
Saves the passed template contents with the passed name in the cache.http://pinaxproject.com/docs/dev/external/dbtemplates/overview.html (4 of 7) [12/8/10 1:24:07 AM]
Database template loader for Django — Pinax v0.9a2 documentation
Arguments:
�❍ name - name of the template�❍ content - contents of the template
● remove
Removes the template with the passed name from the cache.
Arguments:
�❍ name - name of the template
Please see also the source of the default backends to see how it works.
Versionizing your templates
dbtemplates comes prepared to use the third party Django app django-reversion, that once installed besides dbtemplates allows you to jump back to old versions of your templates. It automatically saves every state when you save the template in your database and provides an easy to use interface.
Please refer to django-reversionʼs documentation for more information about how it works. dbtemplates automatically recognizes if django-reversion is installed and works out of the box. Just visit the “History” section of each template instance and browse its history.
Short installation howto
1. Get the source from the django-reversion project site and put it somewhere on your PYTHONPATH.2. Add reversion to the INSTALLED_APPS setting of your Django project3. Sync your database with python manage.py syncdb
Management commands
dbtemplates comes with two Django management commands to be used with django-admin.py or manage.py:
● sync_templates
Enables you to sync your already existing file systems templates with the database. It will guide
http://pinaxproject.com/docs/dev/external/dbtemplates/overview.html (5 of 7) [12/8/10 1:24:07 AM]
Database template loader for Django — Pinax v0.9a2 documentation
you through the whole process.
● create_error_templates
Tries to add the two templates 404.html and 500.html that are used by Django when a error occurs.
Support
Please leave your questions and messages on the designated site:
http://bitbucket.org/jezdez/django-dbtemplates/issues/
Table Of Contents
● Database template loader for Django�❍ Setup�❍ Usage�❍ Example�❍ Caching■ Using the default caching■ Writing your own caching backends�❍ Versionizing your templates■ Short installation howto�❍ Management
http://pinaxproject.com/docs/dev/external/dbtemplates/overview.html (6 of 7) [12/8/10 1:24:07 AM]
Database template loader for Django — Pinax v0.9a2 documentation
commands�❍ Support
Previous topicdjango-dbtemplates
Next topicdjango-robots
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »django-dbtemplates »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/external/dbtemplates/overview.html (7 of 7) [12/8/10 1:24:07 AM]
django-robots — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »
django-robots
This is a basic Django application to manage robots.txt files following the robots exclusion protocol, complementing the Django Sitemap contrib app.
Contents:
● Robots exclusion application for Django�❍ Installation
■ Sitemaps�❍ Initialization�❍ Rules�❍ URLs�❍ Caching�❍ Support
http://pinaxproject.com/docs/dev/external/robots/index.html (1 of 2) [12/8/10 1:24:21 AM]
django-robots — Pinax v0.9a2 documentation
Previous topicDatabase template loader for Django
Next topicRobots exclusion application for Django
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/external/robots/index.html (2 of 2) [12/8/10 1:24:21 AM]
Robots exclusion application for Django — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »django-robots »
Robots exclusion application for Django
This is a basic Django application to manage robots.txt files following the robots exclusion protocol, complementing the Django Sitemap contrib app.
The robots exclusion application consists of two database models which are tied together with a m2m relationship:
● Rules● URLs
Installation
Get the source from the application site at:
http://bitbucket.org/jezdez/django-robots/
To install the sitemap app, follow these steps:
1. Follow the instructions in the INSTALL.txt file2. Add 'robots' to your INSTALLED_APPS setting.3. Make sure 'django.template.loaders.app_directories.load_template_source' is in your
TEMPLATE_LOADERS setting. Itʼs in there by default, so youʼll only need to change this if youʼve changed that setting.
4. Make sure youʼve installed the sites framework.
Sitemaps
By default a Sitemap statement is automatically added to the resulting robots.txt by reverse matching the URL of the installed Sitemap contrib app. This is especially useful if you allow every robot to access your whole site, since it then gets URLs explicitly instead of searching every link.
http://pinaxproject.com/docs/dev/external/robots/overview.html (1 of 4) [12/8/10 1:24:37 AM]
Robots exclusion application for Django — Pinax v0.9a2 documentation
To change the default behaviour to omit the inclusion of a sitemap link, change the ROBOTS_USE_SITEMAP setting in your Django settings file to:
ROBOTS_USE_SITEMAP = False
In case you want to use a specific sitemap URL instead of the one that is automatically discovered, change the ROBOTS_SITEMAP_URL setting to:
ROBOTS_SITEMAP_URL = http://www.example.com/sitemap.xml
Initialization
To activate robots.txt generation on your Django site, add this line to your URLconf:
(r'^robots.txt$', include('robots.urls')),
This tells Django to build a robots.txt when a robot accesses /robots.txt. Then, please sync your database to create the necessary tables and create Rule objects in the admin interface or via the shell.
Rules
Rule - defines an abstract rule which is used to respond to crawling web robots, using the robots exclusion protocol, a.k.a. robots.txt.
You can link multiple URL pattern to allows or disallows the robot identified by its user agent to access the given URLs.
The crawl delay field is supported by some search engines and defines the delay between successive crawler accesses in seconds. If the crawler rate is a problem for your server, you can set the delay up to 5 or 10 or a comfortable value for your server, but itʼs suggested to start with small values (0.5-1), and increase as needed to an acceptable value for your server. Larger delay values add more delay between successive crawl accesses and decrease the maximum crawl rate to your web server.
The sites framework is used to enable multiple robots.txt per Django instance. If no rule exists it automatically allows every web robot access to every URL.
http://pinaxproject.com/docs/dev/external/robots/overview.html (2 of 4) [12/8/10 1:24:37 AM]
Robots exclusion application for Django — Pinax v0.9a2 documentation
Please have a look at the database of web robots for a full list of existing web robots user agent strings.
URLs
Url - defines a case-sensitive and exact URL pattern which is used to allow or disallow the access for web robots. Case-sensitive.
A missing trailing slash does also match files which start with the name of the given pattern, e.g., '/admin' matches /admin.html too.
Some major search engines allow an asterisk (*) as a wildcard to match any sequence of characters and a dollar sign ($) to match the end of the URL, e.g., '/*.jpg$' can be used to match all jpeg files.
Caching
You can optionally cache the generation of the robots.txt. Add or change the ROBOTS_CACHE_TIMEOUT setting with a value in seconds in your Django settings file:
ROBOTS_CACHE_TIMEOUT = 60*60*24
This tells Django to cache the robots.txt for 24 hours (86400 seconds). The default value is None (no caching).
Support
Please leave your questions and problems on the designated Bitbucket site.
Table Of Contents
● Robots exclusion application
http://pinaxproject.com/docs/dev/external/robots/overview.html (3 of 4) [12/8/10 1:24:37 AM]
Robots exclusion application for Django — Pinax v0.9a2 documentation
for Django�❍ Installation■ Sitemaps�❍ Initialization�❍ Rules�❍ URLs�❍ Caching�❍ Support
Previous topicdjango-robots
Next topicdjango-announcements
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »django-robots »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/external/robots/overview.html (4 of 4) [12/8/10 1:24:37 AM]
django-announcements — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »
django-announcements
Some sites need the ability to broadcast an announcement to all of their users. django-announcements was created precisely for this reason. How you present the announcement is up to you as the site-developer. When working with announcements that are presented on the website one feature is that they are only viewed once. A session variable will hold which announcements an user has viewed and exclude that from their display. announcements supports two different types of filtering of announcements:
● site-wide (this can be presented to anonymous users)● non site-wide (these can be used a strictly a mailing if so desired)● members only (announcements are filtered based on the value of request.user)
Contents:
● Usage�❍ Basic usage
■ Announcement model�❍ Additional uses
■ E-mailing users■ URLconf, views and templates
■ announcement_home■ announcement_detail■ announcement_hide
http://pinaxproject.com/docs/dev/external/announcements/index.html (1 of 2) [12/8/10 1:24:51 AM]
django-announcements — Pinax v0.9a2 documentation
Previous topicRobots exclusion application for Django
Next topicUsage
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/external/announcements/index.html (2 of 2) [12/8/10 1:24:51 AM]
Usage — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »django-announcements »
Usage
Basic usage
Integrating announcements is very simple. announcements provides to you a context processor to get template global access:
TEMPLATE_CONTEXT_PROCESSORS = ( # ... "announcements.context_processors.site_wide_announcements", # ...)
Once that is hooked up you now have access {{ site_wide_announcements }} which is a simple queryset that has filtered the announcements to give you just the right ones. If the user viewing the page is authenticated it will additionally pull out announcements that have been marked for_members.
Here is a quick snippet of how this can be used in a template. Typically in a base template like base.html or some sort:
{% if site_wide_announcements %} <div id="site_wide_announcements"> <ul> {% for announcement in site_wide_announcements %} <li> <a href="{{ announcement.get_absolute_url }}">{{ announcement }}</a> - <a href="{% url announcement_hide announcement.pk %}?next={{ request.path }}">Hide announcement</a> </li> {% endfor %} </ul> </div>{% endif %}
The above template sample uses the views discussed a little bit later on.
To give a bit of internals, the site_wide_announcements context processor is simply a wrapper http://pinaxproject.com/docs/dev/external/announcements/usage.html (1 of 4) [12/8/10 1:25:06 AM]
Usage — Pinax v0.9a2 documentation
around current_announcements_for_request which is located in announcements.models.
Announcement model
To store announcements in the database, announcements comes with a model that deals with this. It contains these fields:
● title - The title of the announcement. This is limited to 50 characters. The title is completely optional since some types of annoucements donʼt really need one.
● content - The main content of the announcement.● creator - The user who created the announcement.● creation_date - A DateTimeField indicating when the announcement was created.● site_wide - A boolean value indicating whether the announcment should be site-wide and used in the
context processor.● members_only - This will tag an announcemnt as for member eyes only.
Additional uses
There are a couple of ways that announcements can be used outside of its basic usage described above.
E-mailing users
When you are creating a new announcement via the admin interface you are given the option to send now. What this means is that announcements has optional support of django-notification. If it is available it can send a notification of the announcement. This then in turn can be e-mail to the user.
Note Due to the possibility of large user bases, even 20+, can cause the sending of a notification to take a bit of time. This could in turn cause the request to time out. To avoid that announcements uses the queuing feature of notifications. To send out the notifications you will need to use the emit_notices management command notifications provides.
URLconf, views and templates
announcements comes with three pre-defined URLs. They enable you the ability to list, view and hide announcements. You can hook up these views very simply in your urls.py:
# example urls.py.from django.conf.urls.defaults import *
urlpatterns = patterns("",
http://pinaxproject.com/docs/dev/external/announcements/usage.html (2 of 4) [12/8/10 1:25:06 AM]
Usage — Pinax v0.9a2 documentation
# ... url(r"^announcements/", include("announcements.urls")), # ...)
announcement_home
View: announcements.views.announcement_list
It uses current_announcements_for_request to get a queryset of announcements appropriate to the HttpRequest.
announcement_detail
View: django.views.generic.list_detail.object_detail
Displays a single announcement. Reference the Django object_detail documentation for more information.
announcement_hide
View: announcements.views.announcement_hide
This view will mark a given announcement as hidden and redirect the user to the provide next GET argument.
Table Of Contents
● Usage�❍ Basic usage■ Announcement model�❍ Additional uses■ E-mailing users■ URLconf,
http://pinaxproject.com/docs/dev/external/announcements/usage.html (3 of 4) [12/8/10 1:25:06 AM]
Usage — Pinax v0.9a2 documentation
views and templates■ announcement_home■ announcement_detail■ announcement_hide
Previous topicdjango-announcements
Next topicdjango-messages
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »django-announcements »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/external/announcements/usage.html (4 of 4) [12/8/10 1:25:06 AM]
django-messages — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »
http://pinaxproject.com/docs/dev/external/messages/index.html (1 of 3) [12/8/10 1:25:21 AM]
django-messages — Pinax v0.9a2 documentation
django-messages
messages is a Django app which provides a user-to-user messaging system. Django-messages enables your users to send private messages to each other. It provides a basic set of functionality you would expect from such a system. Every user has an inbox, an Outbox and a Trash. Messages can be composed and there is an easy url-based approach to preloading the compose-form with the recipient user, which makes it extremly easy to put “send xyz a message” links on profile pages.
Currently django-messages comes with these translations:
● de● fr● es_AR● pl● es● pt_BR● ru_RU● nl
● Installing django-messages�❍ Quickstart�❍ Download�❍ Install�❍ Manual Install�❍ Dependencies
● Using django-messages�❍ Edit settings�❍ Add urls�❍ Templates
● Customizing django-messages�❍ Templates�❍ URL-conf
■ Modifying template names■ Modifying form classes■ Modifying success urls
http://pinaxproject.com/docs/dev/external/messages/index.html (2 of 3) [12/8/10 1:25:21 AM]
django-messages — Pinax v0.9a2 documentation
Previous topicUsage
Next topicInstalling django-messages
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/external/messages/index.html (3 of 3) [12/8/10 1:25:21 AM]
Installing django-messages — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »django-messages »
Installing django-messages
Basically all you have to do is get the messages folder somewhere on the Python path. There are multiple ways to achive this.
Quickstart
If you already downloaded the package change into the django-messages directory and run:
python setup.py install
Otherwise you will find more information in the remainder of this document.
Django-messages is available via PyPi, so the following command will download and install django-messages on your system in one step:
easy_install django-messages
If you prefer using pip, you may achieve the same result by running:
pip install django-messages
Download
You will always find and download the latest packaged version at: http://code.google.com/p/django-messages/downloads/list
If you prefer to use the current developement version to get earlier access to new features you can checkout the code from the SVN repository:
svn checkout http://django-messages.googlecode.com/svn/trunk/ django-messages
http://pinaxproject.com/docs/dev/external/messages/install.html (1 of 3) [12/8/10 1:25:35 AM]
Installing django-messages — Pinax v0.9a2 documentation
Install
If you downloaded the tar-ball extract it with (change the version number if required):
tar -xcvf django-messages-0.4.tar.gz
After extracting the tar-ball or checking out the code from the repository, change into the django-messages directory and install the code:
cd django-messagespython setup.py install
Manual Install
Instead of using setup.py install it is also possible to copy or symlink the messages folder inside the toplevel django-messages folder to your Python path. This will be enough to make djano-messages available to your system.
Dependencies
Django-messages has no external dependencies except for Django. Starting with version 0.3 Django 1.0 or later is required. If you have to use Django 0.96.x you might still use version 0.2 (unsupported).
Django-messages has some features which may use an external app if it is present in the current Django project. Please note, that these apps have to be listed in INSTALLED_APPS to be used by django-messages.
● If you use django-notification django-messages will use it for sending notifications to users about new messages instead of using the built-in mechanism
● If django-mailer is used the built-in messages sending code will use it instead of the django built-in send_mail function.
Please note that we try to support Python 2.4, but as we develop django-messages on Python 2.5 sometimes code might slip in which breaks Python 2.4 compatibility. This can be considered a bug and you can help us by reporting the incompytibility.
http://pinaxproject.com/docs/dev/external/messages/install.html (2 of 3) [12/8/10 1:25:35 AM]
Installing django-messages — Pinax v0.9a2 documentation
Table Of Contents
● Installing django-messages�❍ Quickstart�❍ Download�❍ Install�❍ Manual Install�❍ Dependencies
Previous topicdjango-messages
Next topicUsing django-messages
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »django-messages »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/external/messages/install.html (3 of 3) [12/8/10 1:25:35 AM]
Using django-messages — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »django-messages »
Using django-messages
To enable django-messages in your Django project make sure it is installed. You can check if django-messages was successfully installed by opening a python shell and running:
>>> import messages>>>
If no error occured, you can assumed that the app was installed correctly.
Edit settings
The next step is to add messages to the INSTALLED_APPS setting:
INSTALLED_APPS = ( ... 'messages', ...)
Add urls
To make django-messages available to your users you should include the bunlded url-conf in your root url-conf. One example would be to edit your main urls.py and add a line like this:
urlpatterns = patterns('' ... (r'^messages/', include('messages.urls')), ...)
http://pinaxproject.com/docs/dev/external/messages/usage.html (1 of 3) [12/8/10 1:25:49 AM]
Using django-messages — Pinax v0.9a2 documentation
Templates
Django-messages provides some simple default templates which will get you started quick. The templates make the assumption that a base template with the name base.html exists which defines a block content and a block sidebar. If this is not the case, or the template donʼt fit due to other concerns, itʼs very easy to provide to your own templates. Please see the customization docs fore more details.
Table Of Contents
● Using django-messages�❍ Edit settings�❍ Add urls�❍ Templates
Previous topicInstalling django-messages
Next topicCustomizing django-messages
This Page● Show Source
http://pinaxproject.com/docs/dev/external/messages/usage.html (2 of 3) [12/8/10 1:25:49 AM]
Using django-messages — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »django-messages »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/external/messages/usage.html (3 of 3) [12/8/10 1:25:49 AM]
Customizing django-messages — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »django-messages »
Customizing django-messages
There are multiple levels at which you can customize django-messages without altering the code directly.
Templates
Django-messages comes with a set of built-in templates which you can use. If these templates donʼt fit your project you can override any or all of them by putting files with the same filenames in one the directories listes in TEMPLATES_DIRS in your settings.py.
Django-messages uses the following templates:
● messages/base.html - A base template from which all the following templates inherit. Maybe itʼs enough to customize this template for your project.
● messages/compose.html - This template is rendered, when a user composes a new messages.● messages/inbox.html - This template lists the users inbox.● messages/new_messages.html - This template is used to construct the notification mail sent to a user,
whenever a new message is received.● messages/outbox.html - This template lists the users outbox aka sent messages.● messages/trash.html - This template lists the users trash.● messages/view.html - This template renders a single message with all details.
Additionally django-message provides a set of template for django-notification. These template can be found in messages/templates/notification/ and can also be overwritten in one of your projectʼs TEMPLATE_DIRS.
URL-conf
If you want to further customize how django-messages works it is possible to write your own url-conf instead of including messages.urls in your root url-conf. This not only allows changing the url structure but also allows modifying the kwargs passed to the views and therefore modifying some behaviour.
Please note: If you provide your own url-conf, or urlpatterns directly embedded in your root url-http://pinaxproject.com/docs/dev/external/messages/customizing.html (1 of 4) [12/8/10 1:26:04 AM]
Customizing django-messages — Pinax v0.9a2 documentation
conf, you shouldnʼt include messages.urls.
Three common customizations are described in more detail below.
Modifying template names
If overwriting templates in your projectʼs TEMPLATE_DIRS does not provide enough freedom, you can change the names of the used templates by providing a template_name keyword argument to the views. Every view which renders a template accepts this keyword-argument.
If you want to change the template the inbox view uses to my_inbox.html instead of the default messages/inbox.html you can use this line in your own url-conf:
url(r'^inbox/$', inbox, {'template_name': 'my_inbox.html',}, name='messages_inbox'),
Modifying form classes
If you want to use your own form for composing messages, for example to add new features, you can simply pass the form-class to the views via kwargs. Every view which renders a form accepts a form_class keyword argument to specify the form-class.
If you want to use Your own MyComposeForm you can pass it to the view by using a line like the following in your own url-conf:
from somewhere import MyComposeForm...url(r'^compose/$', compose, {'form_class': MyComposeForm,}, name='messages_compose'),
Modifying success urls
All views, which will redirect the user after a successfull action accept a success_url keyword argument to specify the destination url. The delete and undelete views will additionally check if a next parameter is provided in the querystring appended to the url.
If you donʼt want to append the next target to the url, or want to change the redirecting behaviour of other views, you can pass a success_url parameter in your own url-conf, for example like this:
url(r'^delete/(?P<message_id>[\d]+)/$', delete, {'success_url': '/http://pinaxproject.com/docs/dev/external/messages/customizing.html (2 of 4) [12/8/10 1:26:04 AM]
Customizing django-messages — Pinax v0.9a2 documentation
profile/',}, name='messages_delete'),
Table Of Contents
● Customizing django-messages�❍ Templates�❍ URL-conf■ Modifying template names■ Modifying form classes■ Modifying success urls
Previous topicUsing django-messages
Next topicPinax Apps
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »External Apps »django-messages »
http://pinaxproject.com/docs/dev/external/messages/customizing.html (3 of 4) [12/8/10 1:26:04 AM]
Customizing django-messages — Pinax v0.9a2 documentation
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/external/messages/customizing.html (4 of 4) [12/8/10 1:26:04 AM]
Pinax Apps — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »
Pinax Apps
● pinax.apps.account�❍ Getting started
■ Prerequisites■ Installation
�❍ Reference■ Settings■ Named URLs■ Templates■ Modules
● pinax.apps.analytics�❍ Getting started
■ Prerequisites■ Installation■ Usage
�❍ Reference■ Settings■ Modules
● pinax.apps.authsub�❍ Getting started
■ Prerequisites■ Installation
�❍ Reference■ Named Urls■ Modules
● pinax.apps.autocomplete_app�❍ Getting started
■ Prerequisites■ Installation■ Usage
http://pinaxproject.com/docs/dev/apps/index.html (1 of 5) [12/8/10 1:26:21 AM]
Pinax Apps — Pinax v0.9a2 documentation
�❍ Reference■ Modules
● pinax.apps.basic_profiles�❍ Getting started
■ Prerequisites■ Installation
�❍ Reference■ Named Urls■ Templates■ Modules
● pinax.apps.bbauth�❍ Getting started
■ Prerequisites■ Installation
�❍ Reference■ Settings■ Named Urls■ Modules
● pinax.apps.blog�❍ Getting started
■ Prerequisites■ Installation
�❍ Reference■ Settings■ Named Urls■ Templates■ Modules
● pinax.apps.photos�❍ Getting started
■ Prerequisites■ Installation
�❍ Reference■ Named URLs■ Templates■ Modules
● pinax.apps.profiles
http://pinaxproject.com/docs/dev/apps/index.html (2 of 5) [12/8/10 1:26:21 AM]
Pinax Apps — Pinax v0.9a2 documentation
�❍ Getting started■ Prerequisites■ Installation
�❍ Reference■ Named URLs■ Templates■ Modules
● pinax.apps.projects�❍ Getting started
■ Prerequisites■ Installation
�❍ Reference■ Named URLs■ Templates■ Modules
● pinax.apps.signup_codes�❍ Getting started
■ Prerequisites■ Installation
�❍ Reference■ Settings■ Templates■ Modules
● pinax.apps.tagging_utils�❍ Getting started
■ Prerequisites■ Installation
�❍ Reference■ Settings■ Named URLs■ Modules
● pinax.apps.tasks�❍ Getting started
■ Prerequisites■ Installation
�❍ Reference
http://pinaxproject.com/docs/dev/apps/index.html (3 of 5) [12/8/10 1:26:21 AM]
Pinax Apps — Pinax v0.9a2 documentation
■ Settings■ Named URLs■ Templates■ Modules
● pinax.apps.threadedcomments_extras�❍ Getting started
■ Prerequisites■ Installation■ Usage
�❍ Reference■ Templates■ Modules
● pinax.apps.topics�❍ Getting started
■ Prerequisites■ Installation
�❍ Reference■ Named URLs■ Templates■ Modules
● pinax.apps.tribes�❍ Getting started
■ Prerequisites■ Installation
�❍ Reference■ Named URLs■ Templates■ Modules
● pinax.apps.voting_extras�❍ Getting started
■ Prerequisites■ Installation■ Usage
�❍ Reference■ Modules
● pinax.apps.waitinglist
http://pinaxproject.com/docs/dev/apps/index.html (4 of 5) [12/8/10 1:26:21 AM]
Pinax Apps — Pinax v0.9a2 documentation
�❍ Getting started■ Prerequisites■ Installation
�❍ Reference■ Named URLs■ Templates■ Modules
Previous topicCustomizing django-messages
Next topicpinax.apps.account
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/apps/index.html (5 of 5) [12/8/10 1:26:21 AM]
pinax.apps.account — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »
pinax.apps.account
An app to handle account signup, login and management.
The account app is already integrated with most projects. Our default project, zero, does not come with account integrated.
● Getting started�❍ Prerequisites�❍ Installation
● Reference�❍ Settings
■ ACCOUNT_EMAIL_VERIFICATION■ LOGIN_REDIRECT_URLNAME■ STATIC_URL■ ACCOUNT_OPEN_SIGNUP
�❍ Named URLs■ acct_email■ acct_signup■ acct_login■ acct_login_openid■ acct_passwd■ acct_passwd_set■ acct_passwd_delete■ acct_passwd_delete_done■ acct_timezone_change■ acct_other_services■ acct_other_services_remove■ acct_language_change■ acct_logout■ acct_confirm_email■ acct_passwd_reset
http://pinaxproject.com/docs/dev/apps/account/index.html (1 of 3) [12/8/10 1:26:36 AM]
pinax.apps.account — Pinax v0.9a2 documentation
■ acct_passwd_reset_done■ acct_passwd_reset_key■ signup_form_validate
�❍ Templates■ login.html■ signup.html■ verification_sent.html■ email.html■ password_change.html■ password_set.html■ password_delete.html■ password_delete_done.html■ password_reset.html■ password_reset_done.html■ password_reset_from_key.html■ timezone_change.html■ language_change.html■ other_services.html
�❍ Modules■ pinax.apps.account.admin■ pinax.apps.account.auth_backends■ pinax.apps.account.context_processors■ pinax.apps.account.forms■ pinax.apps.account.middleware■ pinax.apps.account.models■ pinax.apps.account.openid_consumer■ pinax.apps.account.signals■ pinax.apps.account.templatetags.account_tags■ pinax.apps.account.templatetags.openid_tags■ pinax.apps.account.templatetags.other_service_tags■ pinax.apps.account.utils■ pinax.apps.account.views
Previous
http://pinaxproject.com/docs/dev/apps/account/index.html (2 of 3) [12/8/10 1:26:36 AM]
pinax.apps.account — Pinax v0.9a2 documentation
topicPinax Apps
Next topicGetting started
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/apps/account/index.html (3 of 3) [12/8/10 1:26:36 AM]
Getting started — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.account »
Getting started
This document is designed to get you up and running with pinax.apps.account...
Prerequisites
These are the requirements to run pinax.apps.account:
● Python 2.4+ (Python 3.x is not supported yet)● Django 1.2+● django-email-confirmation● django-timezones● django-ajax-validation
These dependencies should be added to your requirements/project.txt file and installed using pip. For example:
pip install -r requirements/project.txt
Installation
Add pinax.apps.account to your INSTALLED_APPS:
INSTALLED_APPS = [ # ... "pinax.apps.account",]
Hook up pinax.apps.account to your URLconf:
http://pinaxproject.com/docs/dev/apps/account/gettingstarted.html (1 of 2) [12/8/10 1:26:50 AM]
Getting started — Pinax v0.9a2 documentation
urlpatterns = patterns("", # ... url(r"^account/", include("pinax.apps.account.urls")))
Table Of Contents
● Getting started�❍ Prerequisites�❍ Installation
Previous topicpinax.apps.account
Next topicReference
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.account »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/apps/account/gettingstarted.html (2 of 2) [12/8/10 1:26:50 AM]
Reference — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.account »
Reference
This document covers various components of pinax.apps.account.
Settings
ACCOUNT_EMAIL_VERIFICATION
Required. This setting is used to control whether or not email verification is sent upon signup:
ACCOUNT_EMAIL_VERIFICATION = True
LOGIN_REDIRECT_URLNAME
The name defined in the URLconf that maps to the url that the user will be redirected to after login success.
LOGIN_REDIRECT_URLNAME = "home"
STATIC_URL
Required. An URL for static files that need serving.
STATIC_URL = "/static/"
ACCOUNT_OPEN_SIGNUP
Required. Permit signing up for an account via OpenID.
http://pinaxproject.com/docs/dev/apps/account/reference.html (1 of 10) [12/8/10 1:27:08 AM]
Reference — Pinax v0.9a2 documentation
ACCOUNT_OPEN_SIGNUP = True
Named URLs
The named URLs in this app should enable the use of of the {% url %} template tag as well as reverse lookups in your project code without having to know the implementation details of this app.
acct_email
This is the URL that on POST will process a number of actions related to an email address on an account and on GET will render a template that provides the email form in context.
acct_signup
This URL will process a form to create an account on POST and render a template with a signup form instance in context on GET requests.
acct_login
Process a login request from POST requests and render a template with a login form instance in context on GET requests.
acct_login_openid
Process the login POST request while associating submitted OpenID credentials to the account if they donʼt already exist.
acct_passwd
Process a password change form POST or render a template with a password change form instance in context.
acct_passwd_set
Process a password set form POST or render a template with a password set form instance in context.http://pinaxproject.com/docs/dev/apps/account/reference.html (2 of 10) [12/8/10 1:27:08 AM]
Reference — Pinax v0.9a2 documentation
acct_passwd_delete
Process a password delete form POST or render a template with a password delete form instance in context.
acct_passwd_delete_done
Renders static template to inform user that the password delete is complete.
acct_timezone_change
Processes a timezone form POST request to change a userʼs timezone or renders a template with the timezone change form instance in context.
acct_other_services
Adds credentials for Twitter on form POST, or renders a template with the form instance in context.
acct_other_services_remove
Removes Twitter account association with user.
acct_language_change
Processes a default language selection form POST request or renders a template with the language change form in context.
acct_logout
Calls the django.contrib.auth.views.logout view.
acct_confirm_email
Calls the emailconfirmation.views.confirm_email view.http://pinaxproject.com/docs/dev/apps/account/reference.html (3 of 10) [12/8/10 1:27:08 AM]
Reference — Pinax v0.9a2 documentation
arguments: The token generated in the emailconfirmation app that matches (\w+).
acct_passwd_reset
Process a password reset form POST request and redirect to acct_passwd_reset_done or render a template with the password reset form instance in context.
acct_passwd_reset_done
Renders a template confirming the password reset process is complete.
acct_passwd_reset_key
Process a password reset using user key form POST request or render a template with the form in context.
keyword arguments: The UUID and Key for the reset reset request that matches (?P<uidb36>[0-9A-Za-z]+)-(?P<key>.+)
signup_form_validate
Calls the ajax_validation.views.validate view with the pinax.apps.account.forms.SignupForm.
Templates
Templates should be placed in an account/ folder at the root of one of your template search paths.
login.html
context: group, form, url_required, redirect_field_name, redirect_field_value
signup.html
context: group, form, redirect_field_name, redirect_field_value
http://pinaxproject.com/docs/dev/apps/account/reference.html (4 of 10) [12/8/10 1:27:08 AM]
Reference — Pinax v0.9a2 documentation
verification_sent.html
context: group, email, success_url
email.html
context: group, add_email_form
password_change.html
context: group, password_change_form
password_set.html
context: group, password_set_form
password_delete.html
context: group
password_delete_done.html
context: None
password_reset.html
context: group, password_reset_form
password_reset_done.html
context: group
password_reset_from_key.html
If there is a valid token:
http://pinaxproject.com/docs/dev/apps/account/reference.html (5 of 10) [12/8/10 1:27:08 AM]
Reference — Pinax v0.9a2 documentation
context: group, form
otherwise:
context: group, token_fail = True
timezone_change.html
context: group, form
language_change.html
context: group, form
other_services.html
context: group, twitter_form, twitter_authorized
Modules
pinax.apps.account.admin
pinax.apps.account.auth_backends
pinax.apps.account.context_processors
pinax.apps.account.forms
pinax.apps.account.middleware
pinax.apps.account.models
pinax.apps.account.openid_consumerhttp://pinaxproject.com/docs/dev/apps/account/reference.html (6 of 10) [12/8/10 1:27:08 AM]
Reference — Pinax v0.9a2 documentation
pinax.apps.account.signals
pinax.apps.account.templatetags.account_tags
pinax.apps.account.templatetags.openid_tags
pinax.apps.account.templatetags.other_service_tags
pinax.apps.account.utils
pinax.apps.account.views
Table Of Contents
● Reference�❍ Settings■ ACCOUNT_EMAIL_VERIFICATION■ LOGIN_REDIRECT_URLNAME■ STATIC_URL■ ACCOUNT_OPEN_SIGNUP�❍ Named URLs■ acct_email■ acct_signup■ acct_login■ acct_login_openid■ acct_passwd■ acct_passwd_set■ acct_passwd_delete■ acct_passwd_delete_done■ acct_timezone_change■ acct_other_services■ acct_other_services_remove
http://pinaxproject.com/docs/dev/apps/account/reference.html (7 of 10) [12/8/10 1:27:08 AM]
Reference — Pinax v0.9a2 documentation
■ acct_language_change■ acct_logout■ acct_confirm_email■ acct_passwd_reset■ acct_passwd_reset_done■ acct_passwd_reset_key■ signup_form_validate�❍ Templates■ login.html■ signup.html■ verification_sent.html■ email.html■ password_change.html■ password_set.html■ password_delete.html■ password_delete_done.html■ password_reset.html■ password_reset_done.html■ password_reset_from_key.html■ timezone_change.html■ language_change.html■ other_services.html�❍ Modules■ pinax.apps.account.admin■ pinax.apps.account.auth_backends
http://pinaxproject.com/docs/dev/apps/account/reference.html (8 of 10) [12/8/10 1:27:08 AM]
Reference — Pinax v0.9a2 documentation
■ pinax.apps.account.context_processors■ pinax.apps.account.forms■ pinax.apps.account.middleware■ pinax.apps.account.models■ pinax.apps.account.openid_consumer■ pinax.apps.account.signals■ pinax.apps.account.templatetags.account_tags■ pinax.apps.account.templatetags.openid_tags■ pinax.apps.account.templatetags.other_service_tags■ pinax.apps.account.utils■ pinax.apps.account.
http://pinaxproject.com/docs/dev/apps/account/reference.html (9 of 10) [12/8/10 1:27:08 AM]
Reference — Pinax v0.9a2 documentation
views
Previous topicGetting started
Next topicpinax.apps.analytics
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.account »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/apps/account/reference.html (10 of 10) [12/8/10 1:27:08 AM]
Pinax v0.9a2 documentation—pinax.apps.analytics
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »
pinax.apps.analytics
An app to provide a couple of template tags for Google Analytics.
● Getting started�❍ Prerequisites�❍ Installation�❍ Usage
● Reference�❍ Settings
■ URCHIN_ID�❍ Modules
■ pinax.apps.analytics.templatetags.analytics
Previous topicReference
Next topicGetting started
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/apps/analytics/index.html [12/8/10 1:27:22 AM]
Getting started — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.analytics »
Getting started
This documentationʼs purpose is to help get you up and running with pinax.apps.analytics as fast as possible.
Prerequisites
To run pinax.apps.analytics you need the following:
● Python 2.4+ (Python 3.x is not supported yet)● Django 1.2+
These dependencies should be added to your requirements/project.txt file and installed using pip. For example:
pip install -r requirements/project.txt
Installation
Add pinax.apps.analytics to your INSTALLED_APPS:
INSTALLED_APPS = [ # ... "pinax.apps.analytics",]
Usage
You now have two template tags at your disposal to being using in your templates:
http://pinaxproject.com/docs/dev/apps/analytics/gettingstarted.html (1 of 3) [12/8/10 1:27:36 AM]
Getting started — Pinax v0.9a2 documentation
{% urchin %}
and
{% ga %}
To use either of these simply add the URCHIN_ID setting to settings.py and then in the template where you use to add the tracking code, put the following in your header:
{% load analytics %}
and then put either the urchin or ga tag in the right spot in your template.
Table Of Contents
● Getting started�❍ Prerequisites�❍ Installation�❍ Usage
Previous topicpinax.apps.analytics
Next topicReference
This Page● Show Source
http://pinaxproject.com/docs/dev/apps/analytics/gettingstarted.html (2 of 3) [12/8/10 1:27:36 AM]
Getting started — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.analytics »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/apps/analytics/gettingstarted.html (3 of 3) [12/8/10 1:27:36 AM]
Reference — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.analytics »
Reference
Settings
URCHIN_ID
The identifier assigned to your Google Analytics account. If this is not found in the settings.py file, an empty string is returned instead of the javascript block.
URCHIN_ID = 'XXXXXXXXX'
Modules
pinax.apps.analytics.templatetags.analytics
http://pinaxproject.com/docs/dev/apps/analytics/reference.html (1 of 2) [12/8/10 1:27:50 AM]
Reference — Pinax v0.9a2 documentation
Table Of Contents
● Reference�❍ Settings■ URCHIN_ID�❍ Modules■ pinax.apps.analytics.templatetags.analytics
Previous topicGetting started
Next topicpinax.apps.authsub
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.analytics »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/apps/analytics/reference.html (2 of 2) [12/8/10 1:27:50 AM]
pinax.apps.authsub — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »
pinax.apps.authsub
An app to provide authenticated access to Google Contacts API.
● Getting started�❍ Prerequisites�❍ Installation
● Reference�❍ Named Urls
■ authsub_login�❍ Modules
■ pinax.apps.authsub.views
Previous topicReference
Next topicGetting started
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/apps/authsub/index.html [12/8/10 1:28:04 AM]
Getting started — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.authsub »
Getting started
This document is designed to get you up and running with pinax.apps.authsub...
Prerequisites
These are the requirements to run pinax.apps.authsub:
● Python 2.4+ (Python 3.x is not supported yet)● Django 1.2+● gdata (http://pypi.python.org/pypi/gdata/)
These dependencies should be added to your requirements/project.txt file and installed using pip. For example:
pip install -r requirements/project.txt
Installation
Add pinax.apps.authsub to your INSTALLED_APPS:
INSTALLED_APPS = [ # ... "pinax.apps.authsub",]
Hook up pinax.apps.authsub to your URLconf:
urlpatterns = patterns("", # ...
http://pinaxproject.com/docs/dev/apps/authsub/gettingstarted.html (1 of 2) [12/8/10 1:28:18 AM]
Getting started — Pinax v0.9a2 documentation
url(r"^authsub/", include("pinax.apps.authsub.urls")))
Table Of Contents
● Getting started�❍ Prerequisites�❍ Installation
Previous topicpinax.apps.authsub
Next topicReference
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.authsub »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/apps/authsub/gettingstarted.html (2 of 2) [12/8/10 1:28:18 AM]
Pinax v0.9a2 documentation—Reference
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.authsub »
Reference
This document covers various components of pinax.apps.authsub.
Named Urls
The named urls in this app should enable the use of of the {% url %} template tag as well as reverse lookups in your project code without having to know the implementation details of this app.
authsub_login
This redirects user to the invitations_contacts named url in the django-friends app or to the Google Contacts API.
Modules
pinax.apps.authsub.views
http://pinaxproject.com/docs/dev/apps/authsub/reference.html (1 of 2) [12/8/10 1:28:32 AM]
Pinax v0.9a2 documentation—Reference
Table Of Contents
● Reference�❍ Named Urls■ authsub_login�❍ Modules■ pinax.apps.authsub.views
Previous topicGetting started
Next topicpinax.apps.autocomplete_app
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.authsub »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/apps/authsub/reference.html (2 of 2) [12/8/10 1:28:32 AM]
pinax.apps.autocomplete_app — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »
pinax.apps.autocomplete_app
A utility app that provides autocomplete functionality to various other apps.
● Getting started�❍ Prerequisites�❍ Installation�❍ Usage
● Reference�❍ Modules
■ pinax.apps.autocomplete_app.views
Previous topicReference
Next topicGetting started
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/apps/autocomplete_app/index.html [12/8/10 1:28:46 AM]
Getting started — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.autocomplete_app »
Getting started
This document is designed to get you up and running with the pinax.apps.autocomplete_app...
Prerequisites
These are the requirements to run pinax.apps.autocomplete_app:
● Python 2.4+ (Python 3.x is not supported yet)● Django 1.2+● pinax.apps.basic_profiles● pinax.apps.profiles● django-avatar (http://github.com/ericflo/django-avatar)● django-friends (http://github.com/jtauber/django-friends/)
These dependencies should be added to your requirements/project.txt file and installed using pip. For example:
pip install -r requirements/project.txt
Installation
Add pinax.apps.autocomplete_app to your INSTALLED_APPS:
INSTALLED_APPS = [ # ... "pinax.apps.autocomplete_app",]
Usage
http://pinaxproject.com/docs/dev/apps/autocomplete_app/gettingstarted.html (1 of 3) [12/8/10 1:29:01 AM]
Getting started — Pinax v0.9a2 documentation
After installing this app in your Django project, you now have access to easily provide autocomplete lookups via client side javascript.
First, youʼll want to wire up the appropriate urls for you app:
urlpatterns = patterns("", url(r"^username_autocomplete_friends/$", "pinax.apps.autocomplete_app.views.username_autocomplete_friends", name="profile_username_autocomplete_friends"), url(r"^username_autocomplete/$", "pinax.apps.autocomplete_app.views.username_autocomplete_all", name="profile_username_autocomplete"),)
The above url mapping will give you two different lookups, one using the django-friends app to look through just the logged in userʼs friends, and the other looking through all users in the system.
###<script type="text/javascript" src="jquery.min.js"></script><script type="text/javascript" src="jquery.autocomplete.min.js"></script><script type="text/javascript"> $().ready(function() { $("#id_recipient").autocomplete("{% url profile_username_autocomplete %}", { formatItem: function(data, i, n, value) { values = value.split(",,"); return values[0] + values[1] + "<br />" + values[2]; }, formatResult: function(data, value) { return value.split(",,")[1]; }, // TODO: improve highlighting to only affect username. highlight: false }); $("#id_recipient").focus() });</script>###
###<input id="id_recipient" type="text">###
http://pinaxproject.com/docs/dev/apps/autocomplete_app/gettingstarted.html (2 of 3) [12/8/10 1:29:01 AM]
Getting started — Pinax v0.9a2 documentation
Table Of Contents
● Getting started�❍ Prerequisites�❍ Installation�❍ Usage
Previous topicpinax.apps.autocomplete_app
Next topicReference
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.autocomplete_app »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/apps/autocomplete_app/gettingstarted.html (3 of 3) [12/8/10 1:29:01 AM]
Reference — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.autocomplete_app »
Reference
This document covers various components of pinax.apps.autocomplete_app.
Modules
pinax.apps.autocomplete_app.views
Table Of Contents
● Reference�❍ Modules■ pinax.apps.autocomplete_app.views
Previous topicGetting started
Next topicpinax.apps.basic_profiles
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.autocomplete_app »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/apps/autocomplete_app/reference.html [12/8/10 1:29:15 AM]
pinax.apps.basic_profiles — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »
pinax.apps.basic_profiles
pinax.apps.basic_profiles is a very basic user profile app.
● Getting started�❍ Prerequisites�❍ Installation
● Reference�❍ Named Urls
■ profile_username_autocomplete■ profile_list■ profile_detail■ profile_edit
�❍ Templates■ profiles.html■ profile.html■ profile_edit.html■ profile_edit_facebox.html
�❍ Modules■ pinax.apps.basic_profiles.admin■ pinax.apps.basic_profiles.forms■ pinax.apps.basic_profiles.management.commands.create_profiles_for_users■ pinax.apps.basic_profiles.models■ pinax.apps.basic_profiles.templatetags.basic_profile_tags■ pinax.apps.basic_profiles.views
http://pinaxproject.com/docs/dev/apps/basic_profiles/index.html (1 of 2) [12/8/10 1:29:29 AM]
pinax.apps.basic_profiles — Pinax v0.9a2 documentation
Previous topicReference
Next topicGetting started
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/apps/basic_profiles/index.html (2 of 2) [12/8/10 1:29:29 AM]
Getting started — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.basic_profiles »
Getting started
This document is designed to get you up and running with the pinax.apps.basic_profiles...
Prerequisites
These are the requirements to run pinax.apps.basic_profiles:
● Python 2.4+ (Python 3.x is not supported yet)● Django 1.2+● pinax.apps.account● django-pagination (http://code.google.com/p/django-pagination/)
These dependencies should be added to your requirements/project.txt file and installed using pip. For example:
pip install -r requirements/project.txt
Installation
Add pinax.apps.basic_profiles to your INSTALLED_APPS:
INSTALLED_APPS = [ # ... "pinax.apps.basic_profiles",]
Hook up pinax.apps.basic_profiles to your URLconf:
urlpatterns = patterns("",
http://pinaxproject.com/docs/dev/apps/basic_profiles/gettingstarted.html (1 of 2) [12/8/10 1:29:43 AM]
Getting started — Pinax v0.9a2 documentation
# ... url(r"^profiles/", include("pinax.apps.basic_profiles.urls")))
Table Of Contents
● Getting started�❍ Prerequisites�❍ Installation
Previous topicpinax.apps.basic_profiles
Next topicReference
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.basic_profiles »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/apps/basic_profiles/gettingstarted.html (2 of 2) [12/8/10 1:29:43 AM]
Reference — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.basic_profiles »
Reference
This document covers various components of pinax.apps.basic_profiles.
Named Urls
The named urls in this app should enable the use of of the {% url %} template tag as well as reverse lookups in your project code without having to know the implementation details of this app.
profile_username_autocomplete
An AJAX call back URL to the pinax.apps.autocomplete_app.views.username_autocomplete_friends app that looks up and provides a list of data to the jQuery autocomplete plugin.
See autocomplete app usage documentation.
profile_list
Upon GET request, this url will render a template named basic_profiles/profiles.html by default with a list of users in context ordered by either date_joined descending or by username ascending. This is further optionally limited with case-insensitive search against the username field if the query parameter search_terms is provided. Likewise, the ordering defaults to date_joined descending which can be overridden by supplying the query parameter order with the value of name.
Examples:
<a href="{% url profile_list %}?search_terms=beth&order=name">Show "beth" Users</a>
This would result in the users context variable limited to users such as Beth, Bethany, Marybeth and would be ordered alphabetically by their username.
http://pinaxproject.com/docs/dev/apps/basic_profiles/reference.html (1 of 5) [12/8/10 1:29:59 AM]
Reference — Pinax v0.9a2 documentation
The value of order and search_terms are also passed to the template as context variables.
profile_detail
This url will render a template named basic_profiles/profile.html by default with is_me and other_user as context variables where is_me is a boolean that indicates whether or not other_user is the same as the authenticated user making the request.
keyword arguments: The username for the profile to view that matches (?P<username>[\w\._-]+)
profile_edit
This url, when POSTed to will process the variables through a pinax.apps.basic_profiles.forms.ProfileForm instance, otherwise it will process a GET request by rendering basic_profiles/profile_edit.html by default for regular requests and basic_profiles/profile_edit_facebox.html for ajax calls. It renders both of these templates with an instance of the pinax.apps.basic_profiles.ProfileForm as profile_form and an instance of pinax.apps.basic_profiles.models.Profile as profile.
Templates
Templates should be placed in an basic_profiles/ folder at the root of one of your template search paths.
profiles.html
context: users, order, search_terms
profile.html
context: is_me, other_user
profile_edit.html
http://pinaxproject.com/docs/dev/apps/basic_profiles/reference.html (2 of 5) [12/8/10 1:29:59 AM]
Reference — Pinax v0.9a2 documentation
context: profile, profile_form
profile_edit_facebox.html
context: profile, profile_form
Modules
pinax.apps.basic_profiles.admin
pinax.apps.basic_profiles.forms
pinax.apps.basic_profiles.management.commands.create_profiles_for_users
pinax.apps.basic_profiles.models
pinax.apps.basic_profiles.templatetags.basic_profile_tags
pinax.apps.basic_profiles.views
Table Of Contents
● Reference�❍ Named Urls■ profile_username_autocomplete■ profile_list■ profile_detail■ profile_edit�❍ Templates
http://pinaxproject.com/docs/dev/apps/basic_profiles/reference.html (3 of 5) [12/8/10 1:29:59 AM]
Reference — Pinax v0.9a2 documentation
■ profiles.html■ profile.html■ profile_edit.html■ profile_edit_facebox.html�❍ Modules■ pinax.apps.basic_profiles.admin■ pinax.apps.basic_profiles.forms■ pinax.apps.basic_profiles.management.commands.create_profiles_for_users■ pinax.apps.basic_profiles.models■ pinax.apps.basic_profiles.templatetags.basic_profile_tags■ pinax.apps.basic_profiles.views
Previous topicGetting started
Next topicpinax.
http://pinaxproject.com/docs/dev/apps/basic_profiles/reference.html (4 of 5) [12/8/10 1:29:59 AM]
Reference — Pinax v0.9a2 documentation
apps.bbauth
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.basic_profiles »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/apps/basic_profiles/reference.html (5 of 5) [12/8/10 1:29:59 AM]
pinax.apps.bbauth — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »
pinax.apps.bbauth
pinax.apps.bbauth provides Single Sign-On (SSO) for users with existing Yahoo! accounts.
● Getting started�❍ Prerequisites�❍ Installation
● Reference�❍ Settings
■ BBAUTH_APP_ID■ BBAUTH_SHARED_SECRET
�❍ Named Urls■ bbauth_login■ bbauth_success■ bbauth_logout
�❍ Modules■ pinax.apps.bbauth.views
http://pinaxproject.com/docs/dev/apps/bbauth/index.html (1 of 2) [12/8/10 1:30:13 AM]
pinax.apps.bbauth — Pinax v0.9a2 documentation
Previous topicReference
Next topicGetting started
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/apps/bbauth/index.html (2 of 2) [12/8/10 1:30:13 AM]
Pinax v0.9a2 documentation—Getting started
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.bbauth »
Getting started
This document is designed to get you up and running with pinax.apps.bbauth...
Prerequisites
These are the requirements to run pinax.apps.bbauth:
● Python 2.4+ (Python 3.x is not supported yet)● Django 1.2+● ybrowserauth 1.2
These dependencies should be added to your requirements/project.txt file and installed using pip. For example:
pip install -r requirements/project.txt
Installation
Add pinax.apps.bbauth to your INSTALLED_APPS:
INSTALLED_APPS = [ # ... "pinax.apps.bbauth",]
Hook up pinax.apps.bbauth to your URLconf:
urlpatterns = patterns("", # ...
http://pinaxproject.com/docs/dev/apps/bbauth/gettingstarted.html (1 of 2) [12/8/10 1:30:27 AM]
Pinax v0.9a2 documentation—Getting started
url(r"^bbauth/", include("pinax.apps.bbauth.urls")))
You should also register your project with Yahoo! to get the tokens you need for the proper settings variables.
Table Of Contents
● Getting started�❍ Prerequisites�❍ Installation
Previous topicpinax.apps.bbauth
Next topicReference
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.bbauth »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/apps/bbauth/gettingstarted.html (2 of 2) [12/8/10 1:30:27 AM]
Reference — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.bbauth »
Reference
This document covers various components of pinax.apps.bbauth.
Settings
BBAUTH_APP_ID
Required. The identification string assigned to your app from registering with Yahoo!:
BBAUTH_APP_ID = ""
BBAUTH_SHARED_SECRET
Required. The shared secret that when paired with your BBAUTH_APP_ID authenticates your application with Yahoo! via a call to ybrowserauth.YBrowserAuth. This value is also assigned via registering with Yahoo!:
BBAUTH_SHARED_SECRET = ""
Named Urls
The named urls in this app should enable the use of of the {% url %} template tag as well as reverse lookups in your project code without having to know the implementation details of this app.
bbauth_login
Authenticates user through Yahoo! redirecting user to Yahoo! login if not already authenticated.
http://pinaxproject.com/docs/dev/apps/bbauth/reference.html (1 of 3) [12/8/10 1:30:42 AM]
Reference — Pinax v0.9a2 documentation
bbauth_success
Validates Yahoo! session and sets token into session.
bbauth_logout
Destroys Yahoo! based app session.
Modules
pinax.apps.bbauth.views
Table Of Contents
● Reference�❍ Settings■ BBAUTH_APP_ID■ BBAUTH_SHARED_SECRET�❍ Named Urls■ bbauth_login■ bbauth_success■ bbauth_logout�❍ Modules■ pinax.apps.bbauth.views
Previous topicGetting started
http://pinaxproject.com/docs/dev/apps/bbauth/reference.html (2 of 3) [12/8/10 1:30:42 AM]
Reference — Pinax v0.9a2 documentation
Next topicpinax.apps.blog
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.bbauth »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/apps/bbauth/reference.html (3 of 3) [12/8/10 1:30:42 AM]
pinax.apps.blog — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »
pinax.apps.blog
A blog app.
● Getting started�❍ Prerequisites�❍ Installation
● Reference�❍ Settings
■ PINAX_ITEMS_PER_FEED■ MARKUP_CHOICES■ RESTRUCTUREDTEXT_FILTER_SETTINGS■ BEHIND_PROXY
�❍ Named Urls■ blog_post■ blog_list_all■ blog_list_user■ blog_list_yours■ blog_new■ blog_edit■ blog_destroy■ blog_form_validate
�❍ Templates■ blogs.html■ post.html■ your_posts.html■ new.html■ edit.html
�❍ Modules■ pinax.apps.blog.admin■ pinax.apps.blog.feeds■ pinax.apps.blog.forms■ pinax.apps.blog.models■ pinax.apps.blog.templatetags.blog_tags■ pinax.apps.blog.templatetags.creole■ pinax.apps.blog.templatetags.restructuredtext■ pinax.apps.blog.templatetags.switchcase■ pinax.apps.blog.views
http://pinaxproject.com/docs/dev/apps/blog/index.html (1 of 2) [12/8/10 1:30:56 AM]
pinax.apps.blog — Pinax v0.9a2 documentation
Previous topicReference
Next topicGetting started
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/apps/blog/index.html (2 of 2) [12/8/10 1:30:56 AM]
Getting started — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.blog »
Getting started
This document is designed to get you up and running with pinax.apps.blog...
Prerequisites
These are the requirements to run pinax.apps.blog:
● Python 2.4+ (Python 3.x is not supported yet)● Django 1.2+● atomformat● creoleparser● docutils● django-friends● django-tagging● django-notification● django-threadedcomments
These dependencies should be added to your requirements/project.txt file and installed using pip. For example:
pip install -r requirements/project.txt
Installation
Add pinax.apps.blog to your INSTALLED_APPS. In addition, make sure required django apps are also installed:
INSTALLED_APPS = [ # ... "friends",
http://pinaxproject.com/docs/dev/apps/blog/gettingstarted.html (1 of 3) [12/8/10 1:31:10 AM]
Getting started — Pinax v0.9a2 documentation
"tagging", "threadedcomments". "notification", "pinax.apps.blog",]
Hook up pinax.apps.blog to your URLconf:
urlpatterns = patterns("", # ... url(r"^blog/", include("pinax.apps.blog.urls")))
Table Of Contents
● Getting started�❍ Prerequisites�❍ Installation
Previous topicpinax.apps.blog
Next topicReference
This Page● Show Source
http://pinaxproject.com/docs/dev/apps/blog/gettingstarted.html (2 of 3) [12/8/10 1:31:10 AM]
Getting started — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.blog »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/apps/blog/gettingstarted.html (3 of 3) [12/8/10 1:31:10 AM]
Reference — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.blog »
Reference
This document covers various components of pinax.apps.blog.
Settings
PINAX_ITEMS_PER_FEED
This setting is used to control how many items in a feed. Defaults to 20:
PINAX_ITEMS_PER_FEED = 50
MARKUP_CHOICES
A list of markup choices to make available in the blog. Defaults to an empty list. Available choices are: [("restructuredtext", u"reStructuredText"), ("textile", u"Textile"), ("markdown", u"Markdown"), ("creole", u"Creole")]
The actual origin of this setting is django-wikiapp which is one of the external applications Pinax integrates. pinax.apps.blog uses it to determine, how a postʼs content should be converted from plain text to HTML.
MARKUP_CHOICES = [("textile", "Textile"), ("markdown", "Markdown")]
RESTRUCTUREDTEXT_FILTER_SETTINGS
Using this option you can pass additional settings as dictionary through the restructuredtext template library to the underlying docutils.core.publish_parts function. Defaults to empty dict.
RESTRUCTUREDTEXT_FILTER_SETTINGS = {}http://pinaxproject.com/docs/dev/apps/blog/reference.html (1 of 7) [12/8/10 1:31:27 AM]
Reference — Pinax v0.9a2 documentation
BEHIND_PROXY
the usersʼ real IP addresses are stored when they create blog posts. When activated the blog takes the userʼs IP address from request.META['HTTP_X_FORWARDED_FOR'] instead of request.META['REMOTE_ADDR']. Defaults to False.
BEHIND_PROXY = True
Named Urls
The named urls in this app should enable the use of of the {% url %} template tag as well as reverse lookups in your project code without having to know the implementation details of this app.
blog_post
Render a template with a specific blog post entry in context.
keyword arguments: (?P<username>[-\w]+)/(?P<year>\d{4})/(?P<month>\d{2})/(?P<slug>[-\w]+)
blog_list_all
Render a template with a queryset in context of all blog posts.
blog_list_user
Renders a template with a queryset in context of blog posts that are owned by a specified username.
keyword arguments: The username to list blog posts for matching (?P<username>\w+).
blog_list_yours
http://pinaxproject.com/docs/dev/apps/blog/reference.html (2 of 7) [12/8/10 1:31:27 AM]
Reference — Pinax v0.9a2 documentation
Renders a template with a queryset in context of blog posts that are owned by the logged in user.
blog_new
A GET request renders a template with a form instance in context. A POST request processes the data from this form and redirects user to blog_list_yours.
blog_edit
Upon a GET request a form is rendered to edit the blog entry. This urls also will process the POST request from submitting the form. After updating the post the response will be redirected to blog_list_yours.
arguments: The id for the blog post that matches (\d+).
blog_destroy
Delete a blog post that is yours on POST requests. Otherwise, it redirects the user to blog_list_yours.
arguments: The id for the blog post that matches (\d+).
blog_form_validate
Uses the ajax_validation app, it validates the blog post with the pinax.apps.blog.forms.BlogForm.
Templates
Templates should be placed in an blog/ folder at the root of one of your template search paths.
blogs.html
context: blogs
http://pinaxproject.com/docs/dev/apps/blog/reference.html (3 of 7) [12/8/10 1:31:27 AM]
Reference — Pinax v0.9a2 documentation
post.html
context: post
your_posts.html
context: blogs
new.html
context: blog_form
edit.html
context: blog_form, post
Modules
pinax.apps.blog.admin
pinax.apps.blog.feeds
pinax.apps.blog.forms
pinax.apps.blog.models
pinax.apps.blog.templatetags.blog_tags
pinax.apps.blog.templatetags.creole
pinax.apps.blog.templatetags.restructuredtext
http://pinaxproject.com/docs/dev/apps/blog/reference.html (4 of 7) [12/8/10 1:31:27 AM]
Reference — Pinax v0.9a2 documentation
pinax.apps.blog.templatetags.switchcase
pinax.apps.blog.views
Table Of Contents
● Reference�❍ Settings■ PINAX_ITEMS_PER_FEED■ MARKUP_CHOICES■ RESTRUCTUREDTEXT_FILTER_SETTINGS■ BEHIND_PROXY�❍ Named Urls■ blog_post■ blog_list_all■ blog_list_user■ blog_list_yours■ blog_new■ blog_edit■ blog_destroy■ blog_form_validate�❍ Templates■ blogs.html■ post.html■ your_posts.html■ new.html■ edit.html�❍ Modules■ pinax.apps.blog.
http://pinaxproject.com/docs/dev/apps/blog/reference.html (5 of 7) [12/8/10 1:31:27 AM]
Reference — Pinax v0.9a2 documentation
admin■ pinax.apps.blog.feeds■ pinax.apps.blog.forms■ pinax.apps.blog.models■ pinax.apps.blog.templatetags.blog_tags■ pinax.apps.blog.templatetags.creole■ pinax.apps.blog.templatetags.restructuredtext■ pinax.apps.blog.templatetags.switchcase■ pinax.apps.blog.views
Previous topicGetting started
Next topic
http://pinaxproject.com/docs/dev/apps/blog/reference.html (6 of 7) [12/8/10 1:31:27 AM]
Reference — Pinax v0.9a2 documentation
pinax.apps.photos
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.blog »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/apps/blog/reference.html (7 of 7) [12/8/10 1:31:27 AM]
pinax.apps.photos — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »
pinax.apps.photos
An app for managing photographs/images.
● Getting started�❍ Prerequisites�❍ Installation
● Reference�❍ Named URLs
■ photos■ photo_details■ photo_upload■ photos_yours■ photos_member■ photo_destroy■ photo_edit
�❍ Templates■ upload.html■ yourphotos.html■ latest.html■ details.html■ memberphotos.html■ edit.html
�❍ Modules■ pinax.apps.photos.admin■ pinax.apps.photos.forms■ pinax.apps.photos.models■ pinax.apps.photos.templatetags.photo_tags■ pinax.apps.photos.views
http://pinaxproject.com/docs/dev/apps/photos/index.html (1 of 2) [12/8/10 1:31:41 AM]
pinax.apps.photos — Pinax v0.9a2 documentation
Previous topicReference
Next topicGetting started
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/apps/photos/index.html (2 of 2) [12/8/10 1:31:41 AM]
Getting started — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.photos »
Getting started
This document is designed to get you up and running with pinax.apps.photos...
Prerequisites
These are the requirements to run pinax.apps.photos:
● Python 2.4+ (Python 3.x is not supported yet)● Django 1.2+● django-photologue 2.3
These dependencies should be added to your requirements/project.txt file and installed using pip. For example:
pip install -r requirements/project.txt
Installation
Add pinax.apps.photos to your INSTALLED_APPS:
INSTALLED_APPS = [ # ... "pinax.apps.photos",]
Hook up pinax.apps.photos to your URLconf:
urlpatterns = patterns("", # ...
http://pinaxproject.com/docs/dev/apps/photos/gettingstarted.html (1 of 2) [12/8/10 1:31:55 AM]
Getting started — Pinax v0.9a2 documentation
url(r"^photos/", include("pinax.apps.photos.urls")))
Table Of Contents
● Getting started�❍ Prerequisites�❍ Installation
Previous topicpinax.apps.photos
Next topicReference
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.photos »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/apps/photos/gettingstarted.html (2 of 2) [12/8/10 1:31:55 AM]
Reference — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.photos »
Reference
This document covers various components of pinax.apps.photos.
Named URLs
The named URLs in this app should enable the use of of the {% url %} template tag as well as reverse lookups in your project code without having to know the implementation details of this app.
photos
Renders the photos/latest.html template with a list of recent photos in context.
photo_details
Renders the photos/details.html template with the photo object in context along with some other relevant context variables.
keyword arguments: The id of the photo matching (?P<id>\d+)
photo_upload
For a GET request, this URL will render the photos/upload.html template with an instance of the pinax.apps.photos.forms.PhotoUploadForm in context as a variable named photo_form.
For a POST request to this URL, the photo_form will be processed – the upload handled and the database record created before redirecting to photo_details.
photos_yourshttp://pinaxproject.com/docs/dev/apps/photos/reference.html (1 of 5) [12/8/10 1:32:11 AM]
Reference — Pinax v0.9a2 documentation
Renders the photos/yourphotos.html template with a collection of photos that belong to the logged in user as the photos context variable.
photos_member
Renders the photos/memberphotos.html template with a collection of photos for a particular user that are flagged as public = True.
keyword arguments: The username of the member matching (?P<username>[\w]+)
photo_destroy
A GET request to this URL will simply redirect the user to photos_yours.
A POST request to this URL will delete the photo if the user is the owner of the image. Then it will redirect the user to photos_yours.
keyword arguments: The id of the photo matching (?P<id>\d+)
photo_edit
A GET request to this URL will render the photos/edit.html with an instance of the pinax.apps.photos.forms.PhotoEditForm in context as the photo_form context variable along with photo and photo_url.
A POST request to this URL will process the data submitted in the form, only saving the data if the user requesting the update is the owner of the photo. It will then redirect the user to photo_details.
keyword arguments: The id of the photo matching (?P<id>\d+)
Templates
http://pinaxproject.com/docs/dev/apps/photos/reference.html (2 of 5) [12/8/10 1:32:11 AM]
Reference — Pinax v0.9a2 documentation
Templates should be placed in an photos/ folder at the root of one of your template search paths.
upload.html
context: group, group_base, photo_form
yourphotos.html
context: group, group_base, photos
latest.html
context: group, group_base, photos
details.html
context: group, group_base, photo, host, photo_url, is_me
memberphotos.html
context: group, group_base, photos
edit.html
context: group, group_base, photo, photo_form, photo_url
Modules
pinax.apps.photos.admin
pinax.apps.photos.forms
pinax.apps.photos.models
http://pinaxproject.com/docs/dev/apps/photos/reference.html (3 of 5) [12/8/10 1:32:11 AM]
Reference — Pinax v0.9a2 documentation
pinax.apps.photos.templatetags.photo_tags
pinax.apps.photos.views
Table Of Contents
● Reference�❍ Named URLs■ photos■ photo_details■ photo_upload■ photos_yours■ photos_member■ photo_destroy■ photo_edit�❍ Templates■ upload.html■ yourphotos.html■ latest.html■ details.html■ memberphotos.html■ edit.html�❍ Modules■ pinax.apps.photos.admin■ pinax.apps.
http://pinaxproject.com/docs/dev/apps/photos/reference.html (4 of 5) [12/8/10 1:32:11 AM]
Reference — Pinax v0.9a2 documentation
photos.forms■ pinax.apps.photos.models■ pinax.apps.photos.templatetags.photo_tags■ pinax.apps.photos.views
Previous topicGetting started
Next topicpinax.apps.profiles
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.photos »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/apps/photos/reference.html (5 of 5) [12/8/10 1:32:11 AM]
pinax.apps.profiles — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »
pinax.apps.profiles
The profiles app provides a simple user profile for every user that registers/creates an account.
● Getting started�❍ Prerequisites�❍ Installation
● Reference�❍ Named URLs
■ profile_username_autocomplete■ profile_list■ profile_detail■ profile_edit
�❍ Templates■ profiles.html■ profile.html■ profile_edit.html■ profile_edit_facebox.html
�❍ Modules■ pinax.apps.profiles.admin■ pinax.apps.profiles.forms■ pinax.apps.profiles.models■ pinax.apps.profiles.templatetags.profile_tags■ pinax.apps.profiles.views
http://pinaxproject.com/docs/dev/apps/profiles/index.html (1 of 2) [12/8/10 1:32:25 AM]
pinax.apps.profiles — Pinax v0.9a2 documentation
Previous topicReference
Next topicGetting started
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/apps/profiles/index.html (2 of 2) [12/8/10 1:32:25 AM]
Getting started — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.profiles »
Getting started
This document is designed to get you up and running with pinax.apps.profiles...
Prerequisites
These are the requirements to run pinax.apps.profiles:
● Python 2.4+ (Python 3.x is not supported yet)● Django 1.2+● django-friends 0.1.5● django-microblogging 0.2.dev1
These dependencies should be added to your requirements/project.txt file and installed using pip. For example:
pip install -r requirements/project.txt
Installation
Add pinax.apps.profiles to your INSTALLED_APPS:
INSTALLED_APPS = [ # ... "pinax.apps.profiles",]
Hook up pinax.apps.profiles to your URLconf:
urlpatterns = patterns("",
http://pinaxproject.com/docs/dev/apps/profiles/gettingstarted.html (1 of 2) [12/8/10 1:32:39 AM]
Getting started — Pinax v0.9a2 documentation
# ... url(r"^profiles/", include("pinax.apps.profiles.urls")))
Table Of Contents
● Getting started�❍ Prerequisites�❍ Installation
Previous topicpinax.apps.profiles
Next topicReference
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.profiles »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/apps/profiles/gettingstarted.html (2 of 2) [12/8/10 1:32:39 AM]
Reference — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.profiles »
Reference
This document covers various components of pinax.apps.profiles.
Named URLs
The named URLs in this app should enable the use of of the {% url %} template tag as well as reverse lookups in your project code without having to know the implementation details of this app.
profile_username_autocomplete
An AJAX call back URL to the pinax.apps.autocomplete_app.views.username_autocomplete_friends app that looks up and provides a list of data to the jQuery autocomplete plugin.
See autocomplete app usage documentation.
profile_list
Upon GET request, this url will render a template named profiles/profiles.html by default with a list of users in context ordered by either date_joined descending or by username ascending. This is further optionally limited with case-insensitive search against the username field if the query parameter search_terms is provided. Likewise, the ordering defaults to date_joined descending which can be overridden by supplying the query parameter order with the value of name.
Examples:
<a href="{% url profile_list %}?search_terms=beth&order=name">Show "beth" Users</a>
This would result in the users context variable limited to users such as Beth, Bethany, Marybeth and would be ordered alphabetically by their username.
http://pinaxproject.com/docs/dev/apps/profiles/reference.html (1 of 5) [12/8/10 1:32:55 AM]
Reference — Pinax v0.9a2 documentation
The value of order and search_terms are also passed to the template as context variables.
profile_detail
This url will render a template named profiles/profile.html by default with is_me and other_user as context variables where is_me is a boolean that indicates whether or not other_user is the same as the authenticated user making the request.
keyword arguments: The username for the profile to view that matches (?P<username>[\w\._-]+)
profile_edit
This url, when POSTed to will process the variables through a pinax.apps.profiles.forms.ProfileForm instance, otherwise it will process a GET request by rendering profiles/profile_edit.html by default for regular requests and profiles/profile_edit_facebox.html for ajax calls. It renders both of these templates with an instance of the pinax.apps.profiles.ProfileForm as profile_form and an instance of pinax.apps.profiles.models.Profile as profile.
Templates
Templates should be placed in an profiles/ folder at the root of one of your template search paths.
profiles.html
context: users, order, search_terms
profile.html
context: is_me, is_friend, is_following, other_user, other_friends, invite_form, previous_invitations_to, previous_invitations_from
profile_edit.html
context: profile, profile_form
http://pinaxproject.com/docs/dev/apps/profiles/reference.html (2 of 5) [12/8/10 1:32:55 AM]
Reference — Pinax v0.9a2 documentation
profile_edit_facebox.html
context: profile, profile_form
Modules
pinax.apps.profiles.admin
pinax.apps.profiles.forms
pinax.apps.profiles.models
pinax.apps.profiles.templatetags.profile_tags
pinax.apps.profiles.views
Table Of Contents
● Reference�❍ Named URLs■ profile_username_autocomplete■ profile_list■ profile_detail■ profile_edit�❍ Templates■ profiles.html■ profile.html■ profile_edit.html
http://pinaxproject.com/docs/dev/apps/profiles/reference.html (3 of 5) [12/8/10 1:32:55 AM]
Reference — Pinax v0.9a2 documentation
■ profile_edit_facebox.html�❍ Modules■ pinax.apps.profiles.admin■ pinax.apps.profiles.forms■ pinax.apps.profiles.models■ pinax.apps.profiles.templatetags.profile_tags■ pinax.apps.profiles.views
Previous topicGetting started
Next topicpinax.apps.projects
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.profiles »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1. http://pinaxproject.com/docs/dev/apps/profiles/reference.html (4 of 5) [12/8/10 1:32:55 AM]
Reference — Pinax v0.9a2 documentation
http://pinaxproject.com/docs/dev/apps/profiles/reference.html (5 of 5) [12/8/10 1:32:55 AM]
pinax.apps.projects — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »
pinax.apps.projects
An app to manage projects and project members.
● Getting started�❍ Prerequisites�❍ Installation
● Reference�❍ Named URLs
■ project_list■ project_create■ your_projects■ project_detail■ project_delete
�❍ Templates■ create.html■ project.html■ projects.html■ your_projects.html
�❍ Modules■ pinax.apps.projects.admin■ pinax.apps.projects.forms■ pinax.apps.projects.models■ pinax.apps.projects.templatetags.projects_tags■ pinax.apps.projects.views
Previous topicReference
Next topicGetting started
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/apps/projects/index.html [12/8/10 1:33:09 AM]
Getting started — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.projects »
Getting started
This document is designed to get you up and running with pinax.apps.projects...
Prerequisites
These are the requirements to run pinax.apps.projects:
● Python 2.4+ (Python 3.x is not supported yet)● Django 1.2+● django-groups 0.1.dev10● django-notification 0.1.4● django-wikiapp 0.2.0● ref:pinax.apps.tasks● ref:pinax.apps.topics
These dependencies should be added to your requirements/project.txt file and installed using pip. For example:
pip install -r requirements/project.txt
Installation
Add pinax.apps.projects to your INSTALLED_APPS:
INSTALLED_APPS = [ # ... "groups", "notification", "pinax.apps.tasks", "pinax.apps.topics",
http://pinaxproject.com/docs/dev/apps/projects/gettingstarted.html (1 of 3) [12/8/10 1:33:23 AM]
Getting started — Pinax v0.9a2 documentation
"pinax.apps.projects", "wiki"]
Hook up pinax.apps.projects to your URLconf:
urlpatterns = patterns("", # ... url(r"^projects/", include("pinax.apps.projects.urls")))
Table Of Contents
● Getting started�❍ Prerequisites�❍ Installation
Previous topicpinax.apps.projects
Next topicReference
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.projects »
http://pinaxproject.com/docs/dev/apps/projects/gettingstarted.html (2 of 3) [12/8/10 1:33:23 AM]
Getting started — Pinax v0.9a2 documentation
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/apps/projects/gettingstarted.html (3 of 3) [12/8/10 1:33:23 AM]
Reference — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.projects »
Reference
This document covers various components of pinax.apps.projects.
Named URLs
The named URLs in this app should enable the use of of the {% url %} template tag as well as reverse lookups in your project code without having to know the implementation details of this app.
project_list
Renders the projects/projects.html template with a list of all Project objects in context as projects, optionally filtered via the query parameter search on the name and description fields.
project_create
On GET requests, renders the projects/create.html template with an instance of pinax.apps.projects.forms.ProjectForm as the project_form context variable.
On POST requests, it processes the pinax.apps.projects.forms.ProjectForm form to create a new form. It then redirects to project_detail.
your_projects
Renders the projects/your_projects.html template with a list of all Project objects where the current logged in user is a member as the context variable projects.
project_detail
Renders the projects/project.html template with a single Project object as the context variable
http://pinaxproject.com/docs/dev/apps/projects/reference.html (1 of 5) [12/8/10 1:33:38 AM]
Reference — Pinax v0.9a2 documentation
project.
If this URL receives a POST request it will either add the current user to the project via the pinax.apps.projects.forms.AddUserForm or will update the project via the pinax.apps.projects.forms.ProjectUpdateForm.
keyword arguments: The slug that identifies the project that matches (?P<group_slug>[-\w]+).
project_delete
Upon POST request and validation that user is the project creator and is the only remaining member on the project, this will delete the project. After deletion, whether failed or succeeded, it will redirect the user to project_list
keyword arguments: The slug that identifies the project that matches (?P<group_slug>[-\w]+).
Templates
Templates should be placed in an projects/ folder at the root of one of your template search paths.
create.html
context: project_form
project.html
context: project_form, adduser_form, project, group, is_member
projects.html
context: projects, search_terms
your_projects.htmlhttp://pinaxproject.com/docs/dev/apps/projects/reference.html (2 of 5) [12/8/10 1:33:38 AM]
Reference — Pinax v0.9a2 documentation
context: projects
Modules
pinax.apps.projects.admin
pinax.apps.projects.forms
pinax.apps.projects.models
pinax.apps.projects.templatetags.projects_tags
pinax.apps.projects.views
Table Of Contents
● Reference�❍ Named URLs■ project_list■ project_create■ your_projects■ project_detail■ project_delete�❍ Templates■ create.html■ project.html■ projects.html■ your_projects.
http://pinaxproject.com/docs/dev/apps/projects/reference.html (3 of 5) [12/8/10 1:33:38 AM]
Reference — Pinax v0.9a2 documentation
html�❍ Modules■ pinax.apps.projects.admin■ pinax.apps.projects.forms■ pinax.apps.projects.models■ pinax.apps.projects.templatetags.projects_tags■ pinax.apps.projects.views
Previous topicGetting started
Next topicpinax.apps.signup_codes
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.projects »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/apps/projects/reference.html (4 of 5) [12/8/10 1:33:38 AM]
Reference — Pinax v0.9a2 documentation
http://pinaxproject.com/docs/dev/apps/projects/reference.html (5 of 5) [12/8/10 1:33:38 AM]
pinax.apps.signup_codes — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »
pinax.apps.signup_codes
An app to facilitate running an invite system and tracking those invites, for example in running a private beta of a site.
● Getting started�❍ Prerequisites�❍ Installation
● Reference�❍ Settings
■ ACCOUNT_OPEN_SIGNUP�❍ Templates
■ admin_invite_user.html■ account/signup.html■ failure.html
�❍ Modules■ pinax.apps.signup_codes.admin■ pinax.apps.signup_codes.forms■ pinax.apps.signup_codes.models■ pinax.apps.signup_codes.views
http://pinaxproject.com/docs/dev/apps/signup_codes/index.html (1 of 2) [12/8/10 1:33:52 AM]
pinax.apps.signup_codes — Pinax v0.9a2 documentation
Previous topicReference
Next topicGetting started
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/apps/signup_codes/index.html (2 of 2) [12/8/10 1:33:52 AM]
Getting started — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.signup_codes »
Getting started
This document is designed to get you up and running with pinax.apps.signup_codes...
Prerequisites
These are the requirements to run pinax.apps.signup_codes:
● Python 2.4+ (Python 3.x is not supported yet)● Django 1.2+● pinax.apps.account
These dependencies should be added to your requirements/project.txt file and installed using pip. For example:
pip install -r requirements/project.txt
Installation
Add pinax.apps.signup_codes to your INSTALLED_APPS:
INSTALLED_APPS = [ # ... "pinax.apps.signup_codes",]
http://pinaxproject.com/docs/dev/apps/signup_codes/gettingstarted.html (1 of 2) [12/8/10 1:34:06 AM]
Getting started — Pinax v0.9a2 documentation
Table Of Contents
● Getting started�❍ Prerequisites�❍ Installation
Previous topicpinax.apps.signup_codes
Next topicReference
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.signup_codes »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/apps/signup_codes/gettingstarted.html (2 of 2) [12/8/10 1:34:06 AM]
Reference — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.signup_codes »
Reference
This document covers various components of pinax.apps.signup_codes.
Settings
ACCOUNT_OPEN_SIGNUP
Required. Permit signing up for an account via OpenID.
ACCOUNT_OPEN_SIGNUP = True
Templates
Templates should be placed in an signup_codes/ folder unless otherwise noted, at the root of one of your template search paths.
admin_invite_user.html
context: group, group_base, title, form
account/signup.html
context: group, group_base, code, form
failure.html
context: group, group_base, code
http://pinaxproject.com/docs/dev/apps/signup_codes/reference.html (1 of 3) [12/8/10 1:34:20 AM]
Reference — Pinax v0.9a2 documentation
Modules
pinax.apps.signup_codes.admin
pinax.apps.signup_codes.forms
pinax.apps.signup_codes.models
pinax.apps.signup_codes.views
Table Of Contents
● Reference�❍ Settings■ ACCOUNT_OPEN_SIGNUP�❍ Templates■ admin_invite_user.html■ account/signup.html■ failure.html�❍ Modules■ pinax.apps.signup_codes.admin■ pinax.apps.signup_codes.forms■ pinax.apps.
http://pinaxproject.com/docs/dev/apps/signup_codes/reference.html (2 of 3) [12/8/10 1:34:20 AM]
Reference — Pinax v0.9a2 documentation
signup_codes.models■ pinax.apps.signup_codes.views
Previous topicGetting started
Next topicpinax.apps.tagging_utils
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.signup_codes »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/apps/signup_codes/reference.html (3 of 3) [12/8/10 1:34:20 AM]
pinax.apps.tagging_utils — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »
pinax.apps.tagging_utils
Provides an autocomplete text input widget for tags.
● Getting started�❍ Prerequisites�❍ Installation
● Reference�❍ Settings
■ STATIC_URL�❍ Named URLs
■ tagging_utils_autocomplete�❍ Modules
■ pinax.apps.tagging_utils.views■ pinax.apps.tagging_utils.widgets
Previous topicReference
Next topicGetting started
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/apps/tagging_utils/index.html [12/8/10 1:34:34 AM]
Getting started — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.tagging_utils »
Getting started
This document is designed to get you up and running with pinax.apps.tagging_utils...
Prerequisites
These are the requirements to run pinax.apps.tagging_utils:
● Python 2.4+ (Python 3.x is not supported yet)● Django 1.2+● django-tagging
These dependencies should be added to your requirements/project.txt file and installed using pip. For example:
pip install -r requirements/project.txt
Installation
Add tagging and pinax.apps.tagging_utils to your INSTALLED_APPS:
INSTALLED_APPS = [ # ... "tagging", "pinax.apps.tagging_utils",]
Hook up pinax.apps.tagging_utils to your URLconf:
urlpatterns = patterns("",
http://pinaxproject.com/docs/dev/apps/tagging_utils/gettingstarted.html (1 of 2) [12/8/10 1:34:48 AM]
Getting started — Pinax v0.9a2 documentation
# ... url(r"^tagging_utils/", include("pinax.apps.tagging_utils.urls")))
Table Of Contents
● Getting started�❍ Prerequisites�❍ Installation
Previous topicpinax.apps.tagging_utils
Next topicReference
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.tagging_utils »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/apps/tagging_utils/gettingstarted.html (2 of 2) [12/8/10 1:34:48 AM]
Reference — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.tagging_utils »
Reference
This document covers various components of pinax.apps.tagging_utils.
Settings
STATIC_URL
Required. An URL for static files that need serving.
STATIC_URL = "/static/"
Named URLs
The named URLs in this app should enable the use of of the {% url %} template tag as well as reverse lookups in your project code without having to know the implementation details of this app.
tagging_utils_autocomplete
This URL provides an Ajax callback that will supply delimited data for the jQuery autocomplete plugin to display autocomplete info for tags in a UI.
keyword arguments:
The app_label and model that tags are associated with and that match (?P<app_label>\w+)/(?P<model>\w+).
Modules
pinax.apps.tagging_utils.viewshttp://pinaxproject.com/docs/dev/apps/tagging_utils/reference.html (1 of 3) [12/8/10 1:35:03 AM]
Reference — Pinax v0.9a2 documentation
pinax.apps.tagging_utils.widgets
Table Of Contents
● Reference�❍ Settings■ STATIC_URL�❍ Named URLs■ tagging_utils_autocomplete�❍ Modules■ pinax.apps.tagging_utils.views■ pinax.apps.tagging_utils.widgets
Previous topicGetting started
Next topicpinax.apps.tasks
This Page● Show Source
http://pinaxproject.com/docs/dev/apps/tagging_utils/reference.html (2 of 3) [12/8/10 1:35:03 AM]
Reference — Pinax v0.9a2 documentation● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.tagging_utils »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/apps/tagging_utils/reference.html (3 of 3) [12/8/10 1:35:03 AM]
pinax.apps.tasks — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »
pinax.apps.tasks
An app to manage tasks.
● Getting started�❍ Prerequisites�❍ Installation
● Reference�❍ Settings
■ PINAX_ITEMS_PER_FEED■ TASKS_WORKFLOW_MODULE■ STATIC_URL
�❍ Named URLs■ task_list■ task_focus■ task_add■ task_add_paste■ task_detail■ tasks_for_user■ tasks_mini_list■ tasks_history_list■ tasks_history■ tasks_nudge■ tasks_export_state_transitions
�❍ Templates■ task_list.html■ add.html■ task.html■ user_tasks.html■ mini_list.html■ focus.html■ tasks_history_list.html■ task_history.html
�❍ Modules■ pinax.apps.tasks.admin■ pinax.apps.tasks.feeds■ pinax.apps.tasks.fields■ pinax.apps.tasks.filters■ pinax.apps.tasks.forms■ pinax.apps.tasks.models■ pinax.apps.tasks.templatetags.tasks_tags■ pinax.apps.tasks.views
http://pinaxproject.com/docs/dev/apps/tasks/index.html (1 of 2) [12/8/10 1:35:18 AM]
pinax.apps.tasks — Pinax v0.9a2 documentation
■ pinax.apps.tasks.widgets■ pinax.apps.tasks.workflow
Previous topicReference
Next topicGetting started
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/apps/tasks/index.html (2 of 2) [12/8/10 1:35:18 AM]
Getting started — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.tasks »
Getting started
This document is designed to get you up and running with pinax.apps.tasks...
Prerequisites
These are the requirements to run pinax.apps.tasks:
● Python 2.4+ (Python 3.x is not supported yet)● Django 1.2+● django-attachments 0.3.1● django-atomformat 0.1.1.dev1● django-filter 0.5.3● django-tagging 0.3.1● django-notification 0.1.4● django-threadedcomments 0.5.2● dpaste [optional]
These dependencies should be added to your requirements/project.txt file and installed using pip. For example:
pip install -r requirements/project.txt
Installation
Add pinax.apps.tasks to your INSTALLED_APPS:
INSTALLED_APPS = [ # ... "pinax.apps.tasks",
http://pinaxproject.com/docs/dev/apps/tasks/gettingstarted.html (1 of 2) [12/8/10 1:35:32 AM]
Getting started — Pinax v0.9a2 documentation
]
Hook up pinax.apps.account to your URLconf:
urlpatterns = patterns("", # ... url(r"^tasks/", include("pinax.apps.tasks.urls")))
Table Of Contents
● Getting started�❍ Prerequisites�❍ Installation
Previous topicpinax.apps.tasks
Next topicReference
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.tasks »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/apps/tasks/gettingstarted.html (2 of 2) [12/8/10 1:35:32 AM]
Reference — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.tasks »
Reference
This document covers various components of pinax.apps.tasks.
Settings
PINAX_ITEMS_PER_FEED
The number of tasks items to include in the feed. Defaults to 20.
PINAX_ITEMS_PER_FEED = 100
TASKS_WORKFLOW_MODULE
The module that controls the workflow of a task. Defaults to pinax.apps.tasks.workflow.
TASKS_WORKFLOW_MODULE = "myproject.workflow"
STATIC_URL
Required. An URL for static files that need serving.
STATIC_URL = "/static/"
Named URLs
The named URLs in this app should enable the use of of the {% url %} template tag as well as reverse lookups in your project code without having to know the implementation details of this app.
http://pinaxproject.com/docs/dev/apps/tasks/reference.html (1 of 8) [12/8/10 1:35:49 AM]
Reference — Pinax v0.9a2 documentation
task_list
Renders the task_list.html template with a filtered list of tasks in context.
task_focus
Renders the focus.html template filtering down Tasks by either modified, state, assignee, or tag.
keyword arguments:
The field/value with which to filter down the Tasks matching (?P<field>modified|state|assignee|tag)/(?P<value>[^/]+)/.
task_add
For GET requests, renders add.html template with a pinax.apps.tasks.forms.TaskForm instance in context.
For a POST request, process the form, redirecting either to task_add or task_list.
task_add_paste
For GET requests, renders add.html template with a pinax.apps.tasks.forms.TaskForm instance in context.
For a POST request, processes the form, redirecting either to task_add or task_list.
keyword arguments:
There is an optional argument that is the secret_id for the dpaste.models.Snippet. It must match (?P<secret_id>\w+).
task_detail
For GET requests, renders the task.html template with a particular pinax.apps.tasks.models.Task object as well as an instance of pinax.apps.tasks.forms.EditTaskForm.
For POST requests, processes the form.http://pinaxproject.com/docs/dev/apps/tasks/reference.html (2 of 8) [12/8/10 1:35:49 AM]
Reference — Pinax v0.9a2 documentation
keyword arguments: The id of the tasks you wish to view/edit: (?P<id>\d+).
tasks_for_user
Renders the user_tasks.html template with tasks for the user whoʼs username is specified in the URL argument.
keyword arguments: The username of the user whoʼs tickets you wish to view. Must match (?P<username>[-\w]+).
tasks_mini_list
Renders the mini_list.html template with all the logged in userʼs assigned tasks.
tasks_history_list
Renders the tasks_history_list.html template with a list of pinax.apps.models.TaskHistory objects where object_id is None.
tasks_history
Renders the task_history.html template with a pinax.apps.tasks.models.Task object and a list of pinax.apps.tasks.models.TaskHistory objects that are linked to that object.
keyword arguments: The id of the Task to view history on. Must match (?P<id>\d+).
tasks_nudge
Toggles a pinax.apps.tasks.models.Nudge objectʼs existence for a given pinax.apps.tasks.models.Task object and user context. If the a Nudge exists, it gets deleted. If it doesnʼt itʼs created.
keyword arguments:
http://pinaxproject.com/docs/dev/apps/tasks/reference.html (3 of 8) [12/8/10 1:35:49 AM]
Reference — Pinax v0.9a2 documentation
The id of the Task to nudge. Must match (?P<id>\d+).
tasks_export_state_transitions
Returns a data dump via a text/csv file of workflow state data.
Templates
Templates should be placed in an tasks/ folder at the root of one of your template search paths.
task_list.html
context: group, group_base, group_by, gbqs, is_member, task_filter, tasks, querystring
add.html
context: group, group_base, is_member, task_form
task.html
context: group, group_base, nudge, task, is_member, form
user_tasks.html
context: group, group_base, assigned_filter, created_filter, nudged_filter, assigned_tasks, created_tasks, nudged_tasks, other_user, bookmarklet
mini_list.html
context: group, group_base, assigned_tasks
focus.html
context: group, group_base, task_filter, tasks, field, value, group_by, gbqs, is_member
http://pinaxproject.com/docs/dev/apps/tasks/reference.html (4 of 8) [12/8/10 1:35:49 AM]
Reference — Pinax v0.9a2 documentation
tasks_history_list.html
context: group, group_base, task_history, is_member
task_history.html
context: group, group_base, task_history, task, nudge_history
Modules
pinax.apps.tasks.admin
pinax.apps.tasks.feeds
pinax.apps.tasks.fields
pinax.apps.tasks.filters
pinax.apps.tasks.forms
pinax.apps.tasks.models
pinax.apps.tasks.templatetags.tasks_tags
pinax.apps.tasks.views
pinax.apps.tasks.widgets
pinax.apps.tasks.workflow
http://pinaxproject.com/docs/dev/apps/tasks/reference.html (5 of 8) [12/8/10 1:35:49 AM]
Reference — Pinax v0.9a2 documentation
Table Of Contents
● Reference�❍ Settings■ PINAX_ITEMS_PER_FEED■ TASKS_WORKFLOW_MODULE■ STATIC_URL�❍ Named URLs■ task_list■ task_focus■ task_add■ task_add_paste■ task_detail■ tasks_for_user■ tasks_mini_list■ tasks_history_list■ tasks_history■ tasks_nudge■ tasks_export_state_transitions�❍ Templates■ task_list.html■ add.html■ task.html■ user_tasks.html■ mini_list.html■ focus.html■ tasks_history_list.html■ task_history.html�❍ Modules■ pinax.apps.tasks.admin
http://pinaxproject.com/docs/dev/apps/tasks/reference.html (6 of 8) [12/8/10 1:35:49 AM]
Reference — Pinax v0.9a2 documentation
■ pinax.apps.tasks.feeds■ pinax.apps.tasks.fields■ pinax.apps.tasks.filters■ pinax.apps.tasks.forms■ pinax.apps.tasks.models■ pinax.apps.tasks.templatetags.tasks_tags■ pinax.apps.tasks.views■ pinax.apps.tasks.widgets■ pinax.apps.tasks.workflow
Previous topicGetting started
Next topic
http://pinaxproject.com/docs/dev/apps/tasks/reference.html (7 of 8) [12/8/10 1:35:49 AM]
Reference — Pinax v0.9a2 documentation
pinax.apps.threadedcomments_extras
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.tasks »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/apps/tasks/reference.html (8 of 8) [12/8/10 1:35:49 AM]
pinax.apps.threadedcomments_extras — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »
pinax.apps.threadedcomments_extras
An app that provides {% comments object %} template tag for threadedcomments.
● Getting started�❍ Prerequisites�❍ Installation�❍ Usage
● Reference�❍ Templates
■ threadedcomments/comments.html�❍ Modules
■ pinax.apps.threadedcomments_extras.templatetags.comments_tag
Previous topicReference
Next topicGetting started
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »
http://pinaxproject.com/docs/dev/apps/threadedcomments_extras/index.html (1 of 2) [12/8/10 1:36:03 AM]
pinax.apps.threadedcomments_extras — Pinax v0.9a2 documentation
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/apps/threadedcomments_extras/index.html (2 of 2) [12/8/10 1:36:03 AM]
Getting started — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.threadedcomments_extras »
Getting started
This document is designed to get you up and running with the pinax.apps.threadedcomments_extras...
Prerequisites
These are the requirements to run pinax.apps.threadedcomments_extras:
● Python 2.4+ (Python 3.x is not supported yet)● Django 1.2+
These dependencies should be added to your requirements/project.txt file and installed using pip. For example:
pip install -r requirements/project.txt
Installation
Add pinax.apps.threadedcomments_extras to your INSTALLED_APPS:
INSTALLED_APPS = [ # ... "pinax.apps.threadedcomments_extras",]
Usage
After installing this app in your Django project, you now have access to easily add comments for a particular object in one of your templates.
Simple, load the template tag and call it within your template.
http://pinaxproject.com/docs/dev/apps/threadedcomments_extras/gettingstarted.html (1 of 2) [12/8/10 1:36:17 AM]
Getting started — Pinax v0.9a2 documentation
{% load comments_tag %}
{% comments post %}
Table Of Contents
● Getting started�❍ Prerequisites�❍ Installation�❍ Usage
Previous topicpinax.apps.threadedcomments_extras
Next topicReference
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.threadedcomments_extras »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/apps/threadedcomments_extras/gettingstarted.html (2 of 2) [12/8/10 1:36:17 AM]
Reference — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.threadedcomments_extras »
Reference
This document covers various components of pinax.apps.threadedcomments_extras.
Templates
threadedcomments/comments.html
Used by the template tag to render a chunk of HTML where the object, request, and user objects are in context.
Modules
pinax.apps.threadedcomments_extras.templatetags.comments_tag
http://pinaxproject.com/docs/dev/apps/threadedcomments_extras/reference.html (1 of 2) [12/8/10 1:36:31 AM]
Reference — Pinax v0.9a2 documentation
Table Of Contents
● Reference�❍ Templates■ threadedcomments/comments.html�❍ Modules■ pinax.apps.threadedcomments_extras.templatetags.comments_tag
Previous topicGetting started
Next topicpinax.apps.topics
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.threadedcomments_extras »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/apps/threadedcomments_extras/reference.html (2 of 2) [12/8/10 1:36:31 AM]
pinax.apps.topics — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »
pinax.apps.topics
Topics are essentially a title and description for any arbitrary model instance in the project. This app allows you to create/edit/delete/view Topis.
● Getting started�❍ Prerequisites�❍ Installation
● Reference�❍ Named URLs
■ topic_list■ topic_edit■ topic_delete■ topic_detail
�❍ Templates■ topic.html■ topics.html
�❍ Modules■ pinax.apps.topics.admin■ pinax.apps.topics.forms■ pinax.apps.topics.models■ pinax.apps.topics.templatetags.topics_tags■ pinax.apps.topics.views
http://pinaxproject.com/docs/dev/apps/topics/index.html (1 of 2) [12/8/10 1:36:45 AM]
pinax.apps.topics — Pinax v0.9a2 documentation
Previous topicReference
Next topicGetting started
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/apps/topics/index.html (2 of 2) [12/8/10 1:36:45 AM]
Getting started — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.topics »
Getting started
This document is designed to get you up and running with pinax.apps.topics...
Prerequisites
These are the requirements to run pinax.apps.account:
● Python 2.4+ (Python 3.x is not supported yet)● Django 1.2+● django-tagging● django-threadedcomments
These dependencies should be added to your requirements/project.txt file and installed using pip. For example:
pip install -r requirements/project.txt
Installation
Add pinax.apps.topics to your INSTALLED_APPS:
INSTALLED_APPS = [ # ... "pinax.apps.topics",]
Hook up pinax.apps.topics to your URLconf:
urlpatterns = patterns("",
http://pinaxproject.com/docs/dev/apps/topics/gettingstarted.html (1 of 2) [12/8/10 1:36:59 AM]
Getting started — Pinax v0.9a2 documentation
# ... url(r"^topics/", include("pinax.apps.topics.urls")))
Table Of Contents
● Getting started�❍ Prerequisites�❍ Installation
Previous topicpinax.apps.topics
Next topicReference
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.topics »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/apps/topics/gettingstarted.html (2 of 2) [12/8/10 1:36:59 AM]
Reference — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.topics »
Reference
This document covers various components of pinax.apps.topics.
Named URLs
The named URLs in this app should enable the use of of the {% url %} template tag as well as reverse lookups in your project code without having to know the implementation details of this app.
topic_list
On GET requests, render the topics.html template with a list of topics as well as a pinax.apps.topics.forms.TopicForm instance.
On POST requests, process the form data to create a new Topic
topic_edit
On POST requests, update the Topic.body data and redirect to topic_detail.
keyword arguments: The of the Topic to edit. Must match (?P<topic_id>\d+).
topic_delete
On POST requests, delete the Topic and ThreadedComments associated with it and redirect to the next context variable..
keyword arguments: The of the Topic to delete. Must match (?P<topic_id>\d+).
http://pinaxproject.com/docs/dev/apps/topics/reference.html (1 of 4) [12/8/10 1:37:14 AM]
Reference — Pinax v0.9a2 documentation
topic_detail
On GET requests, fetch the Topic as render the topic.html template with the Topic object in context.
keyword arguments: The of the Topic to display. Must match (?P<topic_id>\d+).
Templates
Templates should be placed in an topics/ folder at the root of one of your template search paths.
topic.html
context: group, group_base, topic, edit
topics.html
context: group, group_base, topics, topic_form, is_member
Modules
pinax.apps.topics.admin
pinax.apps.topics.forms
pinax.apps.topics.models
pinax.apps.topics.templatetags.topics_tags
pinax.apps.topics.views
http://pinaxproject.com/docs/dev/apps/topics/reference.html (2 of 4) [12/8/10 1:37:14 AM]
Reference — Pinax v0.9a2 documentation
Table Of Contents
● Reference�❍ Named URLs■ topic_list■ topic_edit■ topic_delete■ topic_detail�❍ Templates■ topic.html■ topics.html�❍ Modules■ pinax.apps.topics.admin■ pinax.apps.topics.forms■ pinax.apps.topics.models■ pinax.apps.topics.templatetags.topics_tags■ pinax.apps.topics.views
Previous topicGetting
http://pinaxproject.com/docs/dev/apps/topics/reference.html (3 of 4) [12/8/10 1:37:14 AM]
Reference — Pinax v0.9a2 documentation
started
Next topicpinax.apps.tribes
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.topics »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/apps/topics/reference.html (4 of 4) [12/8/10 1:37:14 AM]
pinax.apps.tribes — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »
pinax.apps.tribes
An app that provides functionality for creating and maintaining groups of people.
● Getting started�❍ Prerequisites�❍ Installation
● Reference�❍ Named URLs
■ tribe_list■ tribe_create■ your_tribes■ tribe_detail■ tribe_delete
�❍ Templates■ create.html■ tribes.html■ your_tribes.html■ tribe.html
�❍ Modules■ pinax.apps.tribes.admin■ pinax.apps.tribes.forms■ pinax.apps.tribes.models■ pinax.apps.tribes.templatetags.tribes_tags■ pinax.apps.tribes.views
Previous topicReference
Next topicGetting started
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/apps/tribes/index.html [12/8/10 1:37:28 AM]
Getting started — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.tribes »
Getting started
This document is designed to get you up and running with pinax.apps.tribes...
Prerequisites
These are the requirements to run pinax.apps.tribes:
● Python 2.4+ (Python 3.x is not supported yet)● Django 1.2+● django-groups 0.1.dev10
These dependencies should be added to your requirements/project.txt file and installed using pip. For example:
pip install -r requirements/project.txt
Installation
Add pinax.apps.tribes to your INSTALLED_APPS:
INSTALLED_APPS = [ # ... "pinax.apps.tribes",]
Hook up pinax.apps.tribes to your URLconf:
urlpatterns = patterns("", # ...
http://pinaxproject.com/docs/dev/apps/tribes/gettingstarted.html (1 of 2) [12/8/10 1:37:42 AM]
Getting started — Pinax v0.9a2 documentation
url(r"^tribes/", include("pinax.apps.tribes.urls")))
Table Of Contents
● Getting started�❍ Prerequisites�❍ Installation
Previous topicpinax.apps.tribes
Next topicReference
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.tribes »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/apps/tribes/gettingstarted.html (2 of 2) [12/8/10 1:37:42 AM]
Reference — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.tribes »
Reference
This document covers various components of pinax.apps.tribes.
Named URLs
tribe_list
Upon a GET request renter the tribes.html template with tribes and search_terms in context. Each tribe also get a member_count and a topic_count attribute assigned.
tribe_create
On GET requests render the create.html template with a tribe_form instance in context.
On POST requests process the form and create a new Tribe and add the request.user as a member of the Tribe.
your_tribes
On GET requests render the your_tribes.html template with a tribes queryset in context that contains all Tribes where request.user is a member.
tribe_detail
On GET requests render the tribe.html template with tribe, tribe_form, group, and is_member variables in context.
On POST request process that form to update the Tribe, join the Tribe or leave the Tribe.
http://pinaxproject.com/docs/dev/apps/tribes/reference.html (1 of 4) [12/8/10 1:37:57 AM]
Reference — Pinax v0.9a2 documentation
keyword arguments: The slug with that identifies a a Topic. Must match: (?P<group_slug>[-\w]+).
tribe_delete
Via a POST request, delete a Tribe that request.user created previously.
keyword arguments: The slug with that identifies a a Topic. Must match: (?P<group_slug>[-\w]+).
Templates
Templates should be placed in an tribes/ folder at the root of one of your template search paths.
create.html
context: tribe_form
tribes.html
context: tribes, search_terms
your_tribes.html
context: tribes
tribe.html
context: group, tribe, tribe_form, is_member
Modules
pinax.apps.tribes.admin
http://pinaxproject.com/docs/dev/apps/tribes/reference.html (2 of 4) [12/8/10 1:37:57 AM]
Reference — Pinax v0.9a2 documentation
pinax.apps.tribes.forms
pinax.apps.tribes.models
pinax.apps.tribes.templatetags.tribes_tags
pinax.apps.tribes.views
Table Of Contents
● Reference�❍ Named URLs■ tribe_list■ tribe_create■ your_tribes■ tribe_detail■ tribe_delete�❍ Templates■ create.html■ tribes.html■ your_tribes.html■ tribe.html�❍ Modules■ pinax.apps.tribes.admin■ pinax.apps.tribes.
http://pinaxproject.com/docs/dev/apps/tribes/reference.html (3 of 4) [12/8/10 1:37:57 AM]
Reference — Pinax v0.9a2 documentation
forms■ pinax.apps.tribes.models■ pinax.apps.tribes.templatetags.tribes_tags■ pinax.apps.tribes.views
Previous topicGetting started
Next topicpinax.apps.voting_extras
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.tribes »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/apps/tribes/reference.html (4 of 4) [12/8/10 1:37:57 AM]
pinax.apps.voting_extras — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »
pinax.apps.voting_extras
Provides some template tags for django-voting.
● Getting started�❍ Prerequisites�❍ Installation�❍ Usage
● Reference�❍ Modules
■ pinax.apps.voting_extras.templatetags.extra_voting_tags
Previous topicReference
Next topicGetting started
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1. http://pinaxproject.com/docs/dev/apps/voting_extras/index.html (1 of 2) [12/8/10 1:38:11 AM]
pinax.apps.voting_extras — Pinax v0.9a2 documentation
http://pinaxproject.com/docs/dev/apps/voting_extras/index.html (2 of 2) [12/8/10 1:38:11 AM]
Getting started — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.voting_extras »
Getting started
This document is designed to get you up and running with the pinax.apps.voting_extras...
Prerequisites
These are the requirements to run pinax.apps.voting_extras:
● Python 2.4+ (Python 3.x is not supported yet)● Django 1.2+● django-voting 0.1
These dependencies should be added to your requirements/project.txt file and installed using pip. For example:
pip install -r requirements/project.txt
Installation
Add pinax.apps.voting_extras to your INSTALLED_APPS:
INSTALLED_APPS = [ # ... "voting", "pinax.apps.voting_extras",]
Usage
http://pinaxproject.com/docs/dev/apps/voting_extras/gettingstarted.html (1 of 3) [12/8/10 1:38:25 AM]
Getting started — Pinax v0.9a2 documentation
After installing this app in your Django project, you now have access to easily add comments for a particular object in one of your templates.
Simple, load the template tag and call it within your template.
{% load extra_voting_tags %}
{% order_by_votes my_object_list %}<!-- OR -->{% order_by_reddit my_object_list date_field_name %}
{% for obj in my_object_list %}...{% endfor %}
Table Of Contents
● Getting started�❍ Prerequisites�❍ Installation�❍ Usage
Previous topicpinax.apps.voting_extras
Next topicReference
This Page
http://pinaxproject.com/docs/dev/apps/voting_extras/gettingstarted.html (2 of 3) [12/8/10 1:38:25 AM]
Getting started — Pinax v0.9a2 documentation
● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.voting_extras »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/apps/voting_extras/gettingstarted.html (3 of 3) [12/8/10 1:38:25 AM]
Reference — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.voting_extras »
Reference
This document covers various components of pinax.apps.voting_extras.
Modules
pinax.apps.voting_extras.templatetags.extra_voting_tags
http://pinaxproject.com/docs/dev/apps/voting_extras/reference.html (1 of 2) [12/8/10 1:38:39 AM]
Reference — Pinax v0.9a2 documentation
Table Of Contents
● Reference�❍ Modules■ pinax.apps.voting_extras.templatetags.extra_voting_tags
Previous topicGetting started
Next topicpinax.apps.waitinglist
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.voting_extras »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/apps/voting_extras/reference.html (2 of 2) [12/8/10 1:38:39 AM]
pinax.apps.waitinglist — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »
pinax.apps.waitinglist
A simple app to provide waiting list functionality to your project.
● Getting started�❍ Prerequisites�❍ Installation
● Reference�❍ Named URLs
■ waitinglist_list_signup■ waitinglist_success
�❍ Templates■ list_signup.html■ success.html
�❍ Modules■ pinax.apps.waitinglist.admin■ pinax.apps.waitinglist.forms■ pinax.apps.waitinglist.models■ pinax.apps.waitinglist.templatetags.waitinglist_tags■ pinax.apps.waitinglist.views
Previous topicReference
Next topicGetting started
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/apps/waitinglist/index.html [12/8/10 1:38:53 AM]
Getting started — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.waitinglist »
http://pinaxproject.com/docs/dev/apps/waitinglist/gettingstarted.html (1 of 3) [12/8/10 1:39:07 AM]
Getting started — Pinax v0.9a2 documentation
Getting started
This document is designed to get you up and running with pinax.apps.waitinglist...
Prerequisites
These are the requirements to run pinax.apps.waitinglist:
● Python 2.4+ (Python 3.x is not supported yet)● Django 1.2+
These dependencies should be added to your requirements/project.txt file and installed using pip. For example:
pip install -r requirements/project.txt
Installation
Add pinax.apps.waitinglist to your INSTALLED_APPS:
INSTALLED_APPS = [ # ... "pinax.apps.waitinglist",]
Hook up pinax.apps.waitinglist to your URLconf:
urlpatterns = patterns("", # ... url(r"^waitinglist/", include("pinax.apps.waitinglist.urls")))
http://pinaxproject.com/docs/dev/apps/waitinglist/gettingstarted.html (2 of 3) [12/8/10 1:39:07 AM]
Getting started — Pinax v0.9a2 documentation
Table Of Contents
● Getting started�❍ Prerequisites�❍ Installation
Previous topicpinax.apps.waitinglist
Next topicReference
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.waitinglist »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/apps/waitinglist/gettingstarted.html (3 of 3) [12/8/10 1:39:07 AM]
Reference — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.waitinglist »
Reference
This document covers various components of pinax.apps.waitinglist.
Named URLs
The named URLs in this app should enable the use of of the {% url %} template tag as well as reverse lookups in your project code without having to know the implementation details of this app.
waitinglist_list_signup
On GET request, render the list_signup.html template with a form instance from pinax.apps.waitinglist.forms.WaitingListEntryForm in context.
On POST request, process the the form. Then redirect to waitinglist_success.
waitinglist_success
Renders a direct_to_template template, success.html.
Templates
Templates should be placed in an waitinglist/ folder at the root of one of your template search paths.
list_signup.html
context: form
success.html
http://pinaxproject.com/docs/dev/apps/waitinglist/reference.html (1 of 3) [12/8/10 1:39:22 AM]
Reference — Pinax v0.9a2 documentation
No context. Just a plain HTML template.
Modules
pinax.apps.waitinglist.admin
pinax.apps.waitinglist.forms
pinax.apps.waitinglist.models
pinax.apps.waitinglist.templatetags.waitinglist_tags
pinax.apps.waitinglist.views
Table Of Contents
● Reference�❍ Named URLs■ waitinglist_list_signup■ waitinglist_success�❍ Templates■ list_signup.html■ success.html�❍ Modules■ pinax.apps.waitinglist.admin■ pinax.apps.waitinglist.
http://pinaxproject.com/docs/dev/apps/waitinglist/reference.html (2 of 3) [12/8/10 1:39:22 AM]
Reference — Pinax v0.9a2 documentation
forms■ pinax.apps.waitinglist.models■ pinax.apps.waitinglist.templatetags.waitinglist_tags■ pinax.apps.waitinglist.views
Previous topicGetting started
Next topicPinax Release Notes
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »Pinax Apps »pinax.apps.waitinglist »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/apps/waitinglist/reference.html (3 of 3) [12/8/10 1:39:22 AM]
Pinax v0.9a2 documentation—0.5.1
● index● previous |Pinax v0.9a2 documentation »Pinax Release Notes »
0.5.1
The 0.5.1 release brings various bug fixes and more stability to Pinax. We have fixed some bugs and improved the documentation. This release should be backward compatible, except where noted.
Python 2.4 support
0.5.1 brings Python 2.4 compatibility. There are still many distributions out there that have Python 2.4 as the default Python version.
Removal of Pownce support
Pownce closed their doors on December 15, 2008 after being bought by Six Apart. There is no longer any reason we should support Pownce.
You may need to remove some Pownce bits from your templates if you forked from the complete_project locally.
Various bug-fixes
● r1292 Fixed a bug in django_openidconsumer that prevented login on some deployments● r1288 Removed an import that was never used in profiles/views.py.● r1283 Issue #131 Added a missing datetime import in apps/local_apps/projects/forms.py.● r1266 Fixed a typo of ValidationError in apps/local_apps/account/forms.py.● r1215 Issue #119 Added a missing import in apps/local_apps/misc/utils.py.● r1193 Added the about app to the basic_project INSTALLED_APPS list.
http://pinaxproject.com/docs/dev/releases/0.5.1.html (1 of 2) [12/8/10 1:39:36 AM]
Pinax v0.9a2 documentation—0.5.1
Table Of Contents
● 0.5.1�❍ Python 2.4 support�❍ Removal of Pownce support�❍ Various bug-fixes
Previous topicPinax Release Notes
This Page● Show Source
● index● previous |Pinax v0.9a2 documentation »Pinax Release Notes »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/releases/0.5.1.html (2 of 2) [12/8/10 1:39:36 AM]
Pinax Release Notes — Pinax v0.9a2 documentation
● index● next |● previous |Pinax v0.9a2 documentation »
Pinax Release Notes
● 0.5.1
Previous topicReference
Next topic0.5.1
This Page● Show Source
● index● next |● previous |Pinax v0.9a2 documentation »
© Copyright 2010, James Tauber and Pinax Team. Last updated on Sep 11, 2010. Created using Sphinx 0.6.1.
http://pinaxproject.com/docs/dev/releases/index.html [12/8/10 1:39:49 AM]
http://pinaxproject.com/docs/dev/_sources/index.txt
.. Pinax documentation master file, created by sphinx-quickstart on Fri Aug 22 13:13:12 2008. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive.
Pinax documentation===================
Pinax is an open-source platform built on the Django Web Framework.
By integrating numerous reusable Django apps to take care of the thingsthat many sites have in common, it lets you focus on what makes yoursite different.
.. toctree:: :maxdepth: 2
intro gettingstarted customization deployment media groups settings dependencies FAQ <faq> Contributing <contributing> buildout pil tabs
Documentation for Individual Apps---------------------------------
.. toctree:: :maxdepth: 3 external_apps apps/index
Release Notes
http://pinaxproject.com/docs/dev/_sources/index.txt (1 of 2) [12/8/10 1:39:52 AM]
http://pinaxproject.com/docs/dev/_sources/index.txt
-------------
* :ref:`current release notes <ref-current-release-notes>`
.. toctree:: :maxdepth: 2
releases/index
http://pinaxproject.com/docs/dev/_sources/index.txt (2 of 2) [12/8/10 1:39:52 AM]
http://pinaxproject.com/docs/dev/_sources/intro.txt
Introduction============
Pinax is an open-source platform built on the `Django Web Framework`_.
By integrating numerous reusable Django apps to take care of the thingsthat many sites have in common, it lets you focus on what makes yoursite different.
While our initial development was focused around a demo socialnetworking site, Pinax is suitable for a wide variety of websites. Weare working on number of editions tailored to intranets, eventmanagement, learning management, software project management and more.
Features--------
At this stage, there is:
- openid support- e-mail verification- password management- site announcements- a notification framework- user-to-user messaging- friend invitation (both internal and external to the site)- a basic twitter clone- oembed support- gravatar support- interest groups (called tribes)- projects with basic task and issue management- threaded discussions- wikis with multiple markup support- blogging- bookmarks- tagging- contact import (from vCard, Google or Yahoo)- photo management
and much more coming...
History and Background----------------------
You can learn more about the history and motivation for Pinax in an`interview with James Tauber on This Week in Django`_ as well as his`talk on Pinax at DjangoCon 2008`_ and `talk on Pinax at PyCon 2009`_.
.. _`Django Web Framework`: http://djangoproject.com/
.. _`interview with James Tauber on This Week in Django`: http://thisweekindjango.com/twid/episode/24/this-week-in-django-24/
.. _`talk on Pinax at DjangoCon 2008`: http://www.youtube.com/watch?v=1J91Ownq-7g
.. _`talk on Pinax at PyCon 2009`: http://pycon.blip.tv/file/1952623/
http://pinaxproject.com/docs/dev/_sources/intro.txt [12/8/10 1:39:55 AM]
http://pinaxproject.com/docs/dev/_sources/gettingstarted.txt
.. _ref-gettingstarted:
===============Getting started===============
This guide is designed to point you to the best information about gettingstarted with Pinax. Pinax is built on top of Python and Django. We leveragethese technologies to their fullest. It is ideal you have some level ofexperience with these tools before moving on. Here are some good firstresources if you need to learn about Python and Django:
* **Python**: `Official Python tutorial`_ * **Python**: `Dive into Python`_ * **Django**: `Official Django tutorial`_ * **Django**: `Official Django documentation`_
Those resources will be excellent reading material if you are not familiarwith Python or Django. The Django tutorial is especially important as manycore Pinax concepts are simply ones you find in Django.
.. _Official Python tutorial: http://docs.python.org/tutorial/
.. _Dive into Python: http://diveintopython.org/
.. _Official Django tutorial: http://docs.djangoproject.com/en/dev/intro/tutorial01/
.. _Official Django documentation: http://docs.djangoproject.com/en/dev/
Prerequisites=============
To get started with Pinax you must have the following installed:
* Python 2.4+ — many OSes come with an adequate version of Python. If you are on Windows you will need to install it from `python.org`_. Do **not** install Python 3+. Pinax is not compatible with Python 3 yet. * `virtualenv`_ 1.4.7+ * `pysqlite`_ — this is only required if you are running **Python 2.4**. Later versions of Python have this bundled. * :ref:`PIL <ref-pil>` — this is only required if you are using a project which requires imaging capabilites (includes projects which support avatars and/or photos). It is likely the best idea to install it anyways.
.. _python.org: http://python.org/
.. _pysqlite: http://code.google.com/p/pysqlite/
.. _ref-install:
Installation============
Pinax highly encourges the use of virtual environments. We will use a tool
http://pinaxproject.com/docs/dev/_sources/gettingstarted.txt (1 of 4) [12/8/10 1:40:00 AM]
http://pinaxproject.com/docs/dev/_sources/gettingstarted.txt
called `virtualenv`_ which provides a way to create isolated Pythonenvironments.
Create yourself a virtual environment and activate it::
$ virtualenv mysite-env $ source mysite-env/bin/activate (mysite-env)$
If you use Windows this will become::
$ virtualenv mysite-env $ mysite-env\Scripts\activate.bat (mysite-env)$
The directory ``mysite-env`` is the environment for your project. It isrecommended you do not edit or create new files/directories within it. Thereason this is important is that this directory should remain reproducibleat all times. Reproducible environments is a good idea.
Notice the ``(mysite-env)`` bit? This is done for you by the ``activate``script to help you identify which environment is currently activated. Underthe hood your ``PATH`` has been modified to use the Python binary for thisenvironment.
Go ahead and install Pinax::
(mysite-env)$ pip install Pinax
.. note:: ``pip install Pinax`` is a development version
Currently, only our development version is available with pip install. Previous versions of Pinax were not available with pip install. Keep in mind the development version may not be 100% stable. If you are looking to help out with development you should read our :ref:`contributing documentation <ref-contributing>`.
``pip`` you say? pip_ is a tool bundled with virtualenv to install Pythonpackages. It is super handy and it is used in Pinax extensively to handledependencies. You should become very familiar with this tool.
.. _virtualenv: http://pypi.python.org/pypi/virtualenv
.. _pip: http://pip.openplans.org/
Pinax is now installed!
Creating a project==================
http://pinaxproject.com/docs/dev/_sources/gettingstarted.txt (2 of 4) [12/8/10 1:40:00 AM]
http://pinaxproject.com/docs/dev/_sources/gettingstarted.txt
Now that Pinax is installed the next step is to create a project. A project isnot much more than a Django project. Pinax provides many more defaults for youout of the box.
::
(mysite-env)$ pinax-admin setup_project mysite
This will create a new project named ``mysite``. By default it will installdependencies for you. You can turn that behavior off by giving ``setup_project``the ``--no-reqs`` option.
Pinax comes with many different project bases. The default project based iswhat we call **layer zero**. It is simply a Django project with some extraintegrated dependencies that will make getting started faster.
Specifying a different project base-----------------------------------
To see what Pinax has to offer run::
(mysite-env)$ pinax-admin setup_project -l
This will list all available project bases and a short description abouteach. To base your project off of any of these you'd run::
(mysite-env)$ pinax-admin setup_project -b basic mysite
In many cases the default (``zero``) is enough to get you going, but othersmay provide a better starting point for your project.
Running a project=================
At this point you are now working with Django. Pinax has helped you bootstrapyour project into life. Inside your project you should run::
(mysite-env)$ python manage.py syncdb (mysite-env)$ python manage.py runserver
``syncdb`` will create a SQLite database named ``dev.db`` in your currentdirectory. We've configured your project to do this, but you can change thissimply by modifying ``settings.py`` where ``DATABASES`` dictionary isconstructed. You can find more information about this at the `get yourdatabase running`_ Django documentation.
``runserver`` runs an embedded webserver to test your site with. By defaultit will run on http://localhost:8000. This is configurable and moreinformation can be found on `runserver in Django documentation`_.
http://pinaxproject.com/docs/dev/_sources/gettingstarted.txt (3 of 4) [12/8/10 1:40:00 AM]
http://pinaxproject.com/docs/dev/_sources/gettingstarted.txt
.. _get your database running: http://docs.djangoproject.com/en/dev/topics/install/#get-your-database-running
.. _runserver in Django documentation: http://docs.djangoproject.com/en/dev/ref/django-admin/#runserver-port-or-ipaddr-port
What's next?============
Look at our :doc:`customization <customization>` documentation to learn how youmight customize your project. If you are ready to deploy your project checkout the :doc:`deployment <deployment>` documentation.
http://pinaxproject.com/docs/dev/_sources/gettingstarted.txt (4 of 4) [12/8/10 1:40:00 AM]
http://pinaxproject.com/docs/dev/_sources/customization.txt
.. _ref-customization:
Customization=============
As more sites are built using Pinax, more best practices will emerge, but fornow what we recommend is:
- Always work off a stable release. The most current release is 0.7.1.- Use the pinax-admin :ref:`setup_project <customization-setupproject>` command.- Make necessary changes to the ``settings.py`` and ``urls.py`` files in your copied directory.- Change the domain and display name of the Site in the admin interface.- Develop your custom apps under your new project or anywhere on Python path.- Develop your own templates under your new project.
.. _ref-project:
Choosing a Project------------------
Pinax provides several projects to use as a starting point forcustomization. Depending on your development style, you may prefer one projectover the other.
basic This project comes with the bare minimum set of applications and templates to get you started. It includes no extra tabs, only the profile and notices tabs are included by default. From here you can add any extra functionality and applications that you would like.
cms_company A very simple CMS that lets you set up templates and then edit content, including images, right in the frontend of the site. The sample media, templates and content including in the project demonstrate a basic company website.
cms_holidayhouse A very simple CMS that lets you set up templates and then edit content, including images, right in the frontend of the site.
http://pinaxproject.com/docs/dev/_sources/customization.txt (1 of 4) [12/8/10 1:40:04 AM]
http://pinaxproject.com/docs/dev/_sources/customization.txt
The sample media, templates and content including in the project demonstrate a basic site for holiday house rentals.
code This project demonstrates group functionality and the tasks, wiki and topics apps. It is intended to be the starting point for things like code project management where each code project gets its own wiki, task tracking system and threaded discussions.
intranet This project demonstrates a closed site requiring an invitation to join and not exposing any information publicly. It provides a top-level task tracking system, wiki and bookmarks. It is intended to be the starting point of sites like intranets.
private_beta This project demonstrates the use of a waiting list and signup codes for sites in private beta. Otherwise it is the same as basic_project.
sample_group This project demonstrates group functionality with a barebones group containing no extra content apps as well as two additional group types, tribes and projects, which show different membership approaches and content apps such as topics, wiki, photos and task management.
social This project demonstrates a social networking site. It provides profiles, friends, photos, blogs, tribes, wikis, tweets, bookmarks, swaps, locations and user-to-user messaging. In 0.5 this was called ``complete_project``.
zero This project lays the foundation for all other Pinax starter projects. It provides the project directory layout and some key infrastructure apps on which the other starter projects are based.
.. _customization-setupproject:
pinax-admin setup_project-------------------------
Pinax provides you with ``pinax-admin``, a command line utility. With
http://pinaxproject.com/docs/dev/_sources/customization.txt (2 of 4) [12/8/10 1:40:04 AM]
http://pinaxproject.com/docs/dev/_sources/customization.txt
``pinax-admin`` you can quickly generate a cloned project. For example, to getstarted quickly with Pinax you could simply do the following::
(mysite-env)$ pinax-admin setup_project mysite
Or if you want to use the ``basic`` project base you could do::
(mysite-env)$ pinax-admin setup_project -b basic mysite
Settings You Will (Possibly) Want To Override---------------------------------------------
Pinax-specific:
- ``PINAX_THEME``- ``CONTACT_EMAIL``- ``URCHIN_ID``- ``BBAUTH_APP_ID``- ``BBAUTH_SHARED_SECRET``- ``SITE_NAME``- ``MAILER_PAUSE_SEND``- ``SERVE_MEDIA``- ``ACCOUNT_OPEN_SIGNUP``- ``ACCOUNT_REQUIRED_EMAIL``- ``ACCOUNT_EMAIL_VERIFICATION``- ``EMAIL_CONFIRMATION_DAYS``- ``LOGIN_REDIRECT_URLNAME``
General to Django:
- ``DEBUG``- ``TEMPLATE_DEBUG``- ``LOGGING_OUTPUT_ENABLED``- ``ADMINS``- ``MANAGERS``- ``DATABASE_ENGINE``- ``DATABASE_NAME``- ``DATABASE_USER``- ``DATABASE_PASSWORD``- ``DATABASE_HOST``- ``TIME_ZONE``
http://pinaxproject.com/docs/dev/_sources/customization.txt (3 of 4) [12/8/10 1:40:04 AM]
http://pinaxproject.com/docs/dev/_sources/customization.txt
- ``SECRET_KEY``- ``DEFAULT_FROM_EMAIL``- ``SERVER_EMAIL``- ``SEND_BROKEN_LINK_EMAILS``- ``EMAIL_HOST``- ``EMAIL_HOST_USER``- ``EMAIL_HOST_PASSWORD``- ``EMAIL_SUBJECT_PREFIX``- ``LOGIN_URL``
``base.html`` versus ``site_base.html``---------------------------------------
In the sample projects, ``templates/base.html`` is intended for overall page structurewhereas ``templates/site_base.html`` is intended for adding site-specific content thatis to be found on all pages (things like logo, navigation or footers).
If you are writing a theme to be used across multiple sites, you should modify``base.html``, not ``site_base.html``. If you want to keep a particular themebut modify content for a specific site, you should modify ``site_base.html``.
Changing Avatar/Gravatar defaults-----------------------------------
By default Pinax assigns to users the Gravatar_ icon and uses the Gravatar iconsystem. If you want your own personal site avatar default, simply go to the``settings.py`` in your project root and add these two lines of code::
# avatar controls AVATAR_DEFAULT_URL = MEDIA_URL + '<our_custom_avatar.jpg>' AVATAR_GRAVATAR_BACKUP = False
Adding Tabs-----------
See :ref:`ref-tabs`
.. _`Gravatar`: http://gravatar.com/
http://pinaxproject.com/docs/dev/_sources/customization.txt (4 of 4) [12/8/10 1:40:04 AM]
http://pinaxproject.com/docs/dev/_sources/deployment.txt
.. _ref-deployment:
Deployment==========
In short:
* Create a ``local_settings.py`` alongside ``settings.py`` for your host-specific settings (like database connection, e-mail, etc).* Configure mod_wsgi.* Set up ``cron`` job for mailer and asynchronous notifications.
Using mod_wsgi--------------
If you are using mod_wsgi, which we recommend, you will need to provide a WSGIscript. All projects include a ``deploy/`` directory which contains thisscript named ``pinax.wsgi``. You may modify this file as it best suits you.
Here is a basic configuration for Apache (assuming you are using Python 2.5)::
WSGIDaemonProcess mysite-production python-path=/path/to/virtualenvs/pinax-env/lib/python2.5/site-packages WSGIProcessGroup mysite-production WSGIScriptAlias / /path/to/project/deploy/pinax.wsgi <Directory /path/to/project/deploy> Order deny,allow Allow from all </Directory>
The above configuration will likely need to be modified before use. Mostspecifically make sure the ``python-path`` option points to the right Pythonversion. We encourage you to read about `WSGIDaemonProcess`_ to learn moreabout what you can configure.
.. _ref-sending-mail-and-notices:
Sending Mail and Notices------------------------
Both mail messages and (some) notifications are queued for asynchronousdelivery. To actually deliver them you need to run:: python manage.py send_mail and::
http://pinaxproject.com/docs/dev/_sources/deployment.txt (1 of 3) [12/8/10 1:40:07 AM]
http://pinaxproject.com/docs/dev/_sources/deployment.txt
python manage.py emit_notices on a frequent, regular basis.
Because failed mail will be deferred, you need an additional, lessfrequent, run of:: python manage.py retry_deferred We recommend setting up some scripts to run these commands within yourvirtual environment. You can use the following shell script as the basis foreach management command::
#!/bin/sh
WORKON_HOME=/home/user/virtualenvs PROJECT_ROOT=/path/to/project
# activate virtual environment . $WORKON_HOME/pinax-env/bin/activate
cd $PROJECT_ROOT python manage.py send_mail >> $PROJECT_ROOT/logs/cron_mail.log 2>&1
Let's assume the scripts you create from above are stored in``$PROJECT_ROOT/cron``. You can now setup the cron job similar to:: * * * * * /path/to/project/cron/send_mail.sh * * * * * /path/to/project/cron/emit_notices.sh 0,20,40 * * * * /path/to/project/cron/retry_deferred.sh
This runs ``send_mail`` and ``emit_notices`` every minute and``retry_deferred`` every 20 minutes.
Media files-----------
Pinax makes it very easy to combine all your applications' media files intoone single location (see :ref:`ref-media` for details). Serving them more orless comes down again to how you do it with Django itself.
There is an example on how to serve those files with the development server in:ref:`ref-media-devel`.
In a production environment you, too, have to merge those files before you canserve them. Regarding actually serving those files then, see `Django's
http://pinaxproject.com/docs/dev/_sources/deployment.txt (2 of 3) [12/8/10 1:40:07 AM]
http://pinaxproject.com/docs/dev/_sources/deployment.txt
deployment documentation`_ for details.
.. _`WSGIDaemonProcess`: http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGIDaemonProcess
.. _django's deployment documentation: http://docs.djangoproject.com/en/dev/howto/deployment/
http://pinaxproject.com/docs/dev/_sources/deployment.txt (3 of 3) [12/8/10 1:40:07 AM]
http://pinaxproject.com/docs/dev/_sources/media.txt
.. _ref-media:
==============Media Handling==============
This document explains how Pinax handles media files across external andinternal applications and themes.
Pinax places static media (css, js, and images such as backgrounds, icons andlogos) in a separate directory from the normal Django media directory (uploadsand other user generated content stored on the file server). This is done inorder to allow for easy server optimization and improved security.
Basic media handling====================
If you want to override default media files, place yours under`<project_name>/media/...` with the same path. For example:
Original file::
src/pinax/media/default/pinax/img/logo.png
Your file::
<project_name>/media/pinax/img/logo.png Locations of media files========================
If you want to use Pinax' media handling with your own Django apps, pleasemake sure you put the media files like JavaScript, cascading stylesheets (CSS)and images in the following directory structure::
<app_name>/media/<app_name>/(js|img|css) Doubling your `<app_name>` is required to prevent name collision of media fileswhile deploying.
Site specific media files goes to::
<project_name>/media/siteExample.js The special static file service view should be able to serve the media files indevelopment.
.. _ref-media-build_static:
build_static management command===============================
http://pinaxproject.com/docs/dev/_sources/media.txt (1 of 2) [12/8/10 1:40:10 AM]
http://pinaxproject.com/docs/dev/_sources/media.txt
The build_static script collects the media files from Pinax and all theinstalled apps and arranges them under the``<project_name>/site_media/static`` folder.
The command::
<project_name>/python manage.py build_static
will collect the media files from Pinax and all the apps and places them inthe folder defined in the ``STATIC_ROOT`` setting.
Please also refer to the help of the build_static management command by running::
<project_name>/python manage.py build_static --help
.. _ref-media-resolve_static:
resolve_static management command=================================
To quickly resolve the absolute path of a media file on the filesystem,you can pass its expected path(s) to the ``resolve_static`` managementcommand, e.g.::
$ ./manage resolve_media pinax/css/base.css /Users/Jannis/.virtualenvs/mysite/lib/python2.6/site-packages/Pinax-0.9alpha1-py2.6.egg/pinax/media/default/pinax/css/base.css
If multiple locations are found which match the given path it will list all ofthem, sorted by its importance.
.. _ref-media-devel:
Serving static files during development=========================================
The ``staticfiles`` app provides the static file serving view tohandle the app and theme media as well as other media files found in the``MEDIA_ROOT`` directory. Make sure your projects' urls.py contains thefollowing snippet below the rest of the url configuration::
from django.conf import settings if settings.SERVE_MEDIA: urlpatterns += patterns("", (r"", include("staticfiles.urls")), )
http://pinaxproject.com/docs/dev/_sources/media.txt (2 of 2) [12/8/10 1:40:10 AM]
http://pinaxproject.com/docs/dev/_sources/groups.txt
===============Groups Overview===============
Groups in Pinax are simply container application/models that contain otherapplication/models. For example, if we had something called 'Project' itmight have 'Tasks' within it. The Pinax Groups system is designed to make thisscenario easy to implement. It allows you to convert an application and modelto become a container, henceforce called respectively a *Group App* and themodel is called a '*Group Model*'. It also allows you to convert anapplication and associated models to become '*Group-Aware*', which if doneproperly makes it capable of working inside a group or as a stand-aloneapplication.
To summarize, Pinax gives you the ability to:
* Create a *Group App* that can hold another application that is *Group-Aware*. * Create a *Group-Aware* application that can either stand-alone or be held inside a *Group App*.
Pinax comes with a number of built-in applications of both *Group Apps*and *Group-Aware* apps detailed in this page's appendix, but its easy enoughto create your own.
Writing your own group aware domain objects-------------------------------------------
First lets make a Task application. Please keep in mind that our example, whencomplete, can be quicklybrought into any Pinax Group-App, not just projects::
import datetime from django.db import models from django.utils.translation import ugettext_lazy as _ from django.contrib.auth.models import User from django.contrib.contenttypes import generic from django.contrib.contenttypes.models import ContentType class Task(models.Model): """
http://pinaxproject.com/docs/dev/_sources/groups.txt (1 of 8) [12/8/10 1:40:16 AM]
http://pinaxproject.com/docs/dev/_sources/groups.txt
We don't use anything Pinax specific in this model. In fact, we make a point with the *get_absolute_url* method of making it able to handle being in a group or as a stand-alone Django application. """ # Some sample fields below to show individual distinction of this model title = models.CharField(max_length=140) description = models.TextField(max_length=140) creator = models.ForeignKey(User, verbose_name=_("creator"), related_name="%(class)s_created" ) created = models.DateTimeField(_("created"), default=datetime.datetime.now) # The following three fields are required for being group aware. # We use a nullable generic foreign key to enable it to be optional # and we don't know what group model it will point to. object_id = models.IntegerField(null=True) content_type = models.ForeignKey(ContentType, null=True) group = generic.GenericForeignKey("content_type", "object_id") def __unicode__(self): return self.title def get_absolute_url(self, group=None): kwargs = {"id": self.id} # We check for attachment of a group. This way if the Task object # is not attached to the group the application continues to function. if group: return group.content_bridge.reverse("task_detail", group, kwargs) return reverse("task_detail", kwargs=kwargs)
Forms~~~~~
We don't want to display the special object_id, content_type, and group fieldsto end clients and users. So we use Django forms to control what is displayed::
from django import forms from django.utils.translation import ugettext as _ from pinax.apps.tasks.models import Task
http://pinaxproject.com/docs/dev/_sources/groups.txt (2 of 8) [12/8/10 1:40:16 AM]
http://pinaxproject.com/docs/dev/_sources/groups.txt
class TaskForm(forms.ModelForm): """ Our Task form is just like the Task model in that it can work with groups or independantly. """ def __init__(self, user, group=None, *args, **kwargs): self.user = user self.group = group super(TaskForm, self).__init__(*args, **kwargs) def save(self, commit=True): return super(TaskForm, self).save(commit) class Meta: model = Task fields = ["title", "description"] # only display 2 fields def clean(self): self.check_group_membership() return self.cleaned_data def check_group_membership(self): """ We only let valid group members add new tasks. If the Task is *not* attached to a group then it ignores this step. """ group = self.group if group and not self.group.user_is_member(self.user): raise forms.ValidationError(_("You must be a member to create new Tasks"))
Views~~~~~
Just like the models and forms, we build our Task views in such a way thatthey can handle being within or without a group::
from django.core.exceptions import ObjectDoesNotExist from django.http import Http404 from django.template import RequestContext from django.shortcuts import render_to_response
http://pinaxproject.com/docs/dev/_sources/groups.txt (3 of 8) [12/8/10 1:40:16 AM]
http://pinaxproject.com/docs/dev/_sources/groups.txt
from pinax.apps.tasks.models import Task def task_list(request, group_slug=None, bridge=None): # if a bridge is supplied but does not exist in the database that # means someone is trying to look at a non-existant object. if bridge is not None: try: group = bridge.get_group(group_slug) except ObjectDoesNotExist: raise Http404 else: group = None # If we are in a group we fetch the Task list of content via a special # utility method. Otherwise we just use a standard ORM call. if group: tasks = group.content_objects(Task) else: tasks = Task.objects.all() # Is the user a member of the parent group? if not request.user.is_authenticated(): is_member = False else: if group: is_member = group.user_is_member(request.user) else: is_member = True return render_to_response("tasks/task_list.html", { "group": group, "blogs": blogs, "is_member": is_member, }, context_instance=RequestContext(request)) In many cases you might want to check if the authenticated user has membershipin the group. To do this::
http://pinaxproject.com/docs/dev/_sources/groups.txt (4 of 8) [12/8/10 1:40:16 AM]
http://pinaxproject.com/docs/dev/_sources/groups.txt
if not request.user.is_authenticated(): is_member = False else: is_member = group.user_is_member(request.user)
URLs~~~~
The ``urls.py`` file of your app will not need anything special. Most of thatis handled by Pinax. However, URL reversal needs to be group aware. We havesome helpers to help you work with this easily.
Let's say you have the following code in ``tasks.urls.py``::
from django.conf.urls.defaults import * urlpatterns = patterns("", url(r"^tasks/$", "pinax.apps.tasks.views.task_list", name="task_list"), url(r"^tasks/(?P<slug>[-\w]+)/$", "pinax.apps.tasks.views.blog_detail", name="task_detail"), )
To ensure URLs to ``task_list`` are correctly generated you will need to use``reverse`` located on the ``ContentBridge`` object::
def some_view_with_redirect(request, bridge=None): ... return HttpResponseRedirect(bridge.reverse("blog_list", group))
The ``reverse`` method work almost identical to Django's ``reverse``. It isessentially a wrapper. To reverse the ``taskdetail`` URL::
task = Task.objects.get(pk=1) bridge.reverse("task_detail", group, kwargs={"slug": task.slug})
.. note::
You should be aware that **only** ``kwargs`` work with the bridge ``reverse``. This is significant because URLs with ``args`` mapping will fail reversal. The reason behind this is because Django does not allow mixing of ``args`` and ``kwargs`` when performing URL reversal.
There are some cases when you don't have easy access to the ``ContentBridge``.You may only have access to a domain object instance. You can get access to
http://pinaxproject.com/docs/dev/_sources/groups.txt (5 of 8) [12/8/10 1:40:16 AM]
http://pinaxproject.com/docs/dev/_sources/groups.txt
the ``ContentBridge`` from the instance. For example::
task = Task.objects.get(pk=1) task.content_bridge.reverse(...)
URL reversal in templates~~~~~~~~~~~~~~~~~~~~~~~~~
In Django you may be familiar with the ``{% url %}`` templatetag. This isbasically a wrapper around ``reverse``. We provide a similar tag, but workswith our ``ContentBridge.reverse``. Here is how you might use it::
{% load group_tags %} <a href="{% groupurl task_detail group slug=task.slug %}">{{ task.title }}</a>
The ``{% groupurl %}`` templatetag will fall back to normal Django URL reversalif the value of the passed in ``group`` is ``None``. This enables the abilityto work with no group association.
Writing your own group app--------------------------
We will continue with the Project/Task corollary. Our group application willbe a Project (which contain tasks, members, and more)::
from django.core.urlresolvers import reverse from django.contrib.auth.models import User from django.db import models from django.utils.translation import ugettext_lazy as _ from groups.base import Group class Project(Group): """ Doesn't inherit the normal *models.Model*. Group comes with a title, description, created, creator and some glue pieces and utility methods built in for convenience. """ members = models.ManyToManyField(User,
http://pinaxproject.com/docs/dev/_sources/groups.txt (6 of 8) [12/8/10 1:40:16 AM]
http://pinaxproject.com/docs/dev/_sources/groups.txt
related_name = "projects", verbose_name=_("members") ) def get_absolute_url(self): return reverse("group_detail", kwargs={ "group_slug": self.slug }) def get_url_kwargs(self): return {"group_slug": self.slug}
Adding in a a group-aware project~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In order for a ``group-app`` to be able to display a ``group-aware``application there needs to be a bridge. We take a sample projects.urls.py::
# Standard urlsconf import from django.conf.urls.defaults import * # Create your normal project url views urlpatterns = patterns("", url(r"^add_project$", "pinax.apps.projects.views.add", name="project_add"), url(r"^your_projects/$", "pinax.apps.projects.views.your_project", name="your_projects"), url(r"^(?P<slug>[-\w]+)$", "pinax.apps.projects.views.project_detail", name="project_detail"), url(r"^$", "pinax.apps.projects.views.projects", name="project_list"), ... ) So we can render a URL such as ``/projects/<my-project>``.
And then we add in the following code underneath the urlpatterns definition:: # Pinax groups special object from groups.bridge import ContentBridge # Fetch the group-aware model from pinax.apps.tasks.models import Task
http://pinaxproject.com/docs/dev/_sources/groups.txt (7 of 8) [12/8/10 1:40:16 AM]
http://pinaxproject.com/docs/dev/_sources/groups.txt
# Create the bridge object bridge = ContentBridge(Task, "tasks") # Add in the bridged url urlpatterns += bridge.include_urls("task.urls", r"^projects/(?P<group_slug>[-\w]+)/tasks")
And that lets us render a URL such as ``/projects/<my-project>/tasks``.
Appendix--------
Appendix A - Group Apps provided by Pinax~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Pinax comes bundled with two types of group-apps:
* tribes — used in social_project * projects — used in code_project
Appendix B - Group Aware Apps provided by Pinax~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Pinax includes several apps that are group aware:
* photos * tasks * topics
Appendix C - Group Apps available on PyPI~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* pinax-dances (tutorial application)
Appendix D - Group Aware Apps available on PyPI~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* pinax-wall (tutorial application)
http://pinaxproject.com/docs/dev/_sources/groups.txt (8 of 8) [12/8/10 1:40:16 AM]
http://pinaxproject.com/docs/dev/_sources/settings.txt
.. _ref-settings:
Settings========
Depending on what profile and which apps out of it you're using with yourPinax project you have a collection of options for your ``settings.py`` atyour disposal. This listing only includes those that are supported by theinternal applications or are used in the sample project settings (excludingthose that are already described by `Django's settings reference`_. If youwant to know the available settings for any of the external apps, please referto its docoumentation.
.. _django's settings reference: http://docs.djangoproject.com/en/dev/ref/settings/
.. _ref-settings-account-open-signup:
ACCOUNT_OPEN_SIGNUP-------------------
:Applications: ``pinax.apps.signup_codes``
This setting lets you configure whether the site should allow new users toregister accounts if they don't provide any kind of signup code.
.. _ref-settings-bbauth-app-id:
BBAUTH_APP_ID-------------
:Applications: ``pinax.apps.bbauth``
This setting is used to allow auth through `Yahoo!'s Browser-Based Authentication service`_.
.. _yahoo!'s browser-based authentication service: http://developer.yahoo.com/auth/
.. _ref-settings-bbauth-shared-secret:
BBAUTH_SHARED_SECRET--------------------
:Applications: ``pinax.apps.bbauth``
This setting is used to allow auth through `Yahoo!'s Browser-Based Authentication service`_.
.. _yahoo!'s browser-based authentication service: http://developer.yahoo.com/auth/
.. _ref-settings-behind-proxy:
http://pinaxproject.com/docs/dev/_sources/settings.txt (1 of 7) [12/8/10 1:40:21 AM]
http://pinaxproject.com/docs/dev/_sources/settings.txt
BEHIND_PROXY------------
:Applications: ``pinax.apps.blog``
If your site is behind a proxy server, set this setting accordingly so thatthe users' real IP addresses are stored when they create blog posts. Whenactivated the blog takes the user's IP addresse from``request.META['HTTP_X_FORWARDED_FOR']`` instead of``request.META['REMOTE_ADDR']``.
.. _ref-settings-combined-inbox-count-sources:
COMBINED_INBOX_COUNT_SOURCES----------------------------
:Applications: ``pinax.apps.misc``
With this setting you can specify a list applications that write to the usersinbox in order to get the current inbox count for the current user. In factyou don't specify the application but a context processor function which youspecify here. If you for example create a project based on the``social_project`` template, the ``messages``, ``notification`` and``friends_app`` all provide information that affects the inbox count.
Such a context processor should return a dictionary with one or more entriesfor the additional inbox count.
.. _rst-settings-email-confirmation-days:
EMAIL_CONFIRMATION_DAYS-----------------------
:Applications: ``emailnotification`` (`external <http://github.com/jtauber/django-email-confirmation/>`_)
This way you can configure the number of days, confirmation email should bevalid. For further details please see the documentation of the applicationitself.
.. _ref-settings-feedutil-summary-len:
FEEDUTIL_SUMMARY_LEN--------------------
:Applications: ``feedutil`` (`external <http://code.google.com/p/django-feedutil/>`_):Default: 150
Number of characters used for summary-attributes in feeds.
.. _ref-settings-force-lowercase-tags
http://pinaxproject.com/docs/dev/_sources/settings.txt (2 of 7) [12/8/10 1:40:21 AM]
http://pinaxproject.com/docs/dev/_sources/settings.txt
FORCE_LOWERCASE_TAGS--------------------
:Applications: ``tagging`` (`external <http://code.google.com/p/django-tagging/>`_):Default: ``False``
If set to ``True`` all tags will first be converted to lowercase before theyare saved to the database.
.. _ref-settings-login-redirect-urlname:
LOGIN_REDIRECT_URLNAME----------------------
:Applications: ``pinax.apps.account``
This setting is used by ``pinax.apps.account`` and allows you to specify thename of a named URL as redirection target. If it is not set,``LOGIN_REDIRECT_URL`` will get used instead.
.. _ref-settings-notification-language-module
NOTIFICATION_LANGUAGE_MODULE----------------------------
:Application: ``notification`` (`external <http://github.com/jtauber/django-notification/>`_):Default: ``False``
This way you can specify what model holds the language selection of a specificuser -- e.g. ``account.Account``. The model has to have a foreign key to thethe user model (``user``) and also provide a ``language`` field, which is thenused by the ``notification`` application.
.. _ref-settings-pinax-items-per-feed:
PINAX_ITEMS_PER_FEED--------------------
:Applications: ``pinax.apps.blog``:Default: ``20``
With this option the number of posts that should be served in the feedsgenerated by Pinax' blogging application can be configured.
.. _ref-settings-pinax-root:
PINAX_ROOT----------
http://pinaxproject.com/docs/dev/_sources/settings.txt (3 of 7) [12/8/10 1:40:21 AM]
http://pinaxproject.com/docs/dev/_sources/settings.txt
:Application: ``staticfiles``
Normally you shouldn't need to change this setting. It's a reference to wherePinax itself is installed so that you can easily re-use for instance templatesfrom that location or work with the original static files likethe ``build_media`` command does. There this settng is used to find themedia files of those internal applications used in your project, which arethen copied into one central location.
For more on this topic take a look at :ref:`ref-media`.
It is also used by default in project settings for determining a templatedirectory.
.. _ref-settings-pinax-theme:
PINAX_THEME-----------
:Applications::Default: ``"default"``
With Pinax your site can have multiple themes available. This option nowdetermines, which one of these should be used. In practice the value of``PINAX_THEME`` becomes part of the file-paths the ``build_media`` command islooking for when trying to combine all your media files into one singlelocation. A small example:: src/pinax/media/default/pinax/img/logo.png
is a file that is specific to the "default" theme for Pinax while:: src/pinax/media/new_hotness/pinax/img/logo.png
would only be available in the "new_hotness" theme.
This setting is also used for the core templates that are provided with Pinaxby default. The default ``settings.py`` files provided by Pinax for instanceload templates from following locations:: TEMPLATE_DIRS = [ os.path.join(PROJECT_ROOT, "templates"), os.path.join(PINAX_ROOT, "templates", PINAX_THEME), ] Note that this setting only applies to Pinax' core media files and templatesand is not used either in the internal nor the external apps by default.
.. _ref-settings-restructuredtext-filter-settings:
RESTRUCTUREDTEXT_FILTER_SETTINGS--------------------------------
http://pinaxproject.com/docs/dev/_sources/settings.txt (4 of 7) [12/8/10 1:40:21 AM]
http://pinaxproject.com/docs/dev/_sources/settings.txt
:Applications: ``pinax.apps.blog``:Default: ``{}``
Using this option you can pass additional settings as dictionary through the``restructuredtext`` template library to the underlying``docutils.core.publish_parts`` function.
.. _ref-settings-serve-media:
SERVE_MEDIA-----------
This option is used in the standard projects' URLconf to determine, if``django.views.static.serve`` should be used to serve static files. By defaultthis settings is bound to the ``DEBUG`` setting in the default``settings.py``.
STATIC_ROOT-----------
:Default: ``"<PROJECT_ROOT>/site_media/static"``
The absolute path to the directory that holds static files like app media::
STATIC_ROOT = "/home/polls.com/polls/site_media/static/"
This is only used by the default static files storage (i.e. if you use adifferent ``STATICFILES_STORAGE_``, you don't need to set this).
STATIC_URL----------
:Default: ``"/site_media/static/"``
URL that handles the files served from STATIC_ROOT, e.g.::
STATIC_URL = "/site_media/static/"
Note that this should **always** have a trailing slash.
STATICFILES_DIRS----------------
This setting defines the additional locations the ``staticfiles`` app willtraverse when looking for media files, e.g. if you use the:ref:`build_static <ref-media-build_static>` or:ref:`resolve_static <ref-media-resolve_static>` management command oruse the :ref:`static file serving view <ref-media-devel>`.
It should be defined as a sequence of paths to static file directories, e.g.::
STATICFILES_DIRS = [
http://pinaxproject.com/docs/dev/_sources/settings.txt (5 of 7) [12/8/10 1:40:21 AM]
http://pinaxproject.com/docs/dev/_sources/settings.txt
os.path.join(PROJECT_ROOT, "media"), os.path.join(PINAX_ROOT, "media", PINAX_THEME), ]
In case you specifically want to load media from a certain location you canprefix the path of the media file by using a ``(prefix, path)`` tuple instead,e.g.::
STATICFILES_DIRS = [ os.path.join(PROJECT_ROOT, "media"), os.path.join(PINAX_ROOT, "media", PINAX_THEME), ("xmas", "/var/www/xmax-special/media"), ]
In your HTML you then would be able to use the following snippet to load thefancy christmas stylesheet::
<link rel="stylesheet" href="{{ STATIC_URL }}xmas/css/base.css" type="text/css" media="screen" />
The directory ``/var/www/xmax-special`` would look like this::
media/ `-- css `-- base.css
STATICFILES_PREPEND_LABEL_APPS------------------------------
:Default: ``["django.contrib.admin"]``
A sequence of app paths that have the media files in ``<app>/media``, not in``<app>/media/<app>``, e.g. ``django.contrib.admin``.
STATICFILES_MEDIA_DIRNAMES--------------------------
:Default: ``["media"]``
A sequence of directory names to be used when searching for media files ininstalled apps, e.g. if an app has its media files in ``<app>/static``use::
STATICFILES_MEDIA_DIRNAMES = [ "media", "static", ]
STATICFILES_STORAGE-------------------
:Default: ``"staticfiles.storage.StaticFileStorage"``
The storage backend to use for copying static files to a single location.
http://pinaxproject.com/docs/dev/_sources/settings.txt (6 of 7) [12/8/10 1:40:21 AM]
http://pinaxproject.com/docs/dev/_sources/settings.txt
.. _ref-settings-urchin-id:
URCHIN_ID---------
:Applications: ``pinax.apps.analytics``
Used by ``pinax.apps.analytics`` as part of your account information on `GoogleAnalytics`_. Based on this setting the JavaScript is generated that is thenembedded into your website to allow Google Analytics to track your traffic.
Tracking code will not be outputted if ``DEBUG`` is ``True`` to preventunnecessary tracking.
.. _google analytics: http://analytics.google.com/
.. _ref-settings-markup-choices:
MARKUP_CHOICES--------------
:Applications: ``pinax.apps.blog``, ``pinax.apps.tasks``:Default: ``[("restructuredtext", u"reStructuredText"), ("textile", u"Textile"), ("markdown", u"Markdown"), ("creole", u"Creole")]``
http://pinaxproject.com/docs/dev/_sources/settings.txt (7 of 7) [12/8/10 1:40:21 AM]
http://pinaxproject.com/docs/dev/_sources/dependencies.txt
Dependencies============
This documents what apps use what other apps and what external libs.It is divided into the Pinax core apps and dependent apps that areloaded as part of the install process.
Pinax Apps----------
These are the apps you will find within the Pinax package.
account uses apps emailconfirmation, friends, profiles, timezones, microblogging, openid
analytics no dependencies outside Django
authsub uses library gdata
autocomplete_app uses avatar, basic_profiles, friends, notification, profiles
basic_profiles uses app notification
bbauth uses library ybrowserauth
blog uses apps friends, notification, tagging, threadedcomments and libraries atomformat, creole, docutils
groups no dependencies outside Django
photos uses apps photologue, projects, tagging, tribes
profiles uses apps account, friends, gravatar, notification, photos, timezones, microblogging
http://pinaxproject.com/docs/dev/_sources/dependencies.txt (1 of 6) [12/8/10 1:40:24 AM]
http://pinaxproject.com/docs/dev/_sources/dependencies.txt
projects uses apps friends, notification, photos, tagging, things, threadedcomments, wiki
signup_codes uses account
tagging_utils uses tagging
tasks uses attachments, dpaste, notification, tagging, tagging_utils, threadedcomments, and library atomformat
threadedcomments_extras no dependencies outside Django
topics uses notification, tagging, threadedcomments
tribes uses apps groups, notification
voting_extras uses voting
waitinglist no dependencies outside Django
External Apps-------------
These are the external apps that Pinax uses.
biblion
django_ajax_validation
django_announcements uses app notification and library atomformat
http://pinaxproject.com/docs/dev/_sources/dependencies.txt (2 of 6) [12/8/10 1:40:25 AM]
http://pinaxproject.com/docs/dev/_sources/dependencies.txt
django_atomformat
django_attachments
django_avatar uses library PIL django_bookmarks uses apps tagging, voting and library atomformat
django_db_log
django_dbtemplates
django_email_confirmation uses app mailer
django_extensions uses a wide range of libraries depends on command
django_filters
django_flag
django_friends uses apps emailconfirmation, mailer, notification and libraries gdata, vobject, ybrowserauth
django_frontendadmin
django_generic_flatblocks
django_gravatar
django_groups
django_locations
django_mailer
django_markup
http://pinaxproject.com/docs/dev/_sources/dependencies.txt (3 of 6) [12/8/10 1:40:25 AM]
http://pinaxproject.com/docs/dev/_sources/dependencies.txt
django_messages uses app mailer, notification
django_microblogging uses apps account, notification, tribes and libraries atomformat, twitter
django_notification uses app mailer and library atomformat
django_oembed
django_openid uses libraries openid, yadis
django_pagination
django_photologue uses app tagging and library PIL, EXIF django_robots
django_sorting
django_staticfiles
django_swaps uses apps notification, tagging, threadedcomments
django_tagging
django_tagging_ext
django_threadedcomments
django_timezones uses library pytz
django_uni_form
http://pinaxproject.com/docs/dev/_sources/dependencies.txt (4 of 6) [12/8/10 1:40:25 AM]
http://pinaxproject.com/docs/dev/_sources/dependencies.txt
django_voting uses library simplejson
django_wakawaka
Pinax Apps Within Projects--------------------------
friends_app (social_project) uses apps account, friends, notification
about
External Libraries------------------
atom
creole
diff_match_patch
docutils
elementtree
gdata
geopy
markdown
pip
pygments
python_openid
python_twitter
python_yadis
http://pinaxproject.com/docs/dev/_sources/dependencies.txt (5 of 6) [12/8/10 1:40:25 AM]
http://pinaxproject.com/docs/dev/_sources/dependencies.txt
pytz
smartypants
sorl
textile
vobject
ybrowserauth
http://pinaxproject.com/docs/dev/_sources/dependencies.txt (6 of 6) [12/8/10 1:40:25 AM]
http://pinaxproject.com/docs/dev/_sources/faq.txt
.. _ref-faq:
Frequently asked questions==========================
Does Pinax work on Django 1.1?------------------------------
Yes. Pinax 0.7 ships with Django 1.0.4 by default. Django 1.1 came too late inour 0.7 release cycle. However, we tested it on Django 1.1 to ensure it worksand it works well. To use Django 1.1 in your Pinax project simply follow our:ref:`installation <ref-install>` documentation and once you are in thevirtual environment run::
pip install -U Django==1.1.1
This will install Django 1.1.1 over 1.0.4.
Does Pinax work on Django 1.2?------------------------------
Yes and no. Our stable release 0.7.X (at 0.7.2) does not support Django 1.2.We will attempt to make 0.7.3 compatible to run on Django 1.2. InstallingDjango 1.2 over 1.0 that ships with 0.7 will work the same way as seen above.We hope to release 0.7.3 soon. There are no timelines.
On the other hand our development version of Pinax will ship with Django 1.2.Stay tuned for more news regarding the releases of 0.9.
How do I change the references to example.com---------------------------------------------
``example.com`` is the default value for``Site.objects.get(pk=settings.SITE_ID).domain``. This comes from the Djangocontrib app named ``sites``. It is enabled in Pinax by default. Pinax usesthis value to construct URLs back to your site in e-mails, for example. Thereare two ways to change this value. First, you can modify it in the shell(using ``python manage.py shell``)::
>>> from django.conf import settings
http://pinaxproject.com/docs/dev/_sources/faq.txt (1 of 2) [12/8/10 1:40:28 AM]
http://pinaxproject.com/docs/dev/_sources/faq.txt
>>> from django.contrib.sites.models import Site >>> site = Site.objects.get(pk=settings.SITE_ID) >>> site.domain = "localhost:8000" >>> site.name = "Development site" >>> site.save()
Alternatively, you can perform the same action through the admin interface.
.. image:: _images/admin_sites_change.jpg
Why won't my e-mail send?-------------------------
Pinax queues all e-mail for delivery. This is the behavior of django-mailer.All messages are stored in the database. This enables you to view what willbe sent via the admin during development.
.. image:: _images/admin_mailer_messages.jpg
To send the messages that are queued you should use the ``send_mail``management command. To invoke this you would run::
python manage.py send_mail
Be sure you have set the appropriate ``EMAIL_*`` settings. A full list ofthese settings can be found `in Django settings documentation`_. Our:ref:`deployment <ref-sending-mail-and-notices>` documentation givesinstructions on how to set this up on a cron.
Also, some e-mail may occur as a result of notifications. Some notificationsare queued. Be sure you run::
python manage.py emit_notices
to clear the notification queue and get those e-mails queued.
.. _in Django settings documentation: http://docs.djangoproject.com/en/dev/ref/settings/#email-host
http://pinaxproject.com/docs/dev/_sources/faq.txt (2 of 2) [12/8/10 1:40:28 AM]
http://pinaxproject.com/docs/dev/_sources/contributing.txt
.. _ref-contributing:
Contributing to Pinax=====================
We are always looking for people wanting to improve Pinax itself. Thisdocument outlines the necessary bits to begin contributing to Pinax.
Getting started---------------
The Pinax source code is hosted on GitHub_. This means you must have git_installed locally. We recommend you create an account on GitHub allowing youto watch and fork the Pinax source code.
You will want to be sure that your git configuration is set for making commitsto a repository. Check the following::
git config user.name git config user.email
If the output of any of the two commands above are not entirely correct youcan easily correct them::
git config --global user.name "First Last" git config --global user.email "[email protected]"
It is critical you set this information up correctly. It helps us identifywho you are when you start giving us those awesome patches.
.. _`GitHub`: http://github.com/pinax/pinax/tree/master
.. _git: http://git-scm.com
Grabbing the source code~~~~~~~~~~~~~~~~~~~~~~~~
Once you have forked the Pinax source code you can now make a clone of it toyour local disk. To do this::
git clone [email protected]:<username>/pinax.git
This will create new directory named ``pinax`` which now contains the Pinax
http://pinaxproject.com/docs/dev/_sources/contributing.txt (1 of 7) [12/8/10 1:40:33 AM]
http://pinaxproject.com/docs/dev/_sources/contributing.txt
source tree ready for you to get started.
Setting up your environment~~~~~~~~~~~~~~~~~~~~~~~~~~~
Now that you've cloned the source code you are ready to get your environmentsetup to work on Pinax. You should be a running a recent release of`virtualenv`_ to setup Pinax. We'll assume that your current working directoryis from within the clone (the ``pinax`` directory)::
virtualenv ../pinax-dev source ../pinax-dev/bin/activate pip install -e .
Finally, you need to install the dependencies for the development version::
pip install --no-deps --requirement requirements/development.txt
In order to run the test suite, you'll also need PIL installed::
pip install PIL
.. _virtualenv: http://pypi.python.org/pypi/virtualenv
Staying up-to-date------------------
The development version of Pinax is always being updated. You'll want to makesure you keep up. Your clone of Pinax can easily stay in-sync using git. Youwill need to setup a git remote to pull in changes from upstream Pinax::
git remote add upstream git://github.com/pinax/pinax.git
Now you will be able to merge in changes that are made upstream::
git fetch upstream git merge upstream/master
The above will pull in all changes upstream and merge them with your currentbranch. This can be simplified::
git pull upstream master
http://pinaxproject.com/docs/dev/_sources/contributing.txt (2 of 7) [12/8/10 1:40:33 AM]
http://pinaxproject.com/docs/dev/_sources/contributing.txt
To keep your virtual environment in-sync you will need to use pip (make sureyou are **inside** your virtual environment)::
pip install --no-deps --requirement requirements/external_apps.txt
Running the tests-----------------
Before you begin committing code you'll want to make sure the Pinax test suitepasses. Running the test suite is simple. At the root of your Pinax clonerun::
python tests/runner.py
You must be inside the development virtual environment for this to work. Ifyou only want to run a subset of tests (all tests are inside apps) you canspecify them explicitly::
python tests/runner.py tasks projects
This useful while developing. However, be sure to run the full suite beforecommitting any code to ensure it doesn't break other parts of Pinax.
.. note::
The test runner is new as of November 29, 2009. There are currently many failing tests. We are working on it. This message will be removed when the test suite is generally usable for contributors.
Committing code---------------
The great thing about using a distributed versioning control system like gitis that everyone becomes a committer. When other people write good patchesit makes it very easy to include their fixes/features and give them propercredit for the work.
We recommend that you do all your work on Pinax in a separate branch. When youare ready to work on a bug or a new feature create yourself a new branch. Thereason why this is important is you can commit as often you like. When you areready you can merge in the change. Let's take a look at a common workflow::
git checkout -b task-566
http://pinaxproject.com/docs/dev/_sources/contributing.txt (3 of 7) [12/8/10 1:40:33 AM]
http://pinaxproject.com/docs/dev/_sources/contributing.txt
... fix and git commit often ... git push origin task-566
The reason we have created two new branches is to stay off of ``master``.Keeping master clean of only upstream changes makes yours and ours liveseasier. You can then send us a pull request for the fix/feature. Then we caneasily review it and merge it when ready.
Writing commit messages~~~~~~~~~~~~~~~~~~~~~~~
Writing a good commit message makes it simple for us to identify what yourcommit does from a high-level. We are not too picky, but there are some basicguidelines we'd like to ask you to follow.
::
Fixed #1 — added some feature
We ask that you indicate which task you have fixed (if the commit fixes it) orif you are working something complex you may want or be asked to only commitsparts::
Refs #1 — added part one of feature X
As said earlier we are not too picky (some core developers may change commitmessages before pulling in your changes), but as you get the basics down youmake the process of getting your patch into core faster.
Another critical part is that you keep the **first** line as short and sweetas possible. This line is important because when git shows commits and it haslimited space or a different formatting option is used the first line becomesall someone might see. If you need to explain why you made this change orexplain something in detail use this format::
Fixed #13 — added time travel You need to be driving 88 miles per hour to generate 1.21 gigawatts of power to properly use this feature.
Coding style------------
http://pinaxproject.com/docs/dev/_sources/contributing.txt (4 of 7) [12/8/10 1:40:33 AM]
http://pinaxproject.com/docs/dev/_sources/contributing.txt
When writing code to be included in Pinax keep our style in mind:
* Follow PEP8_ — there are some cases where we do not follow PEP8. It is an excellent starting point. * Follow `Django's coding style`_ — we're pretty much in agreement on Django style outlined there.
We would like to enforce a few more strict guides not outlined by PEP8 orDjango's coding style:
* PEP8 tries to keep line length at 80 characters. We follow it when we can, but not when it makes a line harder to read. It is okay to go a little bit over 80 characters if not breaking the line improves readability. * Use double quotes not single quotes. Single quotes are allowed in cases where a double quote is needed in the string. This makes the code read cleaner in those cases. * Blank lines are indented to the appropriate level for the block they are in. * Docstrings always use three double quotes on a line of their own, so, for example, a single line docstring should take up three lines not one. * Imports are grouped specifically and ordered alphabetically. This is shown in the example below. * Always use ``reverse`` and never ``@models.permalink``. * Tuples should be reserved for positional data structures and not used where a list is more appropriate. * URL patterns should use the ``url()`` function rather than a tuple.
Here is an example of these rules applied::
# first set of imports are stdlib imports # non-from imports go first then from style import in their own group import csv from datetime import datetime # second set of imports are Django imports with contrib in their own # group. from django.core.urlresolvers import reverse from django.db import models from django.utils.translation import ugettext_lazy as _ from django.contrib.auth.models import User
http://pinaxproject.com/docs/dev/_sources/contributing.txt (5 of 7) [12/8/10 1:40:33 AM]
http://pinaxproject.com/docs/dev/_sources/contributing.txt
# third set of imports are Pinax imports from pinax.utils.examplelib import function_name # forth set of imports are external apps (if applicable) from tagging.fields import TagField # fifth set of imports are local apps from pinax.apps.tasks.fields import MarkupField class Task(models.Model): """ A model for storing a task. """ creator = models.ForeignKey(User) created = models.DateTimeField(default=datetime.now) modified = models.DateTimeField(default=datetime.now) objects = models.Manager() class Meta: verbose_name = _("task") verbose_name_plural = _("tasks") def __unicode__(self): return self.summary def save(self, **kwargs): self.modified = datetime.now() super(Task, self).save(**kwargs) def get_absolute_url(self): return reverse("task_detail", kwargs={"task_id": self.pk}) # custom methods class TaskComment(models.Model): # ... you get the point ... pass
http://pinaxproject.com/docs/dev/_sources/contributing.txt (6 of 7) [12/8/10 1:40:33 AM]
http://pinaxproject.com/docs/dev/_sources/contributing.txt
.. _PEP8: http://www.python.org/dev/peps/pep-0008/
.. _`Django's coding style`: http://docs.djangoproject.com/en/dev/internals/contributing/#coding-style
http://pinaxproject.com/docs/dev/_sources/contributing.txt (7 of 7) [12/8/10 1:40:33 AM]
http://pinaxproject.com/docs/dev/_sources/buildout.txt
.. _ref-buildout:
========Buildout========
Intro=====
The de facto Pinax_ build process has a couple manual steps but thebulk of the work is done by the ``pinax-boot.py`` script. The 0.7series introduced the use of pip_ which installs python parts into the``site-packages`` directory, presuming a virtualenv_ to avoidpolluting the system python.
Many folks like using `zc.buildout`_, a generic tool frequently used tobuild projects, especially when there are a number of componentsinvolved. It came from the Zope_ world and is heavily used by the Plone_community for building sites. Rather than installing libraries into``site-packages``, interpreters and running systems have their sys.pathset to include all the eggs and libraries and parts as required by thebuildout definitions.
The Django_ community has typically not been big on using buildout_,but recently Jacob Kaplan-Moss has written a couple_ enthusiastictutorials_ on how to use it.
Pinax has many many components so it seems a natural candidate forbuildout.
Virtualenv (optional)=====================
In the bad old days developers installed libraries into the systemPython's ``site-packages``; your operating system packager may havedone the same thing for their own needs. This of course leads toproblems akin to "DLL Hell", with different applications needingdifferent libraries or versions.
Virtualenv creates a private copy of your python with its own``site-packages`` directory so you can install as a normal user and eachproject can have it's own set of libraries.
http://pinaxproject.com/docs/dev/_sources/buildout.txt (1 of 5) [12/8/10 1:40:37 AM]
http://pinaxproject.com/docs/dev/_sources/buildout.txt
I tend to install a very minimal set of critical tools into my systempython: setuptools and virtualenv. All my application's libraries areinstalled into the running code's sys.path by buildout, so I don't endup with conflicts.
If, however, you do keep a bunch of libraries in your system``site-packages``, they will be visible to an application you create withbuildout -- buildout doesn't isolate you from ``site-packages`` [`whynot?`_]. It's safest to create a virtual environment::
virtualenv --no-site-packages .
The dot indicates to create the virtualenv in this current directory,where our Pinax build will be done. Then activate it::
source bin/activate
Now when you say "python" it should get your private python.
Building========
Before you can start to bootstrap the buildout you need to get the necessaryfiles by cloning the Git repository `pinax-buildout`_::
$ git clone git://github.com/pinax/pinax-buildout.git
Since it's a good idea to create a new buildout for each Pinax based projectdon't hesitate to rename the ``pinax-buildout`` directory to your liking.
.. _pinax-buildout: http://github.com/pinax/pinax-buildout/
Bootstrap---------
If you created and activated a virtual python, or want to use thesystem one that's on your PATH, bootstrap the buildout::
$ python bootstrap.py
If you create a private python or need to use a specific one (e.g., anon-default python version) do something like::
http://pinaxproject.com/docs/dev/_sources/buildout.txt (2 of 5) [12/8/10 1:40:37 AM]
http://pinaxproject.com/docs/dev/_sources/buildout.txt
$ /path/to/specific/python bootstrap.py
This creates the bin/buildout command used next::
Creating directory '/path/to/pinax-buildout/bin'. Creating directory '/path/to/pinax-buildout/parts'. Creating directory '/path/to/pinax-buildout/eggs'. Creating directory '/path/to/pinax-buildout/develop-eggs'. Generated script '/path/to/pinax-buildout/bin/buildout'.
You should only need to do this once, before you run your buildout.
Buildout--------
Now you can run the buildout. It uses the configuration ``buildout.cfg``file to drive the build. You can create layered buildout config files,like for the project base then variants for development anddeployment, but we'll only worry about a single configuration here.
The ``buildout.cfg`` file specifies various parts anddependencies. Run the buildout with a bit of verbosity like::
$ bin/buildout -v
Installing 'zc.buildout', 'setuptools'. ... Generated script '/path/to/pinax-buildout/bin/ipython'. Generated script '/path/to/pinax-buildout/bin/pinax-admin'. Generated script '/path/to/pinax-buildout/bin/django-admin'.
Since our ``buildout.cfg`` specifies a lot of pieces needed by Pinax,this can take a little time the first time its run. Subsequent timesshould take less time.
I've specified parts in the buildout to build pieces that can be a bittroublesome, specifically PIL_ and the zlib_ that it depends on.
When finished, the buildout creates a ``bin/django-admin`` command that'sanalogous to Django's ``django-admin.py``. It also creates a``bin/pinax-admin`` script to call:ref:`clone_project <customization-cloneproject>` for example.
http://pinaxproject.com/docs/dev/_sources/buildout.txt (3 of 5) [12/8/10 1:40:37 AM]
http://pinaxproject.com/docs/dev/_sources/buildout.txt
You will need to re-rerun this if you modify the ``buildout.cfg`` --perhaps to add other components your application needs.
Running=======
After your buildout completes, you can use the ``bin/django-admin`` commandsas to initialize your database and run your site.
Syncdb------
At this point you should have the ``bin/pinax`` command and be able tocreate your database from the Pinax models::
$ bin/django-admin syncdb
Runserver---------
Then you can run your application::
$ bin/django-admin runserver
Python Interpreter------------------
The buildout also creates a python interpreter that has all the eggsand libraries configured into it, which you can run like::
$ bin/python
.. _Pinax: http://pinaxproject.com/
.. _pip: http://pypi.python.org/pypi/pip
.. _virtualenv: http://pypi.python.org/pypi/virtualenv
.. _zc.buildout: http://pypi.python.org/pypi/zc.buildout
.. _Zope: http://www.zope.org/
.. _Plone: http://plone.org/
.. _Django: http://www.djangoproject.com/
.. _buildout: http://www.buildout.org/
.. _tutorials: http://jacobian.org/writing/more-buildout-notes/
.. _couple: http://jacobian.org/writing/django-apps-with-buildout/
http://pinaxproject.com/docs/dev/_sources/buildout.txt (4 of 5) [12/8/10 1:40:37 AM]
http://pinaxproject.com/docs/dev/_sources/buildout.txt
.. _djangorecipe: http://pypi.python.org/pypi/djangorecipe
.. _why not?: http://svn.zope.org/zc.buildout/trunk/buildout.cfg?rev=97819&view=rev
.. _PIL: http://www.pythonware.com/products/pil/
.. _zlib: http://www.zlib.net/
http://pinaxproject.com/docs/dev/_sources/buildout.txt (5 of 5) [12/8/10 1:40:37 AM]
http://pinaxproject.com/docs/dev/_sources/pil.txt
.. _ref-pil:
Installing PIL==============
To be able to run the ``social_project`` or any photo support provided withPinax you will need the `Python Imaging Library`_ (aka PIL). We don't installthis for you because its installation will vary and requires compilation.First, check with your OS package manager (if applicable) to see if it canprovide PIL for you. Windows users can simply use the binaries provided on thePIL website.
This command has worked for some users; it installs a tweaked version::
(pinax-env)$ pip install PIL
Of course you'll need a C compiler `libjpeg`_ and `libz`_ libraries upon whichPIL depends.
.. note::
PIL will install *without* `libjpeg`_ and `libz`_. It simply won't support JPEGs or PNGs.
.. _`Python Imaging Library`: http://www.pythonware.com/products/pil/
.. _`libjpeg`: http://freshmeat.net/projects/libjpeg/
.. _`libz`: http://www.zlib.net/
http://pinaxproject.com/docs/dev/_sources/pil.txt [12/8/10 1:40:41 AM]
http://pinaxproject.com/docs/dev/_sources/tabs.txt
.. _ref-tabs:
Tab Navigation==============
You can completely control the look and feel of your Pinax-based sitevia the templates, so if you don't like the way the tabs are done, youcan always do it a completely different way.
But this is how tab navigation is done in most of the sample projects.
Quick Start-----------
Here is how to add a new tab for your app ``myapp``:
1. In ``site_base.html`` add a new ``li`` in the ``right_tabs`` block. Make sure that ``li`` has and ``id`` specific to that to that tab, e.g. ``tab_myapp``
2. Create a ``myapps/base.html`` template that all pages under that tab will extend. Make sure it defines a block ``body_class`` with content ``myapp`` 3. edit the CSS file (``site_tabs.css`` if it exists) and at the appropriate points add the selectors: * ``body.myapp #tab_myapp`` * ``body.myapp #tab_myapp a``
Details-------
The global ``base.html`` (under ``pinax/templates/default/``) has the following::
... <body class="{% block body_class %}{% endblock %}"> ... <div id="tabhead"> ... <div id="left_tabs" >{% block left_tabs %}{% endblock %}</div> <div id="right_tabs" >{% block right_tabs %}{% endblock %}</div> </div> <div id="subnav" class="clearfix">{% block subnav_base %}{% block subnav %} {% endblock %}{% endblock %}</div>
Note that this defines five blocks:
* ``body_class`` * ``left_tabs`` * ``right_tabs`` * ``subnav``
http://pinaxproject.com/docs/dev/_sources/tabs.txt (1 of 3) [12/8/10 1:40:44 AM]
http://pinaxproject.com/docs/dev/_sources/tabs.txt
You shouldn't normally need to change this at all for your site unlessyou want to make a change like move where the subnav goes.
``site_base.html`` in your project's templates then overrides the ``left_tabs``and or ``right_tabs`` blocks with the actual site-wide tabs. For example, here is a``right_tabs`` with three tabs defined that only show when the user islogged in:
:: {% block right_tabs %} {% if user.is_authenticated %} <ul class="tabs">{% spaceless %} <li id="tab_profile"><a href="{% url profile_detail user.username %}">Profile</a></li> <li id="tab_blogs"><a href="{% url blog_list_user %}">Blogs</a></li> <li id="tab_bookmarks"><a href="{% url all_bookmarks %}">Bookmarks</a></li> {% endspaceless %}</ul> {% endif %} {% endblock %}
Note that each ``li`` is given an ``id`` specific to the tab, e.g. ``tab_bookmarks``for the bookmarks tab.
Now, any page under the bookmarks tab extends the template``bookmarks/base.html`` which looks something like this:
:: {% extends "site_base.html" %} {% block body_class %}bookmarks{% endblock %} {% block subnav %} <ul> <li><a href="{% url add_bookmark %}">Add Bookmark</a></li> <li><a href="{% url your_bookmarks %}">Your Bookmarks</a></li> <li><a href="{% url all_bookmarks %}">All Bookmarks</a></li> </ul> {% endblock %}
Notice that this bookmarks-specific base template defines the ``subnav``block which provides the subnav for all bookmarks pages.
It also defines the ``body_class`` block we saw used by the global ``base.html``.
Now all that remains is the CSS that ties the ``body`` in ``base.html``with ``class="bookmarks``" to the ``li`` in ``site_base.html`` that has``id="tab_bookmarks"``.
This is done in CSS.:: /* SITE-SPECIFIC TAB STYLING */
http://pinaxproject.com/docs/dev/_sources/tabs.txt (2 of 3) [12/8/10 1:40:44 AM]
http://pinaxproject.com/docs/dev/_sources/tabs.txt
body.profile #tab_profile a, body.blogs #tab_blogs a, body.bookmarks #tab_bookmarks a { color: #000; /* selected tab text colour */ } body.profile #tab_profile, body.blogs #tab_blogs, body.bookmarks #tab_bookmarks { margin: 0; /* to compensate for border */ padding: 5px 0 5px; background-color: #DEF; /* selected tab colour */ border-left: 1px solid #000; /* tab border */ border-top: 1px solid #000; /* tab border */ border-right: 1px solid #000; /* tab border */ }
Notice that the selector ``body.bookmarks #tab_bookmarks`` appears twice.
http://pinaxproject.com/docs/dev/_sources/tabs.txt (3 of 3) [12/8/10 1:40:44 AM]
http://pinaxproject.com/docs/dev/_sources/external_apps.txt
External Apps=============
The majority of functionality in Pinax is provided by external, reusableDjango apps.
.. toctree:: :maxdepth: 1
external/emailconfirmation/index external/timezones/index external/threadedcomments/index external/ajax-validation/index external/flag/index external/pagination/index external/oembed/index external/notification/index external/mailer/index external/dbtemplates/index external/robots/index external/announcements/index external/messages/index
http://pinaxproject.com/docs/dev/_sources/external_apps.txt [12/8/10 1:40:47 AM]
http://pinaxproject.com/docs/dev/_sources/external/emailconfirmation/index.txt
#########################django-email-confirmation#########################
This simple app is for cases where you don't want to require an emailaddress to signup on your website but you do still want to ask for anemail address and be able to confirm it for use in optional parts ofyour website.
A user can have zero or more email addresses linked to them. The userdoes not have to provide an email address on signup but, if they do,they are emailed with a link they must click on to confirm that theemail address is theirs. A confirmation email can be resent at anytime.
What's on the trunk here should be usable but I welcome feedback on howto make it better. The source contains a working project that shows allthe features of the app as well as providing useful code for your ownproject (although Pinax is a more comprehensive example of how to usedjango-email-confirmation).
This code is based in part on django-registration and is essentiallya replacement for it where your requirements are different.
http://pinaxproject.com/docs/dev/_sources/external/emailconfirmation/index.txt [12/8/10 1:40:50 AM]
http://pinaxproject.com/docs/dev/_sources/external/timezones/index.txt
################django-timezones################
This simple app is for localizing datetimes for the user. Timezone handlingcan be a bit tricky so the goal is to get rid of the guessing game and providea simple interface to localizing datetimes for your users.
Contents:
.. toctree::
how_to_use
http://pinaxproject.com/docs/dev/_sources/external/timezones/index.txt [12/8/10 1:40:54 AM]
http://pinaxproject.com/docs/dev/_sources/external/timezones/how_to_use.txt
===========================How-to Use django-timezones===========================
To get started using django-timezones make sure you have placed it on thePYTHONPATH somehow and that you have `pytz`_ installed.
.. _pytz: http://pypi.python.org/pypi/pytz/
http://pinaxproject.com/docs/dev/_sources/external/timezones/how_to_use.txt [12/8/10 1:40:57 AM]
http://pinaxproject.com/docs/dev/_sources/external/threadedcomments/index.txt
#######################django-threadedcomments#######################
Django-threadedcomments is a simple yet flexible threaded commenting system for Django. What it means to say that they are *threaded* is that commenters can reply not only to the original item, but to other comments as well. It becomesnear-trivial to create a system similar to what Reddit or Digg have in their comments sections.
Contents:
.. toctree::
pinax.txt
http://pinaxproject.com/docs/dev/_sources/external/threadedcomments/index.txt [12/8/10 1:41:00 AM]
http://pinaxproject.com/docs/dev/_sources/external/threadedcomments/pinax.txt
======================================Using django-threadedcomments in Pinax======================================
While it's perfectly feasible to use the standard threadedcomments templatetagsand views, if you're using django-threadedcomments from within Pinax, it's eveneasier. We've built a small abstraction on top of threadedcomments to builda standard comment form that integrates with the existing CSS and templatelayout.
To use this abstraction layer, in your templates, first make sure to load ourabstraction layer::
{% load comments_tag %}
Then determine the object on which you would like to comment. In our example,it will be a context variable called ``post``. Now, just include this tag::
{% comments post %}
And that's it! Behind the scenes, the ``threadedcomments/comments.html``template is being loaded and rendered with the following context variables:
``object``: The object on which to comment. ``request``: Django's standard ``request`` object.
``user``: The currently logged-in user's ``User`` instance.
http://pinaxproject.com/docs/dev/_sources/external/threadedcomments/pinax.txt [12/8/10 1:41:03 AM]
http://pinaxproject.com/docs/dev/_sources/external/ajax-validation/index.txt
######################django-ajax-validation######################
This is a fairly simple application for performing ajax validation of forms created using Django's forms system. Currently it only works with jQuery.
Contents:
.. toctree::
usage serving-ajax-validation-media-server
http://pinaxproject.com/docs/dev/_sources/external/ajax-validation/index.txt [12/8/10 1:41:06 AM]
http://pinaxproject.com/docs/dev/_sources/external/ajax-validation/usage.txt
=====Usage=====
To use, Ajax Validation requires only that you add a URL(one per form), and some javascript to any page with the form.
For example, if you had the following form::
from django import forms
class ContactForm(forms.Form): name = forms.CharField(label='Your Name') email = forms.EmailField(label='Your Email') message = forms.CharField(label='Your Message', widget=forms.Textarea)
You would need to add the following url to your urls.py(you also need to import the form class)::
(r'^SOME/URL/$', 'ajax_validation.views.validate', {'form_class': ContactForm}, 'contact_form_validate')
The URL can take any arguments(named, or unamed), and you can also provide acallback function, this function is given request, \*args, and \*\*kwargs andshould return a dictionary which is passed to the form constructor.
And then in the template in which you are displaying the form, you should add::
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script> {% load jquery_validation %} {% include_validation %} <script type="text/javascript"> $(function() { $('#form').validate('{% url contact_form_validate %}', {type: 'ul', fields: ['email'], dom: $('#id_email'), event: 'keyup'}); $('#form').validate('{% url contact_form_validate %}', {type: 'ul'}); }); </script>
As you can see, you need to have jQuery for this to work(here it is being loadedfrom google). In the javascript you use jQuery's selectors to select where theform is, and the validate method takes 5 parameters, all optional, first is theURL of the validation, here we reverse the URL we set up earlier. The secondparameter is a dictionary, it is optional and should either provide type(ul,table, or p), this is the type of renderer you used for django's forms(form.as_p,etc.), the default is table if nothing is provided. It can also take a callbackoption which is a function that recieves data, which is the JSON representationof any errors, and form, which is the jquery object that you provided. Finally,it takes fields, which is a list of the fields that should be validated, it willnot display errors that aren't in that list of fields. The last 2 options aredom and event, these allow you to choose when the validation will occur, domshould be a jQuery object(i.e.: $('#my_field')), and event should be a jQueryevent(listed `here`_).
http://pinaxproject.com/docs/dev/_sources/external/ajax-validation/usage.txt (1 of 2) [12/8/10 1:41:09 AM]
http://pinaxproject.com/docs/dev/_sources/external/ajax-validation/usage.txt
.. _here: http://docs.jquery.com/Events/bind#overview
In addition you can provide a callable option, ``submitHandler``. Thisrecieves the form DOM object and can do whatever it pleases. If it returnstrue the form will be submitted, else it won't.
http://pinaxproject.com/docs/dev/_sources/external/ajax-validation/usage.txt (2 of 2) [12/8/10 1:41:09 AM]
http://pinaxproject.com/docs/dev/_sources/external/ajax-validation/serving-ajax-validation-media-server.txt
=====================================================Serving Ajax Validation With Your Static Media Server=====================================================
By default, if you use the template tag included with Ajax Validation, the script will be placed inside HTML <script> tags and served up this way. This is usually fine for development, however for production it is reccomended you serve Ajax Validation with your seperate static media server.
To do this you should copy the ``jquery-ajax-validation.js`` file from ``ajax_validation/media/ajax_validation/js/`` and put it somewhere in the directory structure where the rest of your site's static media is. You should then replace all instances of ``{% include_validation %}`` with:: <script type="text/javascript" src="PATH_TO_FILE_HERE"></script>
where ``PATH_TO_FILE_HERE`` is the location your media server is serving the file from.
http://pinaxproject.com/docs/dev/_sources/external/ajax-validation/serving-ajax-validation-media-server.txt [12/8/10 1:41:12 AM]
http://pinaxproject.com/docs/dev/_sources/external/flag/index.txt
django-flags============
This app lets users of your site flag content as inappropriate or spam.
(more here soon)
http://pinaxproject.com/docs/dev/_sources/external/flag/index.txt [12/8/10 1:41:16 AM]
http://pinaxproject.com/docs/dev/_sources/external/pagination/index.txt
#################django-pagination#################
Django-pagination is a set of utilities for creating robust pagination tools throughout a django application.
Contents:
.. toctree::
install.txt usage.txt
http://pinaxproject.com/docs/dev/_sources/external/pagination/index.txt [12/8/10 1:41:19 AM]
http://pinaxproject.com/docs/dev/_sources/external/pagination/install.txt
Installing the latest development version of django-pagination---------------------------------------------------------------
To install, first check out the latest version of the application fromsubversion:
svn co http://django-pagination.googlecode.com/svn/trunk django-pagination
Now, link the inner ``pagination`` project to your Python path:
sudo ln -s `pwd`/pagination SITE_PACKAGES_DIR/pagination
If you don't know the location of your site packages directory, this hack mightdo the trick for you:
sudo ln -s `pwd`/pagination `python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"`/pagination Now it's installed! Please see usage.txt for information on how to use thisapplication in your projects.
Installing via setup.py-----------------------
Included with this application is a file named ``setup.py``. It's possible touse this file to install this application to your system, by invoking thefollowing command:
sudo python setup.py install
Once that's done, you should be able to begin using django-pagination at will.
Installing via setuptools-------------------------
If you have setuptools_ installed, you can simply run the following commandto install django-pagination:
sudo easy_install django-pagination
.. _setuptools: http://peak.telecommunity.com/DevCenter/setuptools
http://pinaxproject.com/docs/dev/_sources/external/pagination/install.txt [12/8/10 1:41:22 AM]
http://pinaxproject.com/docs/dev/_sources/external/pagination/usage.txt
How to use django-pagination----------------------------
``django-pagination`` allows for easy Digg-style pagination without modifyingyour views.
There are really 5 steps to setting it up with your projects (not including installation, which is covered in INSTALL.txt in this same directory.)
1. List this application in the ``INSTALLED_APPS`` portion of your settings file. Your settings file might look something like:: INSTALLED_APPS = ( # ... 'pagination', )
2. Install the pagination middleware. Your settings file might look something like:: MIDDLEWARE_CLASSES = ( # ... 'pagination.middleware.PaginationMiddleware', )
3. If it's not already added in your setup, add the request context processor. Note that context processors are set by default implicitly, so to set them explicitly, you need to copy and paste this code into your under the value TEMPLATE_CONTEXT_PROCESSORS:: ("django.core.context_processors.auth", "django.core.context_processors.debug", "django.core.context_processors.i18n", "django.core.context_processors.media", "django.core.context_processors.request")
4. Add this line at the top of your template to load the pagination tags:
{% load pagination_tags %}
http://pinaxproject.com/docs/dev/_sources/external/pagination/usage.txt (1 of 3) [12/8/10 1:41:25 AM]
http://pinaxproject.com/docs/dev/_sources/external/pagination/usage.txt
5. Decide on a variable that you would like to paginate, and use the autopaginate tag on that variable before iterating over it. This could take one of two forms (using the canonical ``object_list`` as an example variable): {% autopaginate object_list %} This assumes that you would like to have the default 20 results per page. If you would like to specify your own amount of results per page, you can specify that like so: {% autopaginate object_list 10 %} Note that this replaces ``object_list`` with the list for the current page, so you can iterate over the ``object_list`` like you normally would.
6. Now you want to display the current page and the available pages, so somewhere after having used autopaginate, use the paginate inclusion tag: {% paginate %} This does not take any arguments, but does assume that you have already called autopaginate, so make sure to do so first.
That's it! You have now paginated ``object_list`` and given users of the sitea way to navigate between the different pages--all without touching your views.
A Note About Uploads--------------------
It is important, when using django-pagination in conjunction with file uploads,to be aware of when ``request.page`` is accessed. As soon as ``request.page``is accessed, ``request.upload_handlers`` is frozen and cannot be altered in anyway. It's a good idea to access the ``page`` attribute on the request object as late as possible in your views.
Optional Settings------------------
http://pinaxproject.com/docs/dev/_sources/external/pagination/usage.txt (2 of 3) [12/8/10 1:41:25 AM]
http://pinaxproject.com/docs/dev/_sources/external/pagination/usage.txt
In django-pagination, there are no required settings. There are, however, asmall set of optional settings useful for changing the default behavior of thepagination tags. Here's an overview:
``PAGINATION_DEFAULT_PAGINATION`` The default amount of items to show on a page if no number is specified.
``PAGINATION_DEFAULT_WINDOW`` The number of items to the left and to the right of the current page to display (accounting for ellipses).
``PAGINATION_DEFAULT_ORPHANS`` The number of orphans allowed. According to the Django documentation, orphans are defined as:: The minimum number of items allowed on the last page, defaults to zero.
``PAGINATION_INVALID_PAGE_RAISES_404`` Determines whether an invalid page raises an ``Http404`` or just sets the ``invalid_page`` context variable. ``True`` does the former and ``False`` does the latter.
http://pinaxproject.com/docs/dev/_sources/external/pagination/usage.txt (3 of 3) [12/8/10 1:41:25 AM]
http://pinaxproject.com/docs/dev/_sources/external/oembed/index.txt
#############django-oembed#############
Django-oembed is a collection of Django tools which make it easy to change text filled with oembed links into the embedded objects themselves.
Contents:
.. toctree::
readme.txt installation.txt usage.txt
http://pinaxproject.com/docs/dev/_sources/external/oembed/index.txt [12/8/10 1:41:28 AM]
http://pinaxproject.com/docs/dev/_sources/external/oembed/readme.txt
=======================django-oembed=======================
This is a collection of tools for Django to allow for replacing links in textwith OEmbed. This application also provides utilities to make this process notprohibitively expensive CPU-wise.
For installation instructions, read INSTALL.txt.
Visit the google code page at http://django-oembed.googlecode.com/
http://pinaxproject.com/docs/dev/_sources/external/oembed/readme.txt [12/8/10 1:41:31 AM]
http://pinaxproject.com/docs/dev/_sources/external/oembed/installation.txt
Installing django-oembed========================
Thanks for downloading django-oembed!
To install it, first use subversion to check out the source code::
svn checkout http://django-oembed.googlecode.com/svn/trunk/ django-oembed
Now, link the included ``oembed`` directory to your pythonpath. On Debian variants, it would look something like this::
sudo ln -s `pwd`/django-oembed/oembed /usr/lib/python2.5/site-packages/
To use it with a Django installation, first place 'oembed' in the INSTALLED_APPStuple of your settings.py file like so:: INSTALLED_APPS = ( # ... 'oembed', )
Then syncdb, and here is sample usage in a template::
{% load oembed_tags %} {% oembed %} {% for link in links %}{{ link.href }}{% endfor %} {% endoembed %} In the previous example, any link.href would be replaced with an OEmbed-fetchedembed.
The templatetag takes one optional second argument, which you can figure out bylooking at this usage:: {% oembed 320x240 %}
Note that this application requires Python 2.3 or later, and Django later than0.96. You can obtain Python from http://www.python.org/ and Django from http://www.djangoproject.com/.
http://pinaxproject.com/docs/dev/_sources/external/oembed/installation.txt [12/8/10 1:41:34 AM]
http://pinaxproject.com/docs/dev/_sources/external/oembed/usage.txt
Usage=====
First you must add it to your INSTALLED_APPS::
INSTALLED_APPS = ( .... 'oembed', )
Then in your template, include the oembed tags::
{% load oembed_tags %}
Then, surround something with the oembed tag. It will search for oembed-able links and replace them with the proper embed::
{% oembed %} There is this great video at http://www.viddler.com/explore/SYSTM/videos/49/ {% endoembed %}
Will result in::
There is this great video at <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="320" height="222" id="viddlerplayer-e5cb3aac"><param name="movie" value="http://www.viddler.com/player/e5cb3aac/" /><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="true" /><embed src="http://www.viddler.com/player/e5cb3aac/" width="320" height="222" type="application/x-shockwave-flash" allowScriptAccess="always" allowFullScreen="true" name="viddlerplayer-e5cb3aac" ></embed></object>
There is an optional width and height parameter, that can be invoked thusly::
{% oembed 320x240 %}...{% endoembed %}
http://pinaxproject.com/docs/dev/_sources/external/oembed/usage.txt [12/8/10 1:41:37 AM]
http://pinaxproject.com/docs/dev/_sources/external/notification/index.txt
===================django-notification===================
Many sites need to notify users when certain events have occurred and to allowconfigurable options as to how those notifications are to be received.
The project aims to provide a Django app for this sort of functionality. Thisincludes:
* Submission of notification messages by other apps. * Notification messages on signing in. * Notification messages via email (configurable by user). * Notification messages via feed.
Contents:
.. toctree::
usage
http://pinaxproject.com/docs/dev/_sources/external/notification/index.txt [12/8/10 1:41:41 AM]
http://pinaxproject.com/docs/dev/_sources/external/notification/usage.txt
=====Usage=====
Integrating notification support into your app is a simple three-step process.
* create your notice types * create your notice templates * send notifications
Creating Notice Types=====================
You need to call ``create_notice_type(label, display, description)`` once tocreate the notice types for your application in the database. ``label`` is justthe internal shortname that will be used for the type, ``display`` is what theuser will see as the name of the notification type and `description` is ashort description.
For example::
notification.create_notice_type("friends_invite", "Invitation Received", "you have received an invitation")
One good way to automatically do this notice type creation is in a``management.py`` file for your app, attached to the syncdb signal.Here is an example::
from django.conf import settings from django.utils.translation import ugettext_noop as _
if "notification" in settings.INSTALLED_APPS: from notification import models as notification
def create_notice_types(app, created_models, verbosity, **kwargs): notification.create_notice_type("friends_invite", _("Invitation Received"), _("you have received an invitation")) notification.create_notice_type("friends_accept", _("Acceptance Received"), _("an invitation you sent has been accepted"))
signals.post_syncdb.connect(create_notice_types, sender=notification) else: print "Skipping creation of NoticeTypes as notification app not found"
Notice that the code is wrapped in a conditional clause so ifdjango-notification is not installed, your app will proceed anyway.
Note that the display and description arguments are marked for translation byusing ugettext_noop. That will enable you to use Django's makemessagesmanagement command and use django-notification's i18n capabilities.
Notification templates======================
There are four different templates that can to be written for the actual content of the notices:
* ``short.txt`` is a very short, text-only version of the notice (suitable for things like email subjects) * ``full.txt`` is a longer, text-only version of the notice (suitable for things like email bodies) * ``notice.html`` is a short, html version of the notice, displayed in a user's notice list on the website * ``full.html`` is a long, html version of the notice (not currently used for anything)
Each of these should be put in a directory on the template path called ``notification/<notice_type_label>/<template_name>``.If any of these are missing, a default would be used. In practice, ``notice.html`` and ``full.txt`` should be provided at a minimum.
http://pinaxproject.com/docs/dev/_sources/external/notification/usage.txt (1 of 3) [12/8/10 1:41:45 AM]
http://pinaxproject.com/docs/dev/_sources/external/notification/usage.txt
For example, ``notification/friends_invite/notice.html`` might contain:: {% load i18n %}{% url invitations as invitation_page %}{% url profile_detail username=invitation.from_user.username as user_url %} {% blocktrans with invitation.from_user as invitation_from_user %}<a href="{{ user_url }}">{{ invitation_from_user }}</a> has requested to add you as a friend (see <a href="{{ invitation_page }}">invitations</a>){% endblocktrans %}
and ``notification/friends_full.txt`` might contain:: {% load i18n %}{% url invitations as invitation_page %}{% blocktrans with invitation.from_user as invitation_from_user %}{{ invitation_from_user }} has requested to add you as a friend. You can accept their invitation at: http://{{ current_site }}{{ invitation_page }} {% endblocktrans %}
The context variables are provided when sending the notification.
Sending Notification====================
There are two different ways of sending out notifications. We have supportfor blocking and non-blocking methods of sending notifications. The mostsimple way to send out a notification, for example::
notification.send([to_user], "friends_invite", {"from_user": from_user})
One thing to note is that ``send`` is a proxy around either ``send_now`` or``queue``. They all have the same signature::
send(users, label, extra_context, on_site)
The parameters are:
* ``users`` is an iterable of ``User`` objects to send the notification to. * ``label`` is the label you used in the previous step to identify the notice type. * ``extra_content`` is a dictionary to add custom context entries to the template used to render to notification. This is optional. * ``on_site`` is a boolean flag to determine whether an ``Notice`` object is created in the database.
``send_now`` vs. ``queue`` vs. ``send``---------------------------------------
Lets first break down what each does.
``send_now``~~~~~~~~~~~~
This is a blocking call that will check each user for elgibility of thenotice and actually peform the send.
``queue``~~~~~~~~~
This is a non-blocking call that will queue the call to ``send_now`` tobe executed at a later time. To later execute the call you need to usethe ``emit_notices`` management command.
``send``~~~~~~~~
http://pinaxproject.com/docs/dev/_sources/external/notification/usage.txt (2 of 3) [12/8/10 1:41:45 AM]
http://pinaxproject.com/docs/dev/_sources/external/notification/usage.txt
A proxy around ``send_now`` and ``queue``. It gets its behavior from a globalsetting named ``NOTIFICATION_QUEUE_ALL``. By default it is ``False``. Thissetting is meant to help control whether you want to queue any call to``send``.
``send`` also accepts ``now`` and ``queue`` keyword arguments. By defaulteach option is set to ``False`` to honor the global setting which is ``False``.This enables you to override on a per call basis whether it should call``send_now`` or ``queue``.
Optional notification support-----------------------------
In case you want to use django-notification in your reusable app, you canwrap the import of django-notification in a conditional clause that testsif it's installed before sending a notice. As a result your app orproject still functions without notification.
For example::
from django.conf import settings
if "notification" in settings.INSTALLED_APPS: from notification import models as notification else: notification = None
and then, later::
if notification: notification.send([to_user], "friends_invite", {"from_user": from_user})
http://pinaxproject.com/docs/dev/_sources/external/notification/usage.txt (3 of 3) [12/8/10 1:41:45 AM]
http://pinaxproject.com/docs/dev/_sources/external/mailer/index.txt
=============django-mailer=============
Contents:
.. toctree::
usage
http://pinaxproject.com/docs/dev/_sources/external/mailer/index.txt [12/8/10 1:41:48 AM]
http://pinaxproject.com/docs/dev/_sources/external/mailer/usage.txt
=====Usage=====
django-mailer is asynchronous so in addition to putting mail on the queue youneed to periodically tell it to clear the queue and actually send the mail.
The latter is done via a command extension.
Putting Mail On The Queue=========================
Because django-mailer currently uses the same function signature as Django'score mail support you can do the following in your code::
# favour django-mailer but fall back to django.core.mail from django.conf import settings
if "mailer" in settings.INSTALLED_APPS: from mailer import send_mail else: from django.core.mail import send_mail
and then just call send_mail like you normally would in Django::
send_mail(subject, message_body, settings.DEFAULT_FROM_EMAIL, recipients)
Additionally you can send all the admins as specified in the ``ADMIN``setting by calling::
mail_admins(subject, message_body)
or all managers as defined in the ``MANAGERS`` setting by calling::
mail_managers(subject, message_body)
Clear Queue With Command Extensions===================================
With mailer in your INSTALLED_APPS, there will be two new manage.py commandsyou can run:
* ``send_mail`` will clear the current message queue. If there are any failures, they will be marked deferred and will not be attempted again by ``send_mail``.
* ``retry_deferred`` will move any deferred mail back into the normal queue (so it will be attempted again on the next ``send_mail``).
You may want to set these up via cron to run regularly::
http://pinaxproject.com/docs/dev/_sources/external/mailer/usage.txt (1 of 2) [12/8/10 1:41:51 AM]
http://pinaxproject.com/docs/dev/_sources/external/mailer/usage.txt
* * * * * (cd $PINAX; /usr/local/bin/python2.5 manage.py send_mail >> $PINAX/cron_mail.log 2>&1) 0,20,40 * * * * (cd $PINAX; /usr/local/bin/python2.5 manage.py retry_deferred >> $PINAX/cron_mail_deferred.log 2>&1)
This attempts to send mail every minute with a retry on failure every 20 minutes.
``manage.py send_mail`` uses a lock file in case clearing the queue takeslonger than the interval between calling ``manage.py send_mail``.
Note that if your project lives inside a virtualenv, you also have to executethis command from the virtualenv. The same, naturally, applies also if you'reexecuting it with cron. The `Pinax documentation`_ explains that in moredetails.
.. _pinax documentation: http://pinaxproject.com/docs/dev/deployment.html#sending-mail-and-notices
http://pinaxproject.com/docs/dev/_sources/external/mailer/usage.txt (2 of 2) [12/8/10 1:41:51 AM]
http://pinaxproject.com/docs/dev/_sources/external/dbtemplates/index.txt
==================django-dbtemplates==================
``dbtemplates`` is a Django app that comes with to parts: It allows you tocreate templates that are saved in your database, and it provides a so called`template loader`_, a function that enables Django to find the templates youcreated in the database.
.. _template loader: http://docs.djangoproject.com/en/dev/ref/templates/api/#loading-templates
Contents:
.. toctree::
overview.txt
http://pinaxproject.com/docs/dev/_sources/external/dbtemplates/index.txt [12/8/10 1:41:54 AM]
{{ flatpage.title }}
=================================== Database template loader for Django =================================== ``dbtemplates`` is a Django app that comes with to parts: It allows you to create templates that are saved in your database, and it provides a so called `template loader`_, a function that enables Django to find the templates you created in the database. It also includes a extensible caching mechanism and supports version control of the templates saved in the database. .. _template loader: http://docs.djangoproject.com/en/dev/ref/templates/api/#loading-templates .. contents:: Table of Contents :backlinks: none Setup ===== 1. Get the source from the `Mercurial repository`_ or install it from the Python Package Index by running ``easy_install django-dbtemplates`` or ``pip django-dbtemplates``. 2. Follow the instructions in the INSTALL file 3. Edit the settings.py of your Django site: * Add ``dbtemplates`` to the ``INSTALLED_APPS`` setting Check if ``django.contrib.sites`` and ``django.contrib.admin`` are in ``INSTALLED_APPS`` and add if necessary. It should look something like this:: INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.admin', 'django.contrib.flatpages', # .. 'dbtemplates', ) * Add ``dbtemplates.loader.load_template_source`` to the ``TEMPLATE_LOADERS`` list in the settings.py of your Django project It should look something like this:: TEMPLATE_LOADERS = ( 'django.template.loaders.filesystem.load_template_source', 'django.template.loaders.app_directories.load_template_source', 'dbtemplates.loader.load_template_source', ) 4. Sync your database ``python manage.py syncdb`` 5. Restart your Django server .. _Mercurial repository: http://bitbucket.org/jezdez/django-dbtemplates/ Usage ===== Creating database templates is pretty simple: Just open the admin interface of your Django-based site in your browser and click on "Templates" in the "Dbtemplates" section. There you only need to fill in the ``name`` field with the identifier, Django is supposed to use while searching for templates, e.g. ``blog/entry_list.html``. The ``content`` field should be filled with the content of your template. Optionally, by leaving the ``content`` field empty you are able to tell ``dbtemplates`` to look for a template with the ``name`` by using Django's other template loaders. For example, if you have a template called ``blog/entry_list.html`` on your file system and want to save the templates contents in the database, you just need to leave the content field empty to automatically populate it. That's especially useful if you don't want to copy and paste its content manually to the textarea. Example ======= ``dbtemplates`` comes with an example Django project that let's you try it out. The example uses Django's own `flatpages app`_ to enable you to create a simple page using ``dbtemplates``. Flat pages are a perfect fit to dbtemplates since they come prepackaged and are simple to use. Here is how it works: 1. Open your command line and change to the ``example`` directory in the directory with the extracted source distribution. 2. Run ``python manage.py syncdb`` and follow the instructions. 3. Run ``python manage.py runserver`` and open your favorite browser with the address http://127.0.0.1:8000/admin/. 4. Next add a new `Template` object in the ``dbtemplates`` section and use ``flatpages/default.html`` as the value for the ``name`` field. For the ``content`` field use this example:: {{ flatpage.content }} 5. Return to the home screen of the admin interface and add a new flat page. Use ``/`` (yep, just a forward slash) and whatever ``title`` and ``content`` you prefer. Please make sure you select the default site ``example.com`` before you save the flat page. 6. Visit http://127.0.0.1:8000/ and see the flat page you just created rendered with the ``flatpages/default.html`` template provided by ``dbtemplates``. .. _flatpages app: http://docs.djangoproject.com/en/dev/ref/contrib/flatpages/ Caching ======= Using the default caching ------------------------- Dbtemplates comes with different backends for caching that are automatically created, updated and deleted when templates are saved in the database by using Django's signal
http://pinaxproject.com/docs/dev/_sources/external/dbtemplates/overview.txt (1 of 2) [12/8/10 1:41:59 AM]
{{ flatpage.title }}
framework. To enable one of them you need to specify a setting called ``DBTEMPLATES_CACHE_BACKEND`` to one of the following values: * ``dbtemplates.cache.FileSystemBackend`` -- File system caching The ``FileSystemBackend`` is a simple way to store the templates you have in the database on the filesystem. That's especially useful if you don't use a full caching framework like Django is providing. To use this backend you need additionally create a setting ``DBTEMPLATES_CACHE_DIR`` that contains the full file system path to the directory where ``dbtemplates`` should create the cache files in. * ``dbtemplates.cache.DjangoCacheBackend`` -- Django cache The ``DjangoCacheBackend`` is a thin wrapper around Django's caching framework that enables you to use advanced caching solutions like memcached or database caching. Please see the `cache documentation`_ if you want to know more about it. .. _cache documentation: http://docs.djangoproject.com/en/dev/topics/cache/#setting-up-the-cache Writing your own caching backends --------------------------------- Writing your own cache backends is perfectly easy since ``dbtemplates`` includes a easy-to-use base class in ``dbtemplates.cache.BaseCacheBackend``. Just subclass that base backend somewhere in your own code and provide the follwing three reuqired methods: * ``load`` Loads a template from the cache with the given name and returns its contents. Return None if nothing found. Arguments: * ``name`` - name of the template * ``save`` Saves the passed template contents with the passed name in the cache. Arguments: * ``name`` - name of the template * ``content`` - contents of the template * ``remove`` Removes the template with the passed name from the cache. Arguments: * ``name`` - name of the template Please see also the `source of the default backends`_ to see how it works. .. _source of the default backends: http://bitbucket.org/jezdez/django-dbtemplates/src/tip/dbtemplates/cache.py Versionizing your templates =========================== ``dbtemplates`` comes prepared to use the third party Django app `django-reversion`_, that once installed besides ``dbtemplates`` allows you to jump back to old versions of your templates. It automatically saves every state when you save the template in your database and provides an easy to use interface. Please refer to `django-reversion's documentation`_ for more information about how it works. ``dbtemplates`` automatically recognizes if ``django-reversion`` is installed and works out of the box. Just visit the "History" section of each template instance and browse its history. Short installation howto ------------------------ 1. Get the source from the `django-reversion`_ project site and put it somewhere on your `PYTHONPATH`. 2. Add ``reversion`` to the ``INSTALLED_APPS`` setting of your Django project 3. Sync your database with ``python manage.py syncdb`` .. _django-reversion: http://code.google.com/p/django-reversion/ .. _django-reversion's documentation: http://code.google.com/p/django-reversion/wiki/GettingStarted Management commands =================== ``dbtemplates`` comes with two `Django management commands`_ to be used with ``django-admin.py`` or ``manage.py``: * ``sync_templates`` Enables you to sync your already existing file systems templates with the database. It will guide you through the whole process. * ``create_error_templates`` Tries to add the two templates ``404.html`` and ``500.html`` that are used by Django when a error occurs. .. _Django management commands: http://docs.djangoproject.com/en/dev/ref/django-admin/ Support ======= Please leave your questions and messages on the designated site: http://bitbucket.org/jezdez/django-dbtemplates/issues/
http://pinaxproject.com/docs/dev/_sources/external/dbtemplates/overview.txt (2 of 2) [12/8/10 1:41:59 AM]
http://pinaxproject.com/docs/dev/_sources/external/robots/index.txt
=============django-robots=============
This is a basic Django application to manage robots.txt files following the`robots exclusion protocol`_, complementing the Django_ `Sitemap contrib app`_.
.. _robots exclusion protocol: http://www.robotstxt.org/robotstxt.html
.. _Django: http://www.djangoproject.com/
.. _Sitemap contrib app: http://docs.djangoproject.com/en/dev/ref/contrib/sitemaps/
Contents:
.. toctree::
overview.txt
http://pinaxproject.com/docs/dev/_sources/external/robots/index.txt [12/8/10 1:42:02 AM]
http://pinaxproject.com/docs/dev/_sources/external/robots/overview.txt
=======================================Robots exclusion application for Django=======================================
This is a basic Django application to manage robots.txt files following the`robots exclusion protocol`_, complementing the Django_ `Sitemap contrib app`_.
The robots exclusion application consists of two database models which aretied together with a m2m relationship:
* Rules_* URLs_
.. _Django: http://www.djangoproject.com/
Installation============
Get the source from the application site at::
http://bitbucket.org/jezdez/django-robots/
To install the sitemap app, follow these steps:
1. Follow the instructions in the INSTALL.txt file2. Add ``'robots'`` to your INSTALLED_APPS_ setting.3. Make sure ``'django.template.loaders.app_directories.load_template_source'`` is in your TEMPLATE_LOADERS_ setting. It's in there by default, so you'll only need to change this if you've changed that setting.4. Make sure you've installed the `sites framework`_.
.. _INSTALLED_APPS: http://docs.djangoproject.com/en/dev/ref/settings/#installed-apps
.. _TEMPLATE_LOADERS: http://docs.djangoproject.com/en/dev/ref/settings/#template-loaders
.. _sites framework: http://docs.djangoproject.com/en/dev/ref/contrib/sites/
Sitemaps--------
By default a ``Sitemap`` statement is automatically added to the resulting robots.txt by reverse matching the URL of the installed `Sitemap contrib app`_.This is especially useful if you allow every robot to access your whole site,since it then gets URLs explicitly instead of searching every link.
http://pinaxproject.com/docs/dev/_sources/external/robots/overview.txt (1 of 4) [12/8/10 1:42:06 AM]
http://pinaxproject.com/docs/dev/_sources/external/robots/overview.txt
To change the default behaviour to omit the inclusion of a sitemap link,change the ``ROBOTS_USE_SITEMAP`` setting in your Django settings file to::
ROBOTS_USE_SITEMAP = False
In case you want to use a specific sitemap URL instead of the one that isautomatically discovered, change the ``ROBOTS_SITEMAP_URL`` setting to::
ROBOTS_SITEMAP_URL = http://www.example.com/sitemap.xml
.. _Sitemap contrib app: http://docs.djangoproject.com/en/dev/ref/contrib/sitemaps/
Initialization==============
To activate robots.txt generation on your Django site, add this line to yourURLconf_::
(r'^robots.txt$', include('robots.urls')),
This tells Django to build a robots.txt when a robot accesses ``/robots.txt``.Then, please sync your database to create the necessary tables and create``Rule`` objects in the admin interface or via the shell.
.. _URLconf: http://docs.djangoproject.com/en/dev/topics/http/urls/
.. _sync your database: http://docs.djangoproject.com/en/dev/ref/django-admin/#syncdb
Rules=====
``Rule`` - defines an abstract rule which is used to respond to crawling webrobots, using the `robots exclusion protocol`_, a.k.a. robots.txt.
You can link multiple URL pattern to allows or disallows the robot identifiedby its user agent to access the given URLs.
The crawl delay field is supported by some search engines and defines thedelay between successive crawler accesses in seconds. If the crawler rate is aproblem for your server, you can set the delay up to 5 or 10 or a comfortablevalue for your server, but it's suggested to start with small values (0.5-1),and increase as needed to an acceptable value for your server. Larger delayvalues add more delay between successive crawl accesses and decrease the
http://pinaxproject.com/docs/dev/_sources/external/robots/overview.txt (2 of 4) [12/8/10 1:42:06 AM]
http://pinaxproject.com/docs/dev/_sources/external/robots/overview.txt
maximum crawl rate to your web server.
The `sites framework`_ is used to enable multiple robots.txt per Django instance.If no rule exists it automatically allows every web robot access to every URL.
Please have a look at the `database of web robots`_ for a full list ofexisting web robots user agent strings.
.. _robots exclusion protocol: http://www.robotstxt.org/robotstxt.html
.. _'sites' framework: http://www.djangoproject.com/documentation/sites/
.. _database of web robots: http://www.robotstxt.org/db.html
URLs====
``Url`` - defines a case-sensitive and exact URL pattern which is used toallow or disallow the access for web robots. Case-sensitive.
A missing trailing slash does also match files which start with the name ofthe given pattern, e.g., ``'/admin'`` matches ``/admin.html`` too.
Some major search engines allow an asterisk (``*``) as a wildcard to match anysequence of characters and a dollar sign (``$``) to match the end of the URL,e.g., ``'/*.jpg$'`` can be used to match all jpeg files.
Caching=======
You can optionally cache the generation of the ``robots.txt``. Add or changethe ``ROBOTS_CACHE_TIMEOUT`` setting with a value in seconds in your Djangosettings file::
ROBOTS_CACHE_TIMEOUT = 60*60*24
This tells Django to cache the ``robots.txt`` for 24 hours (86400 seconds).The default value is ``None`` (no caching).
Support=======
Please leave your `questions and problems`_ on the `designated Bitbucket site`_.
.. _designated Bitbucket site: http://bitbucket.org/jezdez/django-robots/
http://pinaxproject.com/docs/dev/_sources/external/robots/overview.txt (3 of 4) [12/8/10 1:42:06 AM]
http://pinaxproject.com/docs/dev/_sources/external/robots/overview.txt
.. _questions and problems: http://bitbucket.org/jezdez/django-robots/issues/
http://pinaxproject.com/docs/dev/_sources/external/robots/overview.txt (4 of 4) [12/8/10 1:42:06 AM]
http://pinaxproject.com/docs/dev/_sources/external/announcements/index.txt
====================django-announcements====================
Some sites need the ability to broadcast an announcement to all of theirusers. django-announcements was created precisely for this reason. How youpresent the announcement is up to you as the site-developer. When working withannouncements that are presented on the website one feature is that they areonly viewed once. A session variable will hold which announcements an user hasviewed and exclude that from their display. announcements supports twodifferent types of filtering of announcements:
* site-wide (this can be presented to anonymous users) * non site-wide (these can be used a strictly a mailing if so desired) * members only (announcements are filtered based on the value of ``request.user``)
Contents:
.. toctree::
usage
http://pinaxproject.com/docs/dev/_sources/external/announcements/index.txt [12/8/10 1:42:10 AM]
http://pinaxproject.com/docs/dev/_sources/external/announcements/usage.txt
=====Usage=====
Basic usage===========
Integrating announcements is very simple. announcements provides to you acontext processor to get template global access::
TEMPLATE_CONTEXT_PROCESSORS = ( # ... "announcements.context_processors.site_wide_announcements", # ... )
Once that is hooked up you now have access ``{{ site_wide_announcements }}``which is a simple queryset that has filtered the announcements to give youjust the right ones. If the user viewing the page is authenticated it willadditionally pull out announcements that have been marked ``for_members``.
Here is a quick snippet of how this can be used in a template. Typically ina base template like ``base.html`` or some sort::
{% if site_wide_announcements %} <div id="site_wide_announcements"> <ul> {% for announcement in site_wide_announcements %} <li> <a href="{{ announcement.get_absolute_url }}">{{ announcement }}</a> - <a href="{% url announcement_hide announcement.pk %}?next={{ request.path }}">Hide announcement</a> </li> {% endfor %} </ul> </div> {% endif %} The above template sample uses the views discussed a little bit later on.
To give a bit of internals, the ``site_wide_announcements`` context processoris simply a wrapper around ``current_announcements_for_request`` which islocated in ``announcements.models``.
Announcement model------------------
To store announcements in the database, announcements comes with a model thatdeals with this. It contains these fields:
http://pinaxproject.com/docs/dev/_sources/external/announcements/usage.txt (1 of 3) [12/8/10 1:42:14 AM]
http://pinaxproject.com/docs/dev/_sources/external/announcements/usage.txt
* ``title`` - The title of the announcement. This is limited to 50 characters. The title is completely optional since some types of annoucements don't really need one. * ``content`` - The main content of the announcement. * ``creator`` - The user who created the announcement. * ``creation_date`` - A ``DateTimeField`` indicating when the announcement was created. * ``site_wide`` - A boolean value indicating whether the announcment should be site-wide and used in the context processor. * ``members_only`` - This will tag an announcemnt as for member eyes only.
Additional uses===============
There are a couple of ways that announcements can be used outside of its basicusage described above.
E-mailing users---------------
When you are creating a new announcement via the admin interface you are giventhe option to send now. What this means is that announcements has optionalsupport of django-notification. If it is available it can send a notificationof the announcement. This then in turn can be e-mail to the user.
.. note::
Due to the possibility of large user bases, even 20+, can cause the sending of a notification to take a bit of time. This could in turn cause the request to time out. To avoid that announcements uses the queuing feature of notifications. To send out the notifications you will need to use the ``emit_notices`` management command notifications provides.
URLconf, views and templates----------------------------
announcements comes with three pre-defined URLs. They enable you the abilityto list, view and hide announcements. You can hook up these views verysimply in your ``urls.py``:: # example urls.py. from django.conf.urls.defaults import * urlpatterns = patterns("", # ... url(r"^announcements/", include("announcements.urls")), # ... )
``announcement_home``
http://pinaxproject.com/docs/dev/_sources/external/announcements/usage.txt (2 of 3) [12/8/10 1:42:14 AM]
http://pinaxproject.com/docs/dev/_sources/external/announcements/usage.txt
~~~~~~~~~~~~~~~~~~~~~
View: ``announcements.views.announcement_list``
It uses ``current_announcements_for_request`` to get a queryset ofannouncements appropriate to the ``HttpRequest``.
``announcement_detail``~~~~~~~~~~~~~~~~~~~~~~~
View: ``django.views.generic.list_detail.object_detail``
Displays a single announcement. Reference the Django object_detail_documentation for more information.
.. _object_detail: http://docs.djangoproject.com/en/dev/ref/generic-views/#django-views-generic-list-detail-object-detail
``announcement_hide``~~~~~~~~~~~~~~~~~~~~~
View: ``announcements.views.announcement_hide``
This view will mark a given announcement as hidden and redirect the userto the provide ``next`` ``GET`` argument.
http://pinaxproject.com/docs/dev/_sources/external/announcements/usage.txt (3 of 3) [12/8/10 1:42:14 AM]
http://pinaxproject.com/docs/dev/_sources/external/messages/index.txt
===============django-messages===============
``messages`` is a Django app which provides a user-to-user messaging system.Django-messages enables your users to send private messages to each other. Itprovides a basic set of functionality you would expect from such a system. Every user has an inbox, an Outbox and a Trash. Messages can be composed andthere is an easy url-based approach to preloading the compose-form with therecipient user, which makes it extremly easy to put "send xyz a message" linkson profile pages.
Currently django-messages comes with these translations:
* de* fr* es_AR* pl* es* pt_BR* ru_RU* nl
.. toctree::
install usage customizing
http://pinaxproject.com/docs/dev/_sources/external/messages/index.txt [12/8/10 1:42:17 AM]
http://pinaxproject.com/docs/dev/_sources/external/messages/install.txt
.. _ref-messages-install:
==========================Installing django-messages==========================
Basically all you have to do is get the ``messages`` folder somewhere on the Python path. There are multiple ways to achive this.
Quickstart----------
If you already downloaded the package change into the ``django-messages`` directory and run::
python setup.py install
Otherwise you will find more information in the remainder of this document. Django-messages is available via PyPi, so the following command will downloadand install django-messages on your system in one step::
easy_install django-messages If you prefer using pip, you may achieve the same result by running::
pip install django-messages
Download---------
You will always find and download the latest packaged version at: http://code.google.com/p/django-messages/downloads/list
If you prefer to use the current developement version to get earlier access tonew features you can checkout the code from the SVN repository::
svn checkout http://django-messages.googlecode.com/svn/trunk/ django-messages
Install
http://pinaxproject.com/docs/dev/_sources/external/messages/install.txt (1 of 3) [12/8/10 1:42:20 AM]
http://pinaxproject.com/docs/dev/_sources/external/messages/install.txt
-------
If you downloaded the tar-ball extract it with (change the version number ifrequired)::
tar -xcvf django-messages-0.4.tar.gz
After extracting the tar-ball or checking out the code from the repository, change into the ``django-messages`` directory and install the code::
cd django-messages python setup.py install
Manual Install--------------
Instead of using ``setup.py install`` it is also possible to copy or symlinkthe ``messages`` folder inside the toplevel ``django-messages`` folder to your Python path. This will be enough to make djano-messages available to yoursystem.
Dependencies------------
Django-messages has no external dependencies except for Django. Starting withversion 0.3 Django 1.0 or later is required. If you have to use Django 0.96.xyou might still use version 0.2 (unsupported).
Django-messages has some features which may use an external app if it is present in the current Django project. Please note, that these apps have tobe listed in ``INSTALLED_APPS`` to be used by django-messages.
* If you use `django-notification`_ django-messages will use it for sending notifications to users about new messages instead of using the built-in mechanism * If `django-mailer`_ is used the built-in messages sending code will use it instead of the django built-in ``send_mail`` function.
Please note that we try to support Python 2.4, but as we develop django-messageson Python 2.5 sometimes code might slip in which breaks Python 2.4 compatibility.
http://pinaxproject.com/docs/dev/_sources/external/messages/install.txt (2 of 3) [12/8/10 1:42:20 AM]
http://pinaxproject.com/docs/dev/_sources/external/messages/install.txt
This can be considered a bug and you can help us by reporting the incompytibility.
.. _`django-notification`: http://code.google.com/p/django-notification/
.. _`django-mailer`: http://code.google.com/p/django-mailer/
http://pinaxproject.com/docs/dev/_sources/external/messages/install.txt (3 of 3) [12/8/10 1:42:20 AM]
http://pinaxproject.com/docs/dev/_sources/external/messages/usage.txt
=====================Using django-messages=====================
To enable django-messages in your Django project make sure it is :ref:`installed <ref-messages-install>`. You can check if django-messages was successfully installed by opening a python shell and running::
>>> import messages >>> If no error occured, you can assumed that the app was installed correctly.
Edit settings-------------
The next step is to add ``messages`` to the ``INSTALLED_APPS`` setting::
INSTALLED_APPS = ( ... 'messages', ... )
Add urls--------
To make django-messages available to your users you should include the bunlded url-conf in your root url-conf. One example would be to edityour main ``urls.py`` and add a line like this::
urlpatterns = patterns('' ... (r'^messages/', include('messages.urls')), ... ) Templates---------
http://pinaxproject.com/docs/dev/_sources/external/messages/usage.txt (1 of 2) [12/8/10 1:42:23 AM]
http://pinaxproject.com/docs/dev/_sources/external/messages/usage.txt
Django-messages provides some simple default templates which will get youstarted quick. The templates make the assumption that a base template withthe name ``base.html`` exists which defines a block ``content`` and a block ``sidebar``. If this is not the case, or the template don't fit due to otherconcerns, it's very easy to provide to your own templates. Please see the:ref:`customization docs <ref-messages-customization>` fore more details.
http://pinaxproject.com/docs/dev/_sources/external/messages/usage.txt (2 of 2) [12/8/10 1:42:23 AM]
http://pinaxproject.com/docs/dev/_sources/external/messages/customizing.txt
.. _ref-messages-customization:
===========================Customizing django-messages===========================
There are multiple levels at which you can customize django-messages withoutaltering the code directly.
Templates---------
Django-messages comes with a set of built-in templates which you can use. If these templates don't fit your project you can override any or all of themby putting files with the same filenames in one the directories listes in``TEMPLATES_DIRS`` in your ``settings.py``.
Django-messages uses the following templates:
* :file:`messages/base.html` - A base template from which all the following templates inherit. Maybe it's enough to customize this template for your project.* :file:`messages/compose.html` - This template is rendered, when a user composes a new messages.* :file:`messages/inbox.html` - This template lists the users inbox.* :file:`messages/new_messages.html` - This template is used to construct the notification mail sent to a user, whenever a new message is received.* :file:`messages/outbox.html` - This template lists the users outbox aka sent messages.* :file:`messages/trash.html` - This template lists the users trash.* :file:`messages/view.html` - This template renders a single message with all details.
Additionally django-message provides a set of template for django-notification.These template can be found in :file:`messages/templates/notification/` and can also be overwritten in one of your project's ``TEMPLATE_DIRS``.
URL-conf--------
http://pinaxproject.com/docs/dev/_sources/external/messages/customizing.txt (1 of 3) [12/8/10 1:42:26 AM]
http://pinaxproject.com/docs/dev/_sources/external/messages/customizing.txt
If you want to further customize how django-messages works it is possible towrite your own url-conf instead of including ``messages.urls`` in yourroot url-conf. This not only allows changing the url structure but also allowsmodifying the kwargs passed to the views and therefore modifying some behaviour.
Please note: If you provide your own url-conf, or urlpatterns directly embeddedin your root url-conf, you shouldn't include ``messages.urls``.
Three common customizations are described in more detail below.
Modifying template names~~~~~~~~~~~~~~~~~~~~~~~~
If overwriting templates in your project's ``TEMPLATE_DIRS`` does not provideenough freedom, you can change the names of the used templates by providinga `template_name` keyword argument to the views. Every view which renders atemplate accepts this keyword-argument.
If you want to change the template the ``inbox`` view uses to ``my_inbox.html``instead of the default ``messages/inbox.html`` you can use this line in yourown url-conf::
url(r'^inbox/$', inbox, {'template_name': 'my_inbox.html',}, name='messages_inbox'),
Modifying form classes~~~~~~~~~~~~~~~~~~~~~~
If you want to use your own form for composing messages, for example to addnew features, you can simply pass the form-class to the views via kwargs. Every view which renders a form accepts a `form_class` keyword argument to specify the form-class.
If you want to use Your own ``MyComposeForm`` you can pass it to the view byusing a line like the following in your own url-conf::
from somewhere import MyComposeForm ... url(r'^compose/$', compose, {'form_class': MyComposeForm,}, name='messages_compose'),
Modifying success urls
http://pinaxproject.com/docs/dev/_sources/external/messages/customizing.txt (2 of 3) [12/8/10 1:42:26 AM]
http://pinaxproject.com/docs/dev/_sources/external/messages/customizing.txt
~~~~~~~~~~~~~~~~~~~~~~
All views, which will redirect the user after a successfull action accept a`success_url` keyword argument to specify the destination url. The ``delete``and ``undelete`` views will additionally check if a ``next`` parameter isprovided in the querystring appended to the url.
If you don't want to append the next target to the url, or want to changethe redirecting behaviour of other views, you can pass a ``success_url``parameter in your own url-conf, for example like this::
url(r'^delete/(?P<message_id>[\d]+)/$', delete, {'success_url': '/profile/',}, name='messages_delete'),
http://pinaxproject.com/docs/dev/_sources/external/messages/customizing.txt (3 of 3) [12/8/10 1:42:26 AM]
http://pinaxproject.com/docs/dev/_sources/apps/index.txt
.. _ref-pinax.apps-index:
==========Pinax Apps==========
.. toctree:: :maxdepth: 3
account/index analytics/index authsub/index autocomplete_app/index basic_profiles/index bbauth/index blog/index photos/index profiles/index projects/index signup_codes/index tagging_utils/index tasks/index threadedcomments_extras/index topics/index tribes/index voting_extras/index waitinglist/index
http://pinaxproject.com/docs/dev/_sources/apps/index.txt [12/8/10 1:42:30 AM]
http://pinaxproject.com/docs/dev/_sources/apps/account/index.txt
.. _ref-pinax.apps.account-index:
======================``pinax.apps.account``======================
An app to handle account signup, login and management.
The account app is already integrated with most projects. Our default project,zero, does not come with account integrated.
.. toctree:: :maxdepth: 3
gettingstarted reference
http://pinaxproject.com/docs/dev/_sources/apps/account/index.txt [12/8/10 1:42:33 AM]
http://pinaxproject.com/docs/dev/_sources/apps/account/gettingstarted.txt
.. _ref-account-gettingstarted:
===============Getting started===============
This document is designed to get you up and running with``pinax.apps.account``...
Prerequisites=============
These are the requirements to run ``pinax.apps.account``:
* Python **2.4+** (Python 3.x is **not** supported yet) * Django **1.2+** * django-email-confirmation * django-timezones * django-ajax-validation
These dependencies should be added to your ``requirements/project.txt`` fileand installed using pip_. For example::
pip install -r requirements/project.txt
Installation============
Add ``pinax.apps.account`` to your ``INSTALLED_APPS``:
.. code-block:: python
INSTALLED_APPS = [ # ... "pinax.apps.account", ]
Hook up ``pinax.apps.account`` to your URLconf:
.. code-block:: python
http://pinaxproject.com/docs/dev/_sources/apps/account/gettingstarted.txt (1 of 2) [12/8/10 1:42:36 AM]
http://pinaxproject.com/docs/dev/_sources/apps/account/gettingstarted.txt
urlpatterns = patterns("", # ... url(r"^account/", include("pinax.apps.account.urls")) )
.. _pip: http://pip.openplans.org/
http://pinaxproject.com/docs/dev/_sources/apps/account/gettingstarted.txt (2 of 2) [12/8/10 1:42:36 AM]
http://pinaxproject.com/docs/dev/_sources/apps/account/reference.txt
.. _ref-account-reference:
=========Reference=========
This document covers various components of ``pinax.apps.account``.
Settings========
``ACCOUNT_EMAIL_VERIFICATION``------------------------------
**Required**. This setting is used to control whether or not email verificationis sent upon signup:
::
ACCOUNT_EMAIL_VERIFICATION = True
``LOGIN_REDIRECT_URLNAME``--------------------------
The name defined in the URLconf that maps to the url that the user will beredirected to after login success.
::
LOGIN_REDIRECT_URLNAME = "home"
``STATIC_URL``--------------
**Required**. An URL for static files that need serving.
::
STATIC_URL = "/static/"
``ACCOUNT_OPEN_SIGNUP``-----------------------
**Required**. Permit signing up for an account via OpenID.
http://pinaxproject.com/docs/dev/_sources/apps/account/reference.txt (1 of 8) [12/8/10 1:42:40 AM]
http://pinaxproject.com/docs/dev/_sources/apps/account/reference.txt
::
ACCOUNT_OPEN_SIGNUP = True
Named URLs==========
The named URLs in this app should enable the use of of the ``{% url %}``template tag as well as ``reverse`` lookups in your project code without havingto know the implementation details of this app.
acct_email----------
This is the URL that on POST will process a number of actions related to anemail address on an account and on GET will render a template that provides theemail form in context.
acct_signup-----------
This URL will process a form to create an account on POST and render a templatewith a signup form instance in context on GET requests.
acct_login----------
Process a login request from POST requests and render a template with a loginform instance in context on GET requests.
acct_login_openid-----------------
Process the login POST request while associating submitted OpenID credentialsto the account if they don't already exist.
acct_passwd-----------
Process a password change form POST or render a template with a password changeform instance in context.
acct_passwd_set---------------
http://pinaxproject.com/docs/dev/_sources/apps/account/reference.txt (2 of 8) [12/8/10 1:42:40 AM]
http://pinaxproject.com/docs/dev/_sources/apps/account/reference.txt
Process a password set form POST or render a template with a password set forminstance in context.
acct_passwd_delete------------------
Process a password delete form POST or render a template with a password deleteform instance in context.
acct_passwd_delete_done-----------------------
Renders static template to inform user that the password delete is complete.
acct_timezone_change--------------------
Processes a timezone form POST request to change a user's timezone or rendersa template with the timezone change form instance in context.
acct_other_services-------------------
Adds credentials for Twitter on form POST, or renders a template with the forminstance in context.
acct_other_services_remove--------------------------
Removes Twitter account association with user.
acct_language_change--------------------
Processes a default language selection form POST request or renders a templatewith the language change form in context.
acct_logout-----------
Calls the ``django.contrib.auth.views.logout`` view.
http://pinaxproject.com/docs/dev/_sources/apps/account/reference.txt (3 of 8) [12/8/10 1:42:40 AM]
http://pinaxproject.com/docs/dev/_sources/apps/account/reference.txt
acct_confirm_email------------------
Calls the ``emailconfirmation.views.confirm_email`` view.
:arguments: The token generated in the ``emailconfirmation`` app that matches ``(\w+)``.
acct_passwd_reset-----------------
Process a password reset form POST request and redirect to ``acct_passwd_reset_done``or render a template with the password reset form instance in context.
acct_passwd_reset_done----------------------
Renders a template confirming the password reset process is complete.
acct_passwd_reset_key---------------------
Process a password reset using user key form POST request or render a templatewith the form in context.
:keyword arguments: The UUID and Key for the reset reset request that matches ``(?P<uidb36>[0-9A-Za-z]+)-(?P<key>.+)``
signup_form_validate--------------------
Calls the ``ajax_validation.views.validate`` view with the``pinax.apps.account.forms.SignupForm``.
Templates=========
Templates should be placed in an ``account/`` folder at the root of one of yourtemplate search paths.
login.html----------
:context: ``group``, ``form``, ``url_required``, ``redirect_field_name``, ``redirect_field_value``
signup.html
http://pinaxproject.com/docs/dev/_sources/apps/account/reference.txt (4 of 8) [12/8/10 1:42:40 AM]
http://pinaxproject.com/docs/dev/_sources/apps/account/reference.txt
-----------
:context: ``group``, ``form``, ``redirect_field_name``, ``redirect_field_value``
verification_sent.html----------------------
:context: ``group``, ``email``, ``success_url``
email.html----------
:context: ``group``, ``add_email_form``
password_change.html--------------------
:context: ``group``, ``password_change_form``
password_set.html-----------------
:context: ``group``, ``password_set_form``
password_delete.html--------------------
:context: ``group``
password_delete_done.html-------------------------
:context: None
password_reset.html-------------------
:context: ``group``, ``password_reset_form``
password_reset_done.html------------------------
:context: ``group``
http://pinaxproject.com/docs/dev/_sources/apps/account/reference.txt (5 of 8) [12/8/10 1:42:40 AM]
http://pinaxproject.com/docs/dev/_sources/apps/account/reference.txt
password_reset_from_key.html----------------------------
If there is a valid token:
:context: ``group``, ``form``
otherwise:
:context: ``group``, ``token_fail = True``
timezone_change.html--------------------
:context: ``group``, ``form``
language_change.html--------------------
:context: ``group``, ``form``
other_services.html-------------------
:context: ``group``, ``twitter_form``, ``twitter_authorized``
Modules=======
``pinax.apps.account.admin``----------------------------
.. automodule:: pinax.apps.account.admin :members: :undoc-members:
``pinax.apps.account.auth_backends``------------------------------------
.. automodule:: pinax.apps.account.auth_backends :members: :undoc-members:
http://pinaxproject.com/docs/dev/_sources/apps/account/reference.txt (6 of 8) [12/8/10 1:42:40 AM]
http://pinaxproject.com/docs/dev/_sources/apps/account/reference.txt
``pinax.apps.account.context_processors``-----------------------------------------
.. automodule:: pinax.apps.account.context_processors :members: :undoc-members:
``pinax.apps.account.forms``----------------------------
.. automodule:: pinax.apps.account.forms :members: :undoc-members:
``pinax.apps.account.middleware``---------------------------------
.. automodule:: pinax.apps.account.middleware :members: :undoc-members:
``pinax.apps.account.models``-----------------------------
.. automodule:: pinax.apps.account.models :members: :undoc-members:
``pinax.apps.account.openid_consumer``--------------------------------------
.. automodule:: pinax.apps.account.openid_consumer :members: :undoc-members:
``pinax.apps.account.signals``------------------------------
.. automodule:: pinax.apps.account.signals :members: :undoc-members:
``pinax.apps.account.templatetags.account_tags``------------------------------------------------
http://pinaxproject.com/docs/dev/_sources/apps/account/reference.txt (7 of 8) [12/8/10 1:42:40 AM]
http://pinaxproject.com/docs/dev/_sources/apps/account/reference.txt
.. automodule:: pinax.apps.account.templatetags.account_tags :members: :undoc-members:
``pinax.apps.account.templatetags.openid_tags``-----------------------------------------------
.. automodule:: pinax.apps.account.templatetags.openid_tags :members: :undoc-members:
``pinax.apps.account.templatetags.other_service_tags``------------------------------------------------------
.. automodule:: pinax.apps.account.templatetags.other_service_tags :members: :undoc-members:
``pinax.apps.account.utils``----------------------------
.. automodule:: pinax.apps.account.utils :members: :undoc-members:
``pinax.apps.account.views``----------------------------
.. automodule:: pinax.apps.account.views :members: :undoc-members:
.. _LOGIN_REDIRECT_URL: http://docs.djangoproject.com/en/dev/ref/settings/#login-redirect-url
.. _SECRET_KEY: http://docs.djangoproject.com/en/dev/ref/settings/#secret-key
http://pinaxproject.com/docs/dev/_sources/apps/account/reference.txt (8 of 8) [12/8/10 1:42:40 AM]
http://pinaxproject.com/docs/dev/_sources/apps/analytics/index.txt
.. _ref-pinax.apps.analytics-index:
========================``pinax.apps.analytics``========================
An app to provide a couple of template tags for `Google Analytics`_.
.. toctree:: :maxdepth: 3
gettingstarted reference
.. _Google Analytics: http://analytics.google.com
http://pinaxproject.com/docs/dev/_sources/apps/analytics/index.txt [12/8/10 1:42:44 AM]
http://pinaxproject.com/docs/dev/_sources/apps/analytics/gettingstarted.txt
.. _ref-analytics-gettingstarted:
===============Getting started===============
This documentation's purpose is to help get you up and running with``pinax.apps.analytics`` as fast as possible.
Prerequisites=============
To run ``pinax.apps.analytics`` you need the following:
* Python **2.4+** (Python 3.x is **not** supported yet) * Django **1.2+**
These dependencies should be added to your ``requirements/project.txt`` fileand installed using pip_. For example::
pip install -r requirements/project.txt
Installation============
Add ``pinax.apps.analytics`` to your ``INSTALLED_APPS``:
.. code-block:: python
INSTALLED_APPS = [ # ... "pinax.apps.analytics", ]
Usage=====
You now have two template tags at your disposal to being using in yourtemplates:
http://pinaxproject.com/docs/dev/_sources/apps/analytics/gettingstarted.txt (1 of 2) [12/8/10 1:42:48 AM]
http://pinaxproject.com/docs/dev/_sources/apps/analytics/gettingstarted.txt
::
{% urchin %}
and
::
{% ga %}
To use either of these simply add the ``URCHIN_ID`` setting to ``settings.py``and then in the template where you use to add the tracking code, put thefollowing in your header:
::
{% load analytics %}
and then put either the ``urchin`` or ``ga`` tag in the right spot in your template.
.. _pip: http://pip.openplans.org/
.. _Google Analytics: http://analytics.google.com
http://pinaxproject.com/docs/dev/_sources/apps/analytics/gettingstarted.txt (2 of 2) [12/8/10 1:42:48 AM]
http://pinaxproject.com/docs/dev/_sources/apps/analytics/reference.txt
.. _ref-analytics-reference:
=========Reference=========
Settings========
``URCHIN_ID``-------------
The identifier assigned to your `Google Analytics`_ account. If this is notfound in the ``settings.py`` file, an empty string is returned instead of thejavascript block.
::
URCHIN_ID = 'XXXXXXXXX'
Modules=======
``pinax.apps.analytics.templatetags.analytics``-----------------------------------------------
.. automodule:: pinax.apps.analytics.templatetags.analytics :members: :undoc-members:
.. _Google Analytics: http://analytics.google.com
http://pinaxproject.com/docs/dev/_sources/apps/analytics/reference.txt [12/8/10 1:42:51 AM]
http://pinaxproject.com/docs/dev/_sources/apps/authsub/index.txt
.. _ref-pinax.apps.authsub-index:
======================``pinax.apps.authsub``======================
An app to provide authenticated access to `Google Contacts API`_.
.. toctree:: :maxdepth: 3
gettingstarted reference
.. _Google Contacts API: http://code.google.com/apis/contacts/
http://pinaxproject.com/docs/dev/_sources/apps/authsub/index.txt [12/8/10 1:42:54 AM]
http://pinaxproject.com/docs/dev/_sources/apps/authsub/gettingstarted.txt
.. _ref-authsub-gettingstarted:
===============Getting started===============
This document is designed to get you up and running with``pinax.apps.authsub``...
Prerequisites=============
These are the requirements to run ``pinax.apps.authsub``:
* Python **2.4+** (Python 3.x is **not** supported yet) * Django **1.2+** * gdata (http://pypi.python.org/pypi/gdata/)
These dependencies should be added to your ``requirements/project.txt`` fileand installed using pip_. For example::
pip install -r requirements/project.txt
Installation============
Add ``pinax.apps.authsub`` to your ``INSTALLED_APPS``:
.. code-block:: python
INSTALLED_APPS = [ # ... "pinax.apps.authsub", ]
Hook up ``pinax.apps.authsub`` to your URLconf:
.. code-block:: python
urlpatterns = patterns("",
http://pinaxproject.com/docs/dev/_sources/apps/authsub/gettingstarted.txt (1 of 2) [12/8/10 1:42:57 AM]
http://pinaxproject.com/docs/dev/_sources/apps/authsub/gettingstarted.txt
# ... url(r"^authsub/", include("pinax.apps.authsub.urls")) )
.. _pip: http://pip.openplans.org/
http://pinaxproject.com/docs/dev/_sources/apps/authsub/gettingstarted.txt (2 of 2) [12/8/10 1:42:57 AM]
http://pinaxproject.com/docs/dev/_sources/apps/authsub/reference.txt
.. _ref-authsub-reference:
=========Reference=========
This document covers various components of ``pinax.apps.authsub``.
Named Urls==========
The named urls in this app should enable the use of of the ``{% url %}``template tag as well as ``reverse`` lookups in your project code without havingto know the implementation details of this app.
authsub_login-------------
This redirects user to the ``invitations_contacts`` named url in the``django-friends`` app or to the Google Contacts API.
Modules=======
``pinax.apps.authsub.views``----------------------------
.. automodule:: pinax.apps.authsub.views :members: :undoc-members:
http://pinaxproject.com/docs/dev/_sources/apps/authsub/reference.txt [12/8/10 1:43:00 AM]
http://pinaxproject.com/docs/dev/_sources/apps/autocomplete_app/index.txt
.. _ref-pinax.apps.autocomplete_app-index:
===============================``pinax.apps.autocomplete_app``===============================
A utility app that provides autocomplete functionality to various other apps.
.. toctree:: :maxdepth: 3
gettingstarted reference
http://pinaxproject.com/docs/dev/_sources/apps/autocomplete_app/index.txt [12/8/10 1:43:03 AM]
http://pinaxproject.com/docs/dev/_sources/apps/autocomplete_app/gettingstarted.txt
.. _ref-autocomplete_app-gettingstarted:
===============Getting started===============
This document is designed to get you up and running with the``pinax.apps.autocomplete_app``...
Prerequisites=============
These are the requirements to run ``pinax.apps.autocomplete_app``:
* Python **2.4+** (Python 3.x is **not** supported yet) * Django **1.2+** * ``pinax.apps.basic_profiles`` * ``pinax.apps.profiles`` * django-avatar (http://github.com/ericflo/django-avatar) * django-friends (http://github.com/jtauber/django-friends/)
These dependencies should be added to your ``requirements/project.txt`` fileand installed using pip_. For example::
pip install -r requirements/project.txt
Installation============
Add ``pinax.apps.autocomplete_app`` to your ``INSTALLED_APPS``:
.. code-block:: python
INSTALLED_APPS = [ # ... "pinax.apps.autocomplete_app", ]
.. _ref-autocomplete_app-gettingstarted-usage:
http://pinaxproject.com/docs/dev/_sources/apps/autocomplete_app/gettingstarted.txt (1 of 3) [12/8/10 1:43:06 AM]
http://pinaxproject.com/docs/dev/_sources/apps/autocomplete_app/gettingstarted.txt
Usage=====
After installing this app in your Django project, you now have access to easilyprovide autocomplete lookups via client side javascript.
First, you'll want to wire up the appropriate urls for you app:
.. code-block:: python
urlpatterns = patterns("", url(r"^username_autocomplete_friends/$", "pinax.apps.autocomplete_app.views.username_autocomplete_friends", name="profile_username_autocomplete_friends"), url(r"^username_autocomplete/$", "pinax.apps.autocomplete_app.views.username_autocomplete_all", name="profile_username_autocomplete"), )
The above url mapping will give you two different lookups, one using the``django-friends`` app to look through just the logged in user's friends, andthe other looking through all users in the system.
.. code-block:: html
### <script type="text/javascript" src="jquery.min.js"></script> <script type="text/javascript" src="jquery.autocomplete.min.js"></script> <script type="text/javascript"> $().ready(function() { $("#id_recipient").autocomplete("{% url profile_username_autocomplete %}", { formatItem: function(data, i, n, value) { values = value.split(",,"); return values[0] + values[1] + "<br />" + values[2]; }, formatResult: function(data, value) { return value.split(",,")[1]; }, // TODO: improve highlighting to only affect username. highlight: false }); $("#id_recipient").focus() }); </script> ###
### <input id="id_recipient" type="text">
http://pinaxproject.com/docs/dev/_sources/apps/autocomplete_app/gettingstarted.txt (2 of 3) [12/8/10 1:43:06 AM]
http://pinaxproject.com/docs/dev/_sources/apps/autocomplete_app/gettingstarted.txt
###
.. _pip: http://pip.openplans.org/
http://pinaxproject.com/docs/dev/_sources/apps/autocomplete_app/gettingstarted.txt (3 of 3) [12/8/10 1:43:06 AM]
http://pinaxproject.com/docs/dev/_sources/apps/autocomplete_app/reference.txt
.. _ref-autocomplete_app-reference:
=========Reference=========
This document covers various components of ``pinax.apps.autocomplete_app``.
Modules=======
``pinax.apps.autocomplete_app.views``-------------------------------------
.. automodule:: pinax.apps.autocomplete_app.views :members: :undoc-members:
http://pinaxproject.com/docs/dev/_sources/apps/autocomplete_app/reference.txt [12/8/10 1:43:09 AM]
http://pinaxproject.com/docs/dev/_sources/apps/basic_profiles/index.txt
.. _ref-pinax.apps.basic_profiles-index:
=============================``pinax.apps.basic_profiles``=============================
``pinax.apps.basic_profiles`` is a very basic user profile app.
.. toctree:: :maxdepth: 3
gettingstarted reference
http://pinaxproject.com/docs/dev/_sources/apps/basic_profiles/index.txt [12/8/10 1:43:12 AM]
http://pinaxproject.com/docs/dev/_sources/apps/basic_profiles/gettingstarted.txt
.. _ref-basic_profiles-gettingstarted:
===============Getting started===============
This document is designed to get you up and running with the``pinax.apps.basic_profiles``...
Prerequisites=============
These are the requirements to run ``pinax.apps.basic_profiles``:
* Python **2.4+** (Python 3.x is **not** supported yet) * Django **1.2+** * ``pinax.apps.account`` * django-pagination (http://code.google.com/p/django-pagination/)
These dependencies should be added to your ``requirements/project.txt`` fileand installed using pip_. For example::
pip install -r requirements/project.txt
Installation============
Add ``pinax.apps.basic_profiles`` to your ``INSTALLED_APPS``:
.. code-block:: python
INSTALLED_APPS = [ # ... "pinax.apps.basic_profiles", ]
Hook up ``pinax.apps.basic_profiles`` to your URLconf:
.. code-block:: python
http://pinaxproject.com/docs/dev/_sources/apps/basic_profiles/gettingstarted.txt (1 of 2) [12/8/10 1:43:15 AM]
http://pinaxproject.com/docs/dev/_sources/apps/basic_profiles/gettingstarted.txt
urlpatterns = patterns("", # ... url(r"^profiles/", include("pinax.apps.basic_profiles.urls")) )
.. _pip: http://pip.openplans.org/
http://pinaxproject.com/docs/dev/_sources/apps/basic_profiles/gettingstarted.txt (2 of 2) [12/8/10 1:43:15 AM]
http://pinaxproject.com/docs/dev/_sources/apps/basic_profiles/reference.txt
.. _ref-basic_profiles-reference:
=========Reference=========
This document covers various components of ``pinax.apps.basic_profiles``.
Named Urls==========
The named urls in this app should enable the use of of the ``{% url %}``template tag as well as ``reverse`` lookups in your project code without havingto know the implementation details of this app.
profile_username_autocomplete-----------------------------
An AJAX call back URL to the ``pinax.apps.autocomplete_app.views.username_autocomplete_friends``app that looks up and provides a list of data to the jQuery autocomplete_plugin.
See :ref:`autocomplete app usage documentation <ref-autocomplete_app-gettingstarted-usage>`.
profile_list------------
Upon GET request, this url will render a template named ``basic_profiles/profiles.html``by default with a list of users in context ordered by either ``date_joined`` descendingor by ``username`` ascending. This is further optionally limited with case-insensitivesearch against the ``username`` field if the query parameter ``search_terms`` isprovided. Likewise, the ordering defaults to ``date_joined`` descending which canbe overridden by supplying the query parameter ``order`` with the value of ``name``.
Examples:
.. code-block:: html
<a href="{% url profile_list %}?search_terms=beth&order=name">Show "beth" Users</a>
http://pinaxproject.com/docs/dev/_sources/apps/basic_profiles/reference.txt (1 of 4) [12/8/10 1:43:19 AM]
http://pinaxproject.com/docs/dev/_sources/apps/basic_profiles/reference.txt
This would result in the ``users`` context variable limited to users such as*Beth, Bethany, Marybeth* and would be ordered alphabetically by their username.
The value of ``order`` and ``search_terms`` are also passed to the template ascontext variables.
profile_detail--------------
This url will render a template named ``basic_profiles/profile.html`` bydefault with ``is_me`` and ``other_user`` as context variables where ``is_me``is a boolean that indicates whether or not ``other_user`` is the same as theauthenticated user making the request.
:keyword arguments: The username for the profile to view that matches ``(?P<username>[\w\._-]+)``
profile_edit------------
This url, when POSTed to will process the variables through a``pinax.apps.basic_profiles.forms.ProfileForm`` instance, otherwise it willprocess a GET request by rendering ``basic_profiles/profile_edit.html`` bydefault for regular requests and ``basic_profiles/profile_edit_facebox.html``for ajax calls. It renders both of these templates with an instance of the``pinax.apps.basic_profiles.ProfileForm`` as ``profile_form`` and an instance of``pinax.apps.basic_profiles.models.Profile`` as ``profile``.
Templates=========
Templates should be placed in an ``basic_profiles/`` folder at the root of one of yourtemplate search paths.
profiles.html-------------
:context: ``users``, ``order``, ``search_terms``
http://pinaxproject.com/docs/dev/_sources/apps/basic_profiles/reference.txt (2 of 4) [12/8/10 1:43:19 AM]
http://pinaxproject.com/docs/dev/_sources/apps/basic_profiles/reference.txt
profile.html------------
:context: ``is_me``, ``other_user``
profile_edit.html-----------------
:context: ``profile``, ``profile_form``
profile_edit_facebox.html-------------------------
:context: ``profile``, ``profile_form``
Modules=======
``pinax.apps.basic_profiles.admin``-----------------------------------
.. automodule:: pinax.apps.basic_profiles.admin :members: :undoc-members:
``pinax.apps.basic_profiles.forms``-----------------------------------
.. automodule:: pinax.apps.basic_profiles.forms :members: :undoc-members:
``pinax.apps.basic_profiles.management.commands.create_profiles_for_users``---------------------------------------------------------------------------
.. automodule:: pinax.apps.basic_profiles.management.commands.create_profiles_for_users
http://pinaxproject.com/docs/dev/_sources/apps/basic_profiles/reference.txt (3 of 4) [12/8/10 1:43:19 AM]
http://pinaxproject.com/docs/dev/_sources/apps/basic_profiles/reference.txt
:members: :undoc-members:
``pinax.apps.basic_profiles.models``------------------------------------
.. automodule:: pinax.apps.basic_profiles.models :members: :undoc-members:
``pinax.apps.basic_profiles.templatetags.basic_profile_tags``-------------------------------------------------------------
.. automodule:: pinax.apps.basic_profiles.templatetags.basic_profile_tags :members: :undoc-members:
``pinax.apps.basic_profiles.views``-----------------------------------
.. automodule:: pinax.apps.basic_profiles.views :members: :undoc-members:
.. _autocomplete: http://docs.jquery.com/Plugins/Autocomplete
http://pinaxproject.com/docs/dev/_sources/apps/basic_profiles/reference.txt (4 of 4) [12/8/10 1:43:19 AM]
http://pinaxproject.com/docs/dev/_sources/apps/bbauth/index.txt
.. _ref-pinax.apps.bbauth-index:
=====================``pinax.apps.bbauth``=====================
``pinax.apps.bbauth`` provides Single Sign-On (SSO) for users with existingYahoo! accounts.
.. toctree:: :maxdepth: 3
gettingstarted reference
http://pinaxproject.com/docs/dev/_sources/apps/bbauth/index.txt [12/8/10 1:43:23 AM]
http://pinaxproject.com/docs/dev/_sources/apps/bbauth/gettingstarted.txt
.. _ref-bbauth-gettingstarted:
===============Getting started===============
This document is designed to get you up and running with``pinax.apps.bbauth``...
Prerequisites=============
These are the requirements to run ``pinax.apps.bbauth``:
* Python **2.4+** (Python 3.x is **not** supported yet) * Django **1.2+** * ybrowserauth **1.2**
These dependencies should be added to your ``requirements/project.txt`` fileand installed using pip_. For example::
pip install -r requirements/project.txt
Installation============
Add ``pinax.apps.bbauth`` to your ``INSTALLED_APPS``:
.. code-block:: python
INSTALLED_APPS = [ # ... "pinax.apps.bbauth", ]
Hook up ``pinax.apps.bbauth`` to your URLconf:
.. code-block:: python
urlpatterns = patterns("",
http://pinaxproject.com/docs/dev/_sources/apps/bbauth/gettingstarted.txt (1 of 2) [12/8/10 1:43:26 AM]
http://pinaxproject.com/docs/dev/_sources/apps/bbauth/gettingstarted.txt
# ... url(r"^bbauth/", include("pinax.apps.bbauth.urls")) )
You should also `register your project`_ with Yahoo! to get the tokens you need forthe proper settings variables.
.. _pip: http://pip.openplans.org/
.. _register your project: http://developer.yahoo.com/auth/appreg.html
http://pinaxproject.com/docs/dev/_sources/apps/bbauth/gettingstarted.txt (2 of 2) [12/8/10 1:43:26 AM]
http://pinaxproject.com/docs/dev/_sources/apps/bbauth/reference.txt
.. _ref-bbauth-reference:
=========Reference=========
This document covers various components of ``pinax.apps.bbauth``.
Settings========
``BBAUTH_APP_ID``-----------------
**Required**. The identification string assigned to your app from `registeringwith Yahoo`_!:
::
BBAUTH_APP_ID = ""
``BBAUTH_SHARED_SECRET``------------------------
**Required**. The shared secret that when paired with your ``BBAUTH_APP_ID``authenticates your application with Yahoo! via a call to ``ybrowserauth.YBrowserAuth``. This value is also assigned via `registering with Yahoo`_!:
::
BBAUTH_SHARED_SECRET = ""
Named Urls==========
The named urls in this app should enable the use of of the ``{% url %}``template tag as well as ``reverse`` lookups in your project code without having
http://pinaxproject.com/docs/dev/_sources/apps/bbauth/reference.txt (1 of 2) [12/8/10 1:43:29 AM]
http://pinaxproject.com/docs/dev/_sources/apps/bbauth/reference.txt
to know the implementation details of this app.
bbauth_login------------
Authenticates user through Yahoo! redirecting user to Yahoo! login if notalready authenticated.
bbauth_success--------------
Validates Yahoo! session and sets token into session.
bbauth_logout-------------
Destroys Yahoo! based app session.
Modules=======
``pinax.apps.bbauth.views``----------------------------
.. automodule:: pinax.apps.bbauth.views :members: :undoc-members:
.. _registering with Yahoo: http://developer.yahoo.com/auth/appreg.html
http://pinaxproject.com/docs/dev/_sources/apps/bbauth/reference.txt (2 of 2) [12/8/10 1:43:29 AM]
http://pinaxproject.com/docs/dev/_sources/apps/blog/index.txt
.. _ref-pinax.apps.blog-index:
===================``pinax.apps.blog``===================
A blog app.
.. toctree:: :maxdepth: 3
gettingstarted reference
http://pinaxproject.com/docs/dev/_sources/apps/blog/index.txt [12/8/10 1:43:32 AM]
http://pinaxproject.com/docs/dev/_sources/apps/blog/gettingstarted.txt
.. _ref-blog-gettingstarted:
===============Getting started===============
This document is designed to get you up and running with``pinax.apps.blog``...
Prerequisites=============
These are the requirements to run ``pinax.apps.blog``:
* Python **2.4+** (Python 3.x is **not** supported yet) * Django **1.2+** * atomformat * creoleparser * docutils * django-friends * django-tagging * django-notification * django-threadedcomments
These dependencies should be added to your ``requirements/project.txt`` fileand installed using pip_. For example::
pip install -r requirements/project.txt
Installation============
Add ``pinax.apps.blog`` to your ``INSTALLED_APPS``. In addition, make surerequired django apps are also installed:
.. code-block:: python
INSTALLED_APPS = [ # ... "friends",
http://pinaxproject.com/docs/dev/_sources/apps/blog/gettingstarted.txt (1 of 2) [12/8/10 1:43:35 AM]
http://pinaxproject.com/docs/dev/_sources/apps/blog/gettingstarted.txt
"tagging", "threadedcomments". "notification", "pinax.apps.blog", ]
Hook up ``pinax.apps.blog`` to your URLconf:
.. code-block:: python
urlpatterns = patterns("", # ... url(r"^blog/", include("pinax.apps.blog.urls")) )
.. _pip: http://pip.openplans.org/
http://pinaxproject.com/docs/dev/_sources/apps/blog/gettingstarted.txt (2 of 2) [12/8/10 1:43:35 AM]
http://pinaxproject.com/docs/dev/_sources/apps/blog/reference.txt
.. _ref-blog-reference:
=========Reference=========
This document covers various components of ``pinax.apps.blog``.
Settings========
``PINAX_ITEMS_PER_FEED``------------------------
This setting is used to control how many items in a feed. Defaults to 20:
::
PINAX_ITEMS_PER_FEED = 50
``MARKUP_CHOICES``------------------
A list of markup choices to make available in the blog. Defaults to an emptylist. Available choices are: ``[("restructuredtext", u"reStructuredText"), ("textile", u"Textile"), ("markdown", u"Markdown"), ("creole", u"Creole")]``
The actual origin of this setting is `django-wikiapp`_ which is one of theexternal applications Pinax integrates. ``pinax.apps.blog`` uses it todetermine, how a post's content should be converted from plain text to HTML.
.. _django-wikiapp: http://code.google.com/p/django-wikiapp/
::
MARKUP_CHOICES = [("textile", "Textile"), ("markdown", "Markdown")]
``RESTRUCTUREDTEXT_FILTER_SETTINGS``------------------------------------
Using this option you can pass additional settings as dictionary through the``restructuredtext`` template library to the underlying``docutils.core.publish_parts`` function. Defaults to empty ``dict``.
::
RESTRUCTUREDTEXT_FILTER_SETTINGS = {}
``BEHIND_PROXY``----------------
the users' real IP addresses are stored when they create blog posts. Whenactivated the blog takes the user's IP address from``request.META['HTTP_X_FORWARDED_FOR']`` instead of``request.META['REMOTE_ADDR']``. Defaults to False.
http://pinaxproject.com/docs/dev/_sources/apps/blog/reference.txt (1 of 5) [12/8/10 1:43:39 AM]
http://pinaxproject.com/docs/dev/_sources/apps/blog/reference.txt
::
BEHIND_PROXY = True
Named Urls==========
The named urls in this app should enable the use of of the ``{% url %}``template tag as well as ``reverse`` lookups in your project code without havingto know the implementation details of this app.
blog_post---------
Render a template with a specific blog post entry in context.
:keyword arguments: ``(?P<username>[-\w]+)/(?P<year>\d{4})/(?P<month>\d{2})/(?P<slug>[-\w]+)``
blog_list_all-------------
Render a template with a queryset in context of all blog posts.
blog_list_user--------------
Renders a template with a queryset in context of blog posts that are owned by aspecified username.
:keyword arguments: The username to list blog posts for matching ``(?P<username>\w+)``.
blog_list_yours---------------
Renders a template with a queryset in context of blog posts that are owned bythe logged in user.
blog_new--------
A GET request renders a template with a form instance in context. A POST requestprocesses the data from this form and redirects user to blog_list_yours_.
blog_edit---------
Upon a GET request a form is rendered to edit the blog entry. This urls alsowill process the POST request from submitting the form. After updating the postthe response will be redirected to blog_list_yours_.
:arguments: The id for the blog post that matches ``(\d+)``.
http://pinaxproject.com/docs/dev/_sources/apps/blog/reference.txt (2 of 5) [12/8/10 1:43:39 AM]
http://pinaxproject.com/docs/dev/_sources/apps/blog/reference.txt
blog_destroy------------
Delete a blog post that is yours on POST requests. Otherwise, it redirectsthe user to blog_list_yours_.
:arguments: The id for the blog post that matches ``(\d+)``.
blog_form_validate------------------
Uses the ajax_validation app, it validates the blog post with the ``pinax.apps.blog.forms.BlogForm``.
Templates=========
Templates should be placed in an ``blog/`` folder at the root of one of yourtemplate search paths.
blogs.html----------
:context: ``blogs``
post.html---------
:context: ``post``
your_posts.html---------------
:context: ``blogs``
new.html--------
:context: ``blog_form``
edit.html---------
:context: ``blog_form``, ``post``
Modules=======
``pinax.apps.blog.admin``-------------------------
.. automodule:: pinax.apps.blog.admin :members:
http://pinaxproject.com/docs/dev/_sources/apps/blog/reference.txt (3 of 5) [12/8/10 1:43:39 AM]
http://pinaxproject.com/docs/dev/_sources/apps/blog/reference.txt
:undoc-members:
``pinax.apps.blog.feeds``-------------------------
.. automodule:: pinax.apps.blog.feeds :members: :undoc-members:
``pinax.apps.blog.forms``-------------------------
.. automodule:: pinax.apps.blog.forms :members: :undoc-members:
``pinax.apps.blog.models``--------------------------
.. automodule:: pinax.apps.blog.models :members: :undoc-members:
``pinax.apps.blog.templatetags.blog_tags``------------------------------------------
.. automodule:: pinax.apps.blog.templatetags.blog_tags :members: :undoc-members:
``pinax.apps.blog.templatetags.creole``---------------------------------------
.. automodule:: pinax.apps.blog.templatetags.creole :members: :undoc-members:
``pinax.apps.blog.templatetags.restructuredtext``-------------------------------------------------
.. automodule:: pinax.apps.blog.templatetags.restructuredtext :members: :undoc-members:
``pinax.apps.blog.templatetags.switchcase``-------------------------------------------
.. automodule:: pinax.apps.blog.templatetags.switchcase :members: :undoc-members:
``pinax.apps.blog.views``-------------------------
http://pinaxproject.com/docs/dev/_sources/apps/blog/reference.txt (4 of 5) [12/8/10 1:43:39 AM]
http://pinaxproject.com/docs/dev/_sources/apps/blog/reference.txt
.. automodule:: pinax.apps.blog.views :members: :undoc-members:
http://pinaxproject.com/docs/dev/_sources/apps/blog/reference.txt (5 of 5) [12/8/10 1:43:39 AM]
http://pinaxproject.com/docs/dev/_sources/apps/photos/index.txt
.. _ref-pinax.apps.photos-index:
=====================``pinax.apps.photos``=====================
An app for managing photographs/images.
.. toctree:: :maxdepth: 3
gettingstarted reference
http://pinaxproject.com/docs/dev/_sources/apps/photos/index.txt [12/8/10 1:43:42 AM]
http://pinaxproject.com/docs/dev/_sources/apps/photos/gettingstarted.txt
.. _ref-photos-gettingstarted:
===============Getting started===============
This document is designed to get you up and running with``pinax.apps.photos``...
Prerequisites=============
These are the requirements to run ``pinax.apps.photos``:
* Python **2.4+** (Python 3.x is **not** supported yet) * Django **1.2+** * django-photologue **2.3**
These dependencies should be added to your ``requirements/project.txt`` fileand installed using pip_. For example::
pip install -r requirements/project.txt
Installation============
Add ``pinax.apps.photos`` to your ``INSTALLED_APPS``:
.. code-block:: python
INSTALLED_APPS = [ # ... "pinax.apps.photos", ]
Hook up ``pinax.apps.photos`` to your URLconf:
.. code-block:: python
urlpatterns = patterns("",
http://pinaxproject.com/docs/dev/_sources/apps/photos/gettingstarted.txt (1 of 2) [12/8/10 1:43:45 AM]
http://pinaxproject.com/docs/dev/_sources/apps/photos/gettingstarted.txt
# ... url(r"^photos/", include("pinax.apps.photos.urls")) )
.. _pip: http://pip.openplans.org/
http://pinaxproject.com/docs/dev/_sources/apps/photos/gettingstarted.txt (2 of 2) [12/8/10 1:43:45 AM]
http://pinaxproject.com/docs/dev/_sources/apps/photos/reference.txt
.. _ref-photos-reference:
=========Reference=========
This document covers various components of ``pinax.apps.photos``.
Named URLs==========
The named URLs in this app should enable the use of of the ``{% url %}``template tag as well as ``reverse`` lookups in your project code without havingto know the implementation details of this app.
photos------
Renders the ``photos/latest.html`` template with a list of recent ``photos``in context.
photo_details-------------
Renders the ``photos/details.html`` template with the ``photo`` object incontext along with some other relevant context variables.
:keyword arguments: The id of the photo matching ``(?P<id>\d+)``
photo_upload------------
For a GET request, this URL will render the ``photos/upload.html`` templatewith an instance of the ``pinax.apps.photos.forms.PhotoUploadForm`` in contextas a variable named ``photo_form``.
For a POST request to this URL, the ``photo_form`` will be processed -- theupload handled and the database record created before redirecting to
http://pinaxproject.com/docs/dev/_sources/apps/photos/reference.txt (1 of 5) [12/8/10 1:43:49 AM]
http://pinaxproject.com/docs/dev/_sources/apps/photos/reference.txt
photo_details_.
photos_yours------------
Renders the ``photos/yourphotos.html`` template with a collection of photosthat belong to the logged in user as the ``photos`` context variable.
photos_member-------------
Renders the ``photos/memberphotos.html`` template with a collection of photosfor a particular user that are flagged as ``public = True``.
:keyword arguments: The username of the member matching ``(?P<username>[\w]+)``
photo_destroy-------------
A GET request to this URL will simply redirect the user to photos_yours_.
A POST request to this URL will delete the photo if the user is the owner ofthe image. Then it will redirect the user to photos_yours_.
:keyword arguments: The id of the photo matching ``(?P<id>\d+)``
photo_edit----------
A GET request to this URL will render the ``photos/edit.html`` with an instanceof the ``pinax.apps.photos.forms.PhotoEditForm`` in context as the``photo_form`` context variable along with ``photo`` and ``photo_url``.
A POST request to this URL will process the data submitted in the form, onlysaving the data if the user requesting the update is the owner of the photo. Itwill then redirect the user to photo_details_.
:keyword arguments: The id of the photo matching ``(?P<id>\d+)``
http://pinaxproject.com/docs/dev/_sources/apps/photos/reference.txt (2 of 5) [12/8/10 1:43:49 AM]
http://pinaxproject.com/docs/dev/_sources/apps/photos/reference.txt
Templates=========
Templates should be placed in an ``photos/`` folder at the root of one of yourtemplate search paths.
upload.html-----------
:context: ``group``, ``group_base``, ``photo_form``
yourphotos.html---------------
:context: ``group``, ``group_base``, ``photos``
latest.html-----------
:context: ``group``, ``group_base``, ``photos``
details.html------------
:context: ``group``, ``group_base``, ``photo``, ``host``, ``photo_url``, ``is_me``
memberphotos.html-----------------
:context: ``group``, ``group_base``, ``photos``
edit.html---------
:context: ``group``, ``group_base``, ``photo``, ``photo_form``, ``photo_url``
http://pinaxproject.com/docs/dev/_sources/apps/photos/reference.txt (3 of 5) [12/8/10 1:43:49 AM]
http://pinaxproject.com/docs/dev/_sources/apps/photos/reference.txt
Modules=======
``pinax.apps.photos.admin``---------------------------
.. automodule:: pinax.apps.photos.admin :members: :undoc-members:
``pinax.apps.photos.forms``---------------------------
.. automodule:: pinax.apps.photos.forms :members: :undoc-members:
``pinax.apps.photos.models``----------------------------
.. automodule:: pinax.apps.photos.models :members: :undoc-members:
``pinax.apps.photos.templatetags.photo_tags``---------------------------------------------
.. automodule:: pinax.apps.photos.templatetags.photo_tags :members: :undoc-members:
``pinax.apps.photos.views``---------------------------
.. automodule:: pinax.apps.photos.views :members:
http://pinaxproject.com/docs/dev/_sources/apps/photos/reference.txt (4 of 5) [12/8/10 1:43:49 AM]
http://pinaxproject.com/docs/dev/_sources/apps/photos/reference.txt
:undoc-members:
http://pinaxproject.com/docs/dev/_sources/apps/photos/reference.txt (5 of 5) [12/8/10 1:43:49 AM]
http://pinaxproject.com/docs/dev/_sources/apps/profiles/index.txt
.. _ref-pinax.apps.profiles-index:
=======================``pinax.apps.profiles``=======================
The ``profiles`` app provides a simple user profile for every user thatregisters/creates an account.
.. toctree:: :maxdepth: 3
gettingstarted reference
http://pinaxproject.com/docs/dev/_sources/apps/profiles/index.txt [12/8/10 1:43:52 AM]
http://pinaxproject.com/docs/dev/_sources/apps/profiles/gettingstarted.txt
.. _ref-profiles-gettingstarted:
===============Getting started===============
This document is designed to get you up and running with``pinax.apps.profiles``...
Prerequisites=============
These are the requirements to run ``pinax.apps.profiles``:
* Python **2.4+** (Python 3.x is **not** supported yet) * Django **1.2+** * django-friends **0.1.5** * django-microblogging **0.2.dev1**
These dependencies should be added to your ``requirements/project.txt`` fileand installed using pip_. For example::
pip install -r requirements/project.txt
Installation============
Add ``pinax.apps.profiles`` to your ``INSTALLED_APPS``:
.. code-block:: python
INSTALLED_APPS = [ # ... "pinax.apps.profiles", ]
Hook up ``pinax.apps.profiles`` to your URLconf:
.. code-block:: python
http://pinaxproject.com/docs/dev/_sources/apps/profiles/gettingstarted.txt (1 of 2) [12/8/10 1:43:55 AM]
http://pinaxproject.com/docs/dev/_sources/apps/profiles/gettingstarted.txt
urlpatterns = patterns("", # ... url(r"^profiles/", include("pinax.apps.profiles.urls")) )
.. _pip: http://pip.openplans.org/
http://pinaxproject.com/docs/dev/_sources/apps/profiles/gettingstarted.txt (2 of 2) [12/8/10 1:43:55 AM]
http://pinaxproject.com/docs/dev/_sources/apps/profiles/reference.txt
.. _ref-profiles-reference:
=========Reference=========
This document covers various components of ``pinax.apps.profiles``.
Named URLs==========
The named URLs in this app should enable the use of of the ``{% url %}``template tag as well as ``reverse`` lookups in your project code without havingto know the implementation details of this app.
profile_username_autocomplete-----------------------------
An AJAX call back URL to the ``pinax.apps.autocomplete_app.views.username_autocomplete_friends``app that looks up and provides a list of data to the jQuery autocomplete_plugin.
See :ref:`autocomplete app usage documentation <ref-autocomplete_app-gettingstarted-usage>`.
profile_list------------
Upon GET request, this url will render a template named ``profiles/profiles.html``by default with a list of users in context ordered by either ``date_joined`` descendingor by ``username`` ascending. This is further optionally limited with case-insensitivesearch against the ``username`` field if the query parameter ``search_terms`` isprovided. Likewise, the ordering defaults to ``date_joined`` descending which canbe overridden by supplying the query parameter ``order`` with the value of ``name``.
Examples:
.. code-block:: htmlhttp://pinaxproject.com/docs/dev/_sources/apps/profiles/reference.txt (1 of 4) [12/8/10 1:43:58 AM]
http://pinaxproject.com/docs/dev/_sources/apps/profiles/reference.txt
<a href="{% url profile_list %}?search_terms=beth&order=name">Show "beth" Users</a>
This would result in the ``users`` context variable limited to users such as*Beth, Bethany, Marybeth* and would be ordered alphabetically by their username.
The value of ``order`` and ``search_terms`` are also passed to the template ascontext variables.
profile_detail--------------
This url will render a template named ``profiles/profile.html`` bydefault with ``is_me`` and ``other_user`` as context variables where ``is_me``is a boolean that indicates whether or not ``other_user`` is the same as theauthenticated user making the request.
:keyword arguments: The username for the profile to view that matches ``(?P<username>[\w\._-]+)``
profile_edit------------
This url, when POSTed to will process the variables through a``pinax.apps.profiles.forms.ProfileForm`` instance, otherwise it willprocess a GET request by rendering ``profiles/profile_edit.html`` bydefault for regular requests and ``profiles/profile_edit_facebox.html``for ajax calls. It renders both of these templates with an instance of the``pinax.apps.profiles.ProfileForm`` as ``profile_form`` and an instance of``pinax.apps.profiles.models.Profile`` as ``profile``.
Templates=========
Templates should be placed in an ``profiles/`` folder at the root of one ofyour template search paths.
profiles.htmlhttp://pinaxproject.com/docs/dev/_sources/apps/profiles/reference.txt (2 of 4) [12/8/10 1:43:58 AM]
http://pinaxproject.com/docs/dev/_sources/apps/profiles/reference.txt
-------------
:context: ``users``, ``order``, ``search_terms``
profile.html------------
:context: ``is_me``, ``is_friend``, ``is_following``, ``other_user``, ``other_friends``, ``invite_form``, ``previous_invitations_to``, ``previous_invitations_from``
profile_edit.html-----------------
:context: ``profile``, ``profile_form``
profile_edit_facebox.html-------------------------
:context: ``profile``, ``profile_form``
Modules=======
``pinax.apps.profiles.admin``-----------------------------
.. automodule:: pinax.apps.profiles.admin :members: :undoc-members:
``pinax.apps.profiles.forms``-----------------------------
.. automodule:: pinax.apps.profiles.forms :members: :undoc-members:
http://pinaxproject.com/docs/dev/_sources/apps/profiles/reference.txt (3 of 4) [12/8/10 1:43:58 AM]
http://pinaxproject.com/docs/dev/_sources/apps/profiles/reference.txt
``pinax.apps.profiles.models``------------------------------
.. automodule:: pinax.apps.profiles.models :members: :undoc-members:
``pinax.apps.profiles.templatetags.profile_tags``-------------------------------------------------
.. automodule:: pinax.apps.profiles.templatetags.profile_tags :members: :undoc-members:
``pinax.apps.profiles.views``-----------------------------
.. automodule:: pinax.apps.profiles.views :members: :undoc-members:
.. _autocomplete: http://docs.jquery.com/Plugins/Autocomplete
http://pinaxproject.com/docs/dev/_sources/apps/profiles/reference.txt (4 of 4) [12/8/10 1:43:58 AM]
http://pinaxproject.com/docs/dev/_sources/apps/projects/index.txt
.. _ref-pinax.apps.projects-index:
=======================``pinax.apps.projects``=======================
An app to manage projects and project members.
.. toctree:: :maxdepth: 3
gettingstarted reference
http://pinaxproject.com/docs/dev/_sources/apps/projects/index.txt [12/8/10 1:44:01 AM]
http://pinaxproject.com/docs/dev/_sources/apps/projects/gettingstarted.txt
.. _ref-projects-gettingstarted:
===============Getting started===============
This document is designed to get you up and running with``pinax.apps.projects``...
Prerequisites=============
These are the requirements to run ``pinax.apps.projects``:
* Python **2.4+** (Python 3.x is **not** supported yet) * Django **1.2+** * django-groups **0.1.dev10** * django-notification **0.1.4** * django-wikiapp **0.2.0** * ref:`pinax.apps.tasks` * ref:`pinax.apps.topics`
These dependencies should be added to your ``requirements/project.txt`` fileand installed using pip_. For example::
pip install -r requirements/project.txt
Installation============
Add ``pinax.apps.projects`` to your ``INSTALLED_APPS``:
.. code-block:: python
INSTALLED_APPS = [ # ... "groups", "notification", "pinax.apps.tasks", "pinax.apps.topics",
http://pinaxproject.com/docs/dev/_sources/apps/projects/gettingstarted.txt (1 of 2) [12/8/10 1:44:04 AM]
http://pinaxproject.com/docs/dev/_sources/apps/projects/gettingstarted.txt
"pinax.apps.projects", "wiki" ]
Hook up ``pinax.apps.projects`` to your URLconf:
.. code-block:: python
urlpatterns = patterns("", # ... url(r"^projects/", include("pinax.apps.projects.urls")) )
.. _pip: http://pip.openplans.org/
http://pinaxproject.com/docs/dev/_sources/apps/projects/gettingstarted.txt (2 of 2) [12/8/10 1:44:04 AM]
http://pinaxproject.com/docs/dev/_sources/apps/projects/reference.txt
.. _ref-projects-reference:
=========Reference=========
This document covers various components of ``pinax.apps.projects``.
Named URLs==========
The named URLs in this app should enable the use of of the ``{% url %}``template tag as well as ``reverse`` lookups in your project code without havingto know the implementation details of this app.
project_list------------
Renders the ``projects/projects.html`` template with a list of all Projectobjects in context as ``projects``, optionally filtered via the query parameter``search`` on the ``name`` and ``description`` fields.
project_create--------------
On GET requests, renders the ``projects/create.html`` template with an instanceof ``pinax.apps.projects.forms.ProjectForm`` as the ``project_form`` contextvariable.
On POST requests, it processes the ``pinax.apps.projects.forms.ProjectForm``form to create a new form. It then redirects to `project_detail`_.
your_projects-------------
Renders the ``projects/your_projects.html`` template with a list of all Projectobjects where the current logged in user is a member as the context variable``projects``.
http://pinaxproject.com/docs/dev/_sources/apps/projects/reference.txt (1 of 4) [12/8/10 1:44:08 AM]
http://pinaxproject.com/docs/dev/_sources/apps/projects/reference.txt
project_detail--------------
Renders the ``projects/project.html`` template with a single Project object asthe context variable ``project``.
If this URL receives a POST request it will either add the current user to theproject via the ``pinax.apps.projects.forms.AddUserForm`` or will update theproject via the ``pinax.apps.projects.forms.ProjectUpdateForm``.
:keyword arguments: The slug that identifies the project that matches ``(?P<group_slug>[-\w]+)``.
project_delete--------------
Upon POST request and validation that user is the project creator and is theonly remaining member on the project, this will delete the project. Afterdeletion, whether failed or succeeded, it will redirect the user to`project_list`_
:keyword arguments: The slug that identifies the project that matches ``(?P<group_slug>[-\w]+)``.
Templates=========
Templates should be placed in an ``projects/`` folder at the root of one of yourtemplate search paths.
create.html-----------
:context: ``project_form``
project.html------------
:context: ``project_form``, ``adduser_form``, ``project``, ``group``, ``is_member``
http://pinaxproject.com/docs/dev/_sources/apps/projects/reference.txt (2 of 4) [12/8/10 1:44:08 AM]
http://pinaxproject.com/docs/dev/_sources/apps/projects/reference.txt
projects.html-------------
:context: ``projects``, ``search_terms``
your_projects.html------------------
:context: ``projects``
Modules=======
``pinax.apps.projects.admin``-----------------------------
.. automodule:: pinax.apps.projects.admin :members: :undoc-members:
``pinax.apps.projects.forms``-----------------------------
.. automodule:: pinax.apps.projects.forms :members: :undoc-members:
``pinax.apps.projects.models``------------------------------
.. automodule:: pinax.apps.projects.models :members: :undoc-members:
http://pinaxproject.com/docs/dev/_sources/apps/projects/reference.txt (3 of 4) [12/8/10 1:44:08 AM]
http://pinaxproject.com/docs/dev/_sources/apps/projects/reference.txt
``pinax.apps.projects.templatetags.projects_tags``--------------------------------------------------
.. automodule:: pinax.apps.projects.templatetags.projects_tags :members: :undoc-members:
``pinax.apps.projects.views``-----------------------------
.. automodule:: pinax.apps.projects.views :members: :undoc-members:
http://pinaxproject.com/docs/dev/_sources/apps/projects/reference.txt (4 of 4) [12/8/10 1:44:08 AM]
http://pinaxproject.com/docs/dev/_sources/apps/signup_codes/index.txt
.. _ref-pinax.apps.signup_codes-index:
===========================``pinax.apps.signup_codes``===========================
An app to facilitate running an invite system and tracking those invites, forexample in running a private beta of a site.
.. toctree:: :maxdepth: 3
gettingstarted reference
http://pinaxproject.com/docs/dev/_sources/apps/signup_codes/index.txt [12/8/10 1:44:11 AM]
http://pinaxproject.com/docs/dev/_sources/apps/signup_codes/gettingstarted.txt
.. _ref-signup_codes-gettingstarted:
===============Getting started===============
This document is designed to get you up and running with``pinax.apps.signup_codes``...
Prerequisites=============
These are the requirements to run ``pinax.apps.signup_codes``:
* Python **2.4+** (Python 3.x is **not** supported yet) * Django **1.2+** * :ref:`ref-pinax.apps.account-index`
These dependencies should be added to your ``requirements/project.txt`` fileand installed using pip_. For example::
pip install -r requirements/project.txt
Installation============
Add ``pinax.apps.signup_codes`` to your ``INSTALLED_APPS``:
.. code-block:: python
INSTALLED_APPS = [ # ... "pinax.apps.signup_codes", ]
.. _pip: http://pip.openplans.org/
http://pinaxproject.com/docs/dev/_sources/apps/signup_codes/gettingstarted.txt [12/8/10 1:44:14 AM]
http://pinaxproject.com/docs/dev/_sources/apps/signup_codes/reference.txt
.. _ref-signup_codes-reference:
=========Reference=========
This document covers various components of ``pinax.apps.signup_codes``.
Settings========
``ACCOUNT_OPEN_SIGNUP``-----------------------
**Required**. Permit signing up for an account via OpenID.
::
ACCOUNT_OPEN_SIGNUP = True
Templates=========
Templates should be placed in an ``signup_codes/`` folder unless otherwisenoted, at the root of one of your template search paths.
admin_invite_user.html----------------------
:context: ``group``, ``group_base``, ``title``, ``form``
account/signup.html-------------------
:context: ``group``, ``group_base``, ``code``, ``form``
failure.html
http://pinaxproject.com/docs/dev/_sources/apps/signup_codes/reference.txt (1 of 2) [12/8/10 1:44:17 AM]
http://pinaxproject.com/docs/dev/_sources/apps/signup_codes/reference.txt
------------
:context: ``group``, ``group_base``, ``code``
Modules=======
``pinax.apps.signup_codes.admin``---------------------------------
.. automodule:: pinax.apps.signup_codes.admin :members: :undoc-members:
``pinax.apps.signup_codes.forms``---------------------------------
.. automodule:: pinax.apps.signup_codes.forms :members: :undoc-members:
``pinax.apps.signup_codes.models``----------------------------------
.. automodule:: pinax.apps.signup_codes.models :members: :undoc-members:
``pinax.apps.signup_codes.views``---------------------------------
.. automodule:: pinax.apps.signup_codes.views :members: :undoc-members:
http://pinaxproject.com/docs/dev/_sources/apps/signup_codes/reference.txt (2 of 2) [12/8/10 1:44:17 AM]
http://pinaxproject.com/docs/dev/_sources/apps/tagging_utils/index.txt
.. _ref-pinax.apps.tagging_utils-index:
============================``pinax.apps.tagging_utils``============================
Provides an autocomplete text input widget for tags.
.. toctree:: :maxdepth: 3
gettingstarted reference
http://pinaxproject.com/docs/dev/_sources/apps/tagging_utils/index.txt [12/8/10 1:44:20 AM]
http://pinaxproject.com/docs/dev/_sources/apps/tagging_utils/gettingstarted.txt
.. _ref-tagging_utils-gettingstarted:
===============Getting started===============
This document is designed to get you up and running with``pinax.apps.tagging_utils``...
Prerequisites=============
These are the requirements to run ``pinax.apps.tagging_utils``:
* Python **2.4+** (Python 3.x is **not** supported yet) * Django **1.2+** * django-tagging
These dependencies should be added to your ``requirements/project.txt`` fileand installed using pip_. For example::
pip install -r requirements/project.txt
Installation============
Add ``tagging`` and ``pinax.apps.tagging_utils`` to your ``INSTALLED_APPS``:
.. code-block:: python
INSTALLED_APPS = [ # ... "tagging", "pinax.apps.tagging_utils", ]
Hook up ``pinax.apps.tagging_utils`` to your URLconf:
.. code-block:: python
http://pinaxproject.com/docs/dev/_sources/apps/tagging_utils/gettingstarted.txt (1 of 2) [12/8/10 1:44:23 AM]
http://pinaxproject.com/docs/dev/_sources/apps/tagging_utils/gettingstarted.txt
urlpatterns = patterns("", # ... url(r"^tagging_utils/", include("pinax.apps.tagging_utils.urls")) )
.. _pip: http://pip.openplans.org/
http://pinaxproject.com/docs/dev/_sources/apps/tagging_utils/gettingstarted.txt (2 of 2) [12/8/10 1:44:23 AM]
http://pinaxproject.com/docs/dev/_sources/apps/tagging_utils/reference.txt
.. _ref-tagging_utils-reference:
=========Reference=========
This document covers various components of ``pinax.apps.tagging_utils``.
Settings========
``STATIC_URL``--------------
**Required**. An URL for static files that need serving.
::
STATIC_URL = "/static/"
Named URLs==========
The named URLs in this app should enable the use of of the ``{% url %}``template tag as well as ``reverse`` lookups in your project code without havingto know the implementation details of this app.
tagging_utils_autocomplete--------------------------
This URL provides an Ajax callback that will supply delimited data for thejQuery autocomplete plugin to display autocomplete info for tags in a UI.
:keyword arguments: The ``app_label`` and ``model`` that tags are associated with and that match ``(?P<app_label>\w+)/(?P<model>\w+)``.
Modules=======
``pinax.apps.tagging_utils.views``----------------------------------
.. automodule:: pinax.apps.tagging_utils.views :members: :undoc-members:
``pinax.apps.tagging_utils.widgets``------------------------------------
.. automodule:: pinax.apps.tagging_utils.widgets :members:
http://pinaxproject.com/docs/dev/_sources/apps/tagging_utils/reference.txt (1 of 2) [12/8/10 1:44:26 AM]
http://pinaxproject.com/docs/dev/_sources/apps/tagging_utils/reference.txt
:undoc-members:
http://pinaxproject.com/docs/dev/_sources/apps/tagging_utils/reference.txt (2 of 2) [12/8/10 1:44:26 AM]
http://pinaxproject.com/docs/dev/_sources/apps/tasks/index.txt
.. _ref-pinax.apps.tasks-index:
====================``pinax.apps.tasks``====================
An app to manage tasks.
.. toctree:: :maxdepth: 3
gettingstarted reference
http://pinaxproject.com/docs/dev/_sources/apps/tasks/index.txt [12/8/10 1:44:29 AM]
http://pinaxproject.com/docs/dev/_sources/apps/tasks/gettingstarted.txt
.. _ref-tasks-gettingstarted:
===============Getting started===============
This document is designed to get you up and running with``pinax.apps.tasks``...
Prerequisites=============
These are the requirements to run ``pinax.apps.tasks``:
* Python **2.4+** (Python 3.x is **not** supported yet) * Django **1.2+** * django-attachments **0.3.1** * django-atomformat **0.1.1.dev1** * django-filter **0.5.3** * django-tagging **0.3.1** * django-notification **0.1.4** * django-threadedcomments **0.5.2** * dpaste [optional]
These dependencies should be added to your ``requirements/project.txt`` fileand installed using pip_. For example::
pip install -r requirements/project.txt
Installation============
Add ``pinax.apps.tasks`` to your ``INSTALLED_APPS``:
.. code-block:: python
INSTALLED_APPS = [ # ... "pinax.apps.tasks", ]
http://pinaxproject.com/docs/dev/_sources/apps/tasks/gettingstarted.txt (1 of 2) [12/8/10 1:44:32 AM]
http://pinaxproject.com/docs/dev/_sources/apps/tasks/gettingstarted.txt
Hook up ``pinax.apps.account`` to your URLconf:
.. code-block:: python
urlpatterns = patterns("", # ... url(r"^tasks/", include("pinax.apps.tasks.urls")) )
.. _pip: http://pip.openplans.org/
http://pinaxproject.com/docs/dev/_sources/apps/tasks/gettingstarted.txt (2 of 2) [12/8/10 1:44:32 AM]
http://pinaxproject.com/docs/dev/_sources/apps/tasks/reference.txt
.. _ref-tasks-reference:
=========Reference=========
This document covers various components of ``pinax.apps.tasks``.
Settings========
``PINAX_ITEMS_PER_FEED``------------------------
The number of tasks items to include in the feed. Defaults to ``20``.
::
PINAX_ITEMS_PER_FEED = 100
``TASKS_WORKFLOW_MODULE``-------------------------
The module that controls the workflow of a task. Defaults to`pinax.apps.tasks.workflow`_.
::
TASKS_WORKFLOW_MODULE = "myproject.workflow"
``STATIC_URL``--------------
**Required**. An URL for static files that need serving.
::
STATIC_URL = "/static/"
http://pinaxproject.com/docs/dev/_sources/apps/tasks/reference.txt (1 of 7) [12/8/10 1:44:36 AM]
http://pinaxproject.com/docs/dev/_sources/apps/tasks/reference.txt
Named URLs==========
The named URLs in this app should enable the use of of the ``{% url %}``template tag as well as ``reverse`` lookups in your project code without havingto know the implementation details of this app.
task_list---------
Renders the `task_list.html`_ template with a filtered list of tasks incontext.
task_focus----------
Renders the `focus.html`_ template filtering down ``Tasks`` by either``modified``, ``state``, ``assignee``, or ``tag``.
:keyword arguments: The field/value with which to filter down the ``Tasks`` matching ``(?P<field>modified|state|assignee|tag)/(?P<value>[^/]+)/``.
task_add--------
For GET requests, renders `add.html`_ template with a ``pinax.apps.tasks.forms.TaskForm``instance in context.
For a POST request, process the form, redirecting either to `task_add`_ or `task_list`_.
task_add_paste--------------
For GET requests, renders `add.html`_ template with a ``pinax.apps.tasks.forms.TaskForm``instance in context.
For a POST request, processes the form, redirecting either to `task_add`_ or `task_list`_.
:keyword arguments: There is an optional argument that is the ``secret_id`` for the ``dpaste.models.Snippet``. It must match ``(?P<secret_id>\w+)``.
task_detail
http://pinaxproject.com/docs/dev/_sources/apps/tasks/reference.txt (2 of 7) [12/8/10 1:44:36 AM]
http://pinaxproject.com/docs/dev/_sources/apps/tasks/reference.txt
-----------
For GET requests, renders the `task.html`_ template with a particular``pinax.apps.tasks.models.Task`` object as well as an instance of``pinax.apps.tasks.forms.EditTaskForm``.
For POST requests, processes the form.
:keyword arguments: The id of the tasks you wish to view/edit: ``(?P<id>\d+)``.
tasks_for_user--------------
Renders the `user_tasks.html`_ template with tasks for the user who'susername is specified in the URL argument.
:keyword arguments: The username of the user who's tickets you wish to view. Must match ``(?P<username>[-\w]+)``.
tasks_mini_list---------------
Renders the `mini_list.html`_ template with all the logged in user'sassigned tasks.
tasks_history_list------------------
Renders the `tasks_history_list.html`_ template with a list of ``pinax.apps.models.TaskHistory`` objects where ``object_id is None``.
tasks_history-------------
Renders the `task_history.html`_ template with a ``pinax.apps.tasks.models.Task`` object and a list of ``pinax.apps.tasks.models.TaskHistory`` objects that are linked to thatobject.
:keyword arguments: The id of the Task to view history on. Must match ``(?P<id>\d+)``.
http://pinaxproject.com/docs/dev/_sources/apps/tasks/reference.txt (3 of 7) [12/8/10 1:44:36 AM]
http://pinaxproject.com/docs/dev/_sources/apps/tasks/reference.txt
tasks_nudge-----------
Toggles a ``pinax.apps.tasks.models.Nudge`` object's existence for a given``pinax.apps.tasks.models.Task`` object and user context. If the a ``Nudge``exists, it gets deleted. If it doesn't it's created.
:keyword arguments: The id of the Task to nudge. Must match ``(?P<id>\d+)``.
tasks_export_state_transitions------------------------------
Returns a data dump via a ``text/csv`` file of workflow state data.
Templates=========
Templates should be placed in an ``tasks/`` folder at the root of one of yourtemplate search paths.
task_list.html--------------
:context: ``group``, ``group_base``, ``group_by``, ``gbqs``, ``is_member``, ``task_filter``, ``tasks``, ``querystring``
add.html--------
:context: ``group``, ``group_base``, ``is_member``, ``task_form``
task.html---------
:context: ``group``, ``group_base``, ``nudge``, ``task``, ``is_member``, ``form``
user_tasks.html---------------
http://pinaxproject.com/docs/dev/_sources/apps/tasks/reference.txt (4 of 7) [12/8/10 1:44:36 AM]
http://pinaxproject.com/docs/dev/_sources/apps/tasks/reference.txt
:context: ``group``, ``group_base``, ``assigned_filter``, ``created_filter``, ``nudged_filter``, ``assigned_tasks``, ``created_tasks``, ``nudged_tasks``, ``other_user``, ``bookmarklet``
mini_list.html--------------
:context: ``group``, ``group_base``, ``assigned_tasks``
focus.html----------
:context: ``group``, ``group_base``, ``task_filter``, ``tasks``, ``field``, ``value``, ``group_by``, ``gbqs``, ``is_member``
tasks_history_list.html-----------------------
:context: ``group``, ``group_base``, ``task_history``, ``is_member``
task_history.html-----------------
:context: ``group``, ``group_base``, ``task_history``, ``task``, ``nudge_history``
Modules=======
``pinax.apps.tasks.admin``--------------------------
.. automodule:: pinax.apps.tasks.admin :members: :undoc-members:
``pinax.apps.tasks.feeds``--------------------------
.. automodule:: pinax.apps.tasks.feeds :members:
http://pinaxproject.com/docs/dev/_sources/apps/tasks/reference.txt (5 of 7) [12/8/10 1:44:36 AM]
http://pinaxproject.com/docs/dev/_sources/apps/tasks/reference.txt
:undoc-members:
``pinax.apps.tasks.fields``---------------------------
.. automodule:: pinax.apps.tasks.fields :members: :undoc-members:
``pinax.apps.tasks.filters``----------------------------
.. automodule:: pinax.apps.tasks.filters :members: :undoc-members:
``pinax.apps.tasks.forms``--------------------------
.. automodule:: pinax.apps.tasks.forms :members: :undoc-members:
``pinax.apps.tasks.models``---------------------------
.. automodule:: pinax.apps.tasks.models :members: :undoc-members:
``pinax.apps.tasks.templatetags.tasks_tags``--------------------------------------------
.. automodule:: pinax.apps.tasks.templatetags.tasks_tags :members: :undoc-members:
``pinax.apps.tasks.views``--------------------------
http://pinaxproject.com/docs/dev/_sources/apps/tasks/reference.txt (6 of 7) [12/8/10 1:44:36 AM]
http://pinaxproject.com/docs/dev/_sources/apps/tasks/reference.txt
.. automodule:: pinax.apps.tasks.views :members: :undoc-members:
``pinax.apps.tasks.widgets``----------------------------
.. automodule:: pinax.apps.tasks.widgets :members: :undoc-members:
``pinax.apps.tasks.workflow``-----------------------------
.. automodule:: pinax.apps.tasks.workflow :members: :undoc-members:
http://pinaxproject.com/docs/dev/_sources/apps/tasks/reference.txt (7 of 7) [12/8/10 1:44:36 AM]
http://pinaxproject.com/docs/dev/_sources/apps/threadedcomments_extras/index.txt
.. _ref-pinax.apps.threadedcomments_extras-index:
======================================``pinax.apps.threadedcomments_extras``======================================
An app that provides ``{% comments object %}`` template tag for``threadedcomments``.
.. toctree:: :maxdepth: 3
gettingstarted reference
http://pinaxproject.com/docs/dev/_sources/apps/threadedcomments_extras/index.txt [12/8/10 1:44:39 AM]
http://pinaxproject.com/docs/dev/_sources/apps/threadedcomments_extras/gettingstarted.txt
.. _ref-threadedcomments_extras-gettingstarted:
===============Getting started===============
This document is designed to get you up and running with the``pinax.apps.threadedcomments_extras``...
Prerequisites=============
These are the requirements to run ``pinax.apps.threadedcomments_extras``:
* Python **2.4+** (Python 3.x is **not** supported yet) * Django **1.2+**
These dependencies should be added to your ``requirements/project.txt`` fileand installed using pip_. For example::
pip install -r requirements/project.txt
Installation============
Add ``pinax.apps.threadedcomments_extras`` to your ``INSTALLED_APPS``:
.. code-block:: python
INSTALLED_APPS = [ # ... "pinax.apps.threadedcomments_extras", ]
.. _ref-autocomplete_app-gettingstarted-usage:
Usage=====
http://pinaxproject.com/docs/dev/_sources/apps/threadedcomments_extras/gettingstarted.txt (1 of 2) [12/8/10 1:44:42 AM]
http://pinaxproject.com/docs/dev/_sources/apps/threadedcomments_extras/gettingstarted.txt
After installing this app in your Django project, you now have access to easilyadd comments for a particular object in one of your templates.
Simple, load the template tag and call it within your template.
.. code-block:: html
{% load comments_tag %} {% comments post %}
.. _pip: http://pip.openplans.org/
http://pinaxproject.com/docs/dev/_sources/apps/threadedcomments_extras/gettingstarted.txt (2 of 2) [12/8/10 1:44:42 AM]
http://pinaxproject.com/docs/dev/_sources/apps/threadedcomments_extras/reference.txt
.. _ref-threadedcomments_extras-reference:
=========Reference=========
This document covers various components of``pinax.apps.threadedcomments_extras``.
Templates=========
threadedcomments/comments.html------------------------------
Used by the template tag to render a chunk of HTML where the ``object``,``request``, and ``user`` objects are in context.
Modules=======
``pinax.apps.threadedcomments_extras.templatetags.comments_tag``----------------------------------------------------------------
.. automodule:: pinax.apps.threadedcomments_extras.templatetags.comments_tag :members: :undoc-members:
http://pinaxproject.com/docs/dev/_sources/apps/threadedcomments_extras/reference.txt [12/8/10 1:44:45 AM]
http://pinaxproject.com/docs/dev/_sources/apps/topics/index.txt
.. _ref-pinax.apps.topics-index:
=====================``pinax.apps.topics``=====================
Topics are essentially a title and description for any arbitrary model instancein the project. This app allows you to create/edit/delete/view ``Topis``.
.. toctree:: :maxdepth: 3
gettingstarted reference
http://pinaxproject.com/docs/dev/_sources/apps/topics/index.txt [12/8/10 1:44:49 AM]
http://pinaxproject.com/docs/dev/_sources/apps/topics/gettingstarted.txt
.. _ref-topics-gettingstarted:
===============Getting started===============
This document is designed to get you up and running with``pinax.apps.topics``...
Prerequisites=============
These are the requirements to run ``pinax.apps.account``:
* Python **2.4+** (Python 3.x is **not** supported yet) * Django **1.2+** * django-tagging * django-threadedcomments
These dependencies should be added to your ``requirements/project.txt`` fileand installed using `pip`_. For example::
pip install -r requirements/project.txt
Installation============
Add ``pinax.apps.topics`` to your ``INSTALLED_APPS``:
.. code-block:: python
INSTALLED_APPS = [ # ... "pinax.apps.topics", ]
Hook up ``pinax.apps.topics`` to your URLconf:
.. code-block:: python
http://pinaxproject.com/docs/dev/_sources/apps/topics/gettingstarted.txt (1 of 2) [12/8/10 1:44:52 AM]
http://pinaxproject.com/docs/dev/_sources/apps/topics/gettingstarted.txt
urlpatterns = patterns("", # ... url(r"^topics/", include("pinax.apps.topics.urls")) )
.. _pip: http://pip.openplans.org/
http://pinaxproject.com/docs/dev/_sources/apps/topics/gettingstarted.txt (2 of 2) [12/8/10 1:44:52 AM]
http://pinaxproject.com/docs/dev/_sources/apps/topics/reference.txt
.. _ref-topics-reference:
=========Reference=========
This document covers various components of ``pinax.apps.topics``.
Named URLs==========
The named URLs in this app should enable the use of of the ``{% url %}``template tag as well as ``reverse`` lookups in your project code without havingto know the implementation details of this app.
topic_list----------
On ``GET`` requests, render the `topics.html`_ template with a list oftopics as well as a ``pinax.apps.topics.forms.TopicForm`` instance.
On ``POST`` requests, process the form data to create a new ``Topic``
topic_edit----------
On ``POST`` requests, update the ``Topic.body`` data and redirect to `topic_detail`_.
:keyword arguments: The of the Topic to edit. Must match ``(?P<topic_id>\d+)``.
topic_delete------------
On ``POST`` requests, delete the ``Topic`` and ``ThreadedComments`` associatedwith it and redirect to the ``next`` context variable..
:keyword arguments: The of the Topic to delete. Must match ``(?P<topic_id>\d+)``.
http://pinaxproject.com/docs/dev/_sources/apps/topics/reference.txt (1 of 3) [12/8/10 1:44:55 AM]
http://pinaxproject.com/docs/dev/_sources/apps/topics/reference.txt
topic_detail------------
On ``GET`` requests, fetch the Topic as render the `topic.html`_ template withthe ``Topic`` object in context.
:keyword arguments: The of the Topic to display. Must match ``(?P<topic_id>\d+)``.
Templates=========
Templates should be placed in an ``topics/`` folder at the root of one of yourtemplate search paths.
topic.html----------
:context: ``group``, ``group_base``, ``topic``, ``edit``
topics.html-----------
:context: ``group``, ``group_base``, ``topics``, ``topic_form``, ``is_member``
Modules=======
``pinax.apps.topics.admin``----------------------------
.. automodule:: pinax.apps.topics.admin :members: :undoc-members:
http://pinaxproject.com/docs/dev/_sources/apps/topics/reference.txt (2 of 3) [12/8/10 1:44:55 AM]
http://pinaxproject.com/docs/dev/_sources/apps/topics/reference.txt
``pinax.apps.topics.forms``----------------------------
.. automodule:: pinax.apps.topics.forms :members: :undoc-members:
``pinax.apps.topics.models``-----------------------------
.. automodule:: pinax.apps.topics.models :members: :undoc-members:
``pinax.apps.topics.templatetags.topics_tags``----------------------------------------------
.. automodule:: pinax.apps.topics.templatetags.topics_tags :members: :undoc-members:
``pinax.apps.topics.views``---------------------------
.. automodule:: pinax.apps.topics.views :members: :undoc-members:
http://pinaxproject.com/docs/dev/_sources/apps/topics/reference.txt (3 of 3) [12/8/10 1:44:55 AM]
http://pinaxproject.com/docs/dev/_sources/apps/tribes/index.txt
.. _ref-pinax.apps.tribes-index:
=====================``pinax.apps.tribes``=====================
An app that provides functionality for creating and maintaining groups ofpeople.
.. toctree:: :maxdepth: 3
gettingstarted reference
http://pinaxproject.com/docs/dev/_sources/apps/tribes/index.txt [12/8/10 1:44:58 AM]
http://pinaxproject.com/docs/dev/_sources/apps/tribes/gettingstarted.txt
.. _ref-tribes-gettingstarted:
===============Getting started===============
This document is designed to get you up and running with``pinax.apps.tribes``...
Prerequisites=============
These are the requirements to run ``pinax.apps.tribes``:
* Python **2.4+** (Python 3.x is **not** supported yet) * Django **1.2+** * django-groups **0.1.dev10**
These dependencies should be added to your ``requirements/project.txt`` fileand installed using pip_. For example::
pip install -r requirements/project.txt
Installation============
Add ``pinax.apps.tribes`` to your ``INSTALLED_APPS``:
.. code-block:: python
INSTALLED_APPS = [ # ... "pinax.apps.tribes", ]
Hook up ``pinax.apps.tribes`` to your URLconf:
.. code-block:: python
urlpatterns = patterns("",
http://pinaxproject.com/docs/dev/_sources/apps/tribes/gettingstarted.txt (1 of 2) [12/8/10 1:45:01 AM]
http://pinaxproject.com/docs/dev/_sources/apps/tribes/gettingstarted.txt
# ... url(r"^tribes/", include("pinax.apps.tribes.urls")) )
.. _pip: http://pip.openplans.org/
http://pinaxproject.com/docs/dev/_sources/apps/tribes/gettingstarted.txt (2 of 2) [12/8/10 1:45:01 AM]
http://pinaxproject.com/docs/dev/_sources/apps/tribes/reference.txt
.. _ref-tribes-reference:
=========Reference=========
This document covers various components of ``pinax.apps.tribes``.
Named URLs==========
tribe_list----------
Upon a ``GET`` request renter the `tribes.html`_ template with ``tribes`` and``search_terms`` in context. Each ``tribe`` also get a ``member_count`` and a``topic_count`` attribute assigned.
tribe_create------------
On ``GET`` requests render the `create.html`_ template with a ``tribe_form`` instance in context.
On ``POST`` requests process the form and create a new ``Tribe`` and add the``request.user`` as a member of the ``Tribe``.
your_tribes-----------
On ``GET`` requests render the `your_tribes.html`_ template with a ``tribes``queryset in context that contains all ``Tribes`` where ``request.user`` is amember.
tribe_detail
http://pinaxproject.com/docs/dev/_sources/apps/tribes/reference.txt (1 of 4) [12/8/10 1:45:04 AM]
http://pinaxproject.com/docs/dev/_sources/apps/tribes/reference.txt
------------
On ``GET`` requests render the `tribe.html`_ template with ``tribe``, ``tribe_form``,``group``, and ``is_member`` variables in context.
On ``POST`` request process that form to update the ``Tribe``, join the ``Tribe``or leave the ``Tribe``.
:keyword arguments: The slug with that identifies a a ``Topic``. Must match: ``(?P<group_slug>[-\w]+)``.
tribe_delete------------
Via a ``POST`` request, delete a ``Tribe`` that ``request.user`` createdpreviously.
:keyword arguments: The slug with that identifies a a ``Topic``. Must match: ``(?P<group_slug>[-\w]+)``.
Templates=========
Templates should be placed in an ``tribes/`` folder at the root of one of yourtemplate search paths.
create.html-----------
:context: ``tribe_form``
tribes.html-----------
:context: ``tribes``, ``search_terms``
your_tribes.html----------------
:context: ``tribes``
http://pinaxproject.com/docs/dev/_sources/apps/tribes/reference.txt (2 of 4) [12/8/10 1:45:04 AM]
http://pinaxproject.com/docs/dev/_sources/apps/tribes/reference.txt
tribe.html----------
:context: ``group``, ``tribe``, ``tribe_form``, ``is_member``
Modules=======
``pinax.apps.tribes.admin``---------------------------
.. automodule:: pinax.apps.tribes.admin :members: :undoc-members:
``pinax.apps.tribes.forms``---------------------------
.. automodule:: pinax.apps.tribes.forms :members: :undoc-members:
``pinax.apps.tribes.models``----------------------------
.. automodule:: pinax.apps.tribes.models :members: :undoc-members:
``pinax.apps.tribes.templatetags.tribes_tags``----------------------------------------------
.. automodule:: pinax.apps.tribes.templatetags.tribes_tags :members: :undoc-members:
http://pinaxproject.com/docs/dev/_sources/apps/tribes/reference.txt (3 of 4) [12/8/10 1:45:04 AM]
http://pinaxproject.com/docs/dev/_sources/apps/tribes/reference.txt
``pinax.apps.tribes.views``---------------------------
.. automodule:: pinax.apps.tribes.views :members: :undoc-members:
http://pinaxproject.com/docs/dev/_sources/apps/tribes/reference.txt (4 of 4) [12/8/10 1:45:04 AM]
http://pinaxproject.com/docs/dev/_sources/apps/voting_extras/index.txt
.. _ref-pinax.apps.voting_extras-index:
============================``pinax.apps.voting_extras``============================
Provides some template tags for ``django-voting``.
.. toctree:: :maxdepth: 3
gettingstarted reference
http://pinaxproject.com/docs/dev/_sources/apps/voting_extras/index.txt [12/8/10 1:45:07 AM]
http://pinaxproject.com/docs/dev/_sources/apps/voting_extras/gettingstarted.txt
.. _ref-voting_extras-gettingstarted: =============== Getting started =============== This document is designed to get you up and running with the ``pinax.apps.voting_extras``... Prerequisites ============= These are the requirements to run ``pinax.apps.voting_extras``: * Python **2.4+** (Python 3.x is **not** supported yet) * Django **1.2+** * django-voting **0.1** These dependencies should be added to your ``requirements/project.txt`` file and installed using pip_. For example:: pip install -r requirements/project.txt Installation ============ Add ``pinax.apps.voting_extras`` to your ``INSTALLED_APPS``: .. code-block:: python INSTALLED_APPS = [ # ... "voting", "pinax.apps.voting_extras", ] .. _ref-voting_extras-gettingstarted-usage: Usage ===== After installing this app in your Django project, you now have access to easily add comments for a particular object in one of your templates. Simple, load the template tag and call it within your template. .. code-block:: html {% load extra_voting_tags %} {% order_by_votes my_object_list %} {% order_by_reddit my_object_list date_field_name %} {% for obj in my_object_list %} ... {% endfor %} .. _pip: http://pip.openplans.org/
http://pinaxproject.com/docs/dev/_sources/apps/voting_extras/gettingstarted.txt [12/8/10 1:45:11 AM]
http://pinaxproject.com/docs/dev/_sources/apps/voting_extras/reference.txt
.. _ref-voting_extras-reference:
=========Reference=========
This document covers various components of ``pinax.apps.voting_extras``.
Modules=======
``pinax.apps.voting_extras.templatetags.extra_voting_tags``-----------------------------------------------------------
.. automodule:: pinax.apps.voting_extras.templatetags.extra_voting_tags :members: :undoc-members:
http://pinaxproject.com/docs/dev/_sources/apps/voting_extras/reference.txt [12/8/10 1:45:14 AM]
http://pinaxproject.com/docs/dev/_sources/apps/waitinglist/index.txt
.. _ref-pinax.apps.waitinglist-index:
==========================``pinax.apps.waitinglist``==========================
A simple app to provide waiting list functionality to your project.
.. toctree:: :maxdepth: 3
gettingstarted reference
http://pinaxproject.com/docs/dev/_sources/apps/waitinglist/index.txt [12/8/10 1:45:17 AM]
http://pinaxproject.com/docs/dev/_sources/apps/waitinglist/gettingstarted.txt
.. _ref-waitinglist-gettingstarted:
===============Getting started===============
This document is designed to get you up and running with``pinax.apps.waitinglist``...
Prerequisites=============
These are the requirements to run ``pinax.apps.waitinglist``:
* Python **2.4+** (Python 3.x is **not** supported yet) * Django **1.2+**
These dependencies should be added to your ``requirements/project.txt`` fileand installed using pip_. For example::
pip install -r requirements/project.txt
Installation============
Add ``pinax.apps.waitinglist`` to your ``INSTALLED_APPS``:
.. code-block:: python
INSTALLED_APPS = [ # ... "pinax.apps.waitinglist", ]
Hook up ``pinax.apps.waitinglist`` to your URLconf:
.. code-block:: python
urlpatterns = patterns("", # ...
http://pinaxproject.com/docs/dev/_sources/apps/waitinglist/gettingstarted.txt (1 of 2) [12/8/10 1:45:20 AM]
http://pinaxproject.com/docs/dev/_sources/apps/waitinglist/gettingstarted.txt
url(r"^waitinglist/", include("pinax.apps.waitinglist.urls")) )
.. _pip: http://pip.openplans.org/
http://pinaxproject.com/docs/dev/_sources/apps/waitinglist/gettingstarted.txt (2 of 2) [12/8/10 1:45:20 AM]
http://pinaxproject.com/docs/dev/_sources/apps/waitinglist/reference.txt
.. _ref-waitinglist-reference:
=========Reference=========
This document covers various components of ``pinax.apps.waitinglist``.
Named URLs==========
The named URLs in this app should enable the use of of the ``{% url %}``template tag as well as ``reverse`` lookups in your project code without havingto know the implementation details of this app.
waitinglist_list_signup-----------------------
On ``GET`` request, render the `list_signup.html`_ template with a form instancefrom ``pinax.apps.waitinglist.forms.WaitingListEntryForm`` in context.
On ``POST`` request, process the the form. Then redirect to `waitinglist_success`_.
waitinglist_success-------------------
Renders a ``direct_to_template`` template, `success.html`_.
Templates=========
Templates should be placed in an ``waitinglist/`` folder at the root of one ofyour template search paths.
list_signup.html----------------
http://pinaxproject.com/docs/dev/_sources/apps/waitinglist/reference.txt (1 of 3) [12/8/10 1:45:23 AM]
http://pinaxproject.com/docs/dev/_sources/apps/waitinglist/reference.txt
:context: ``form``
success.html------------
No context. Just a plain HTML template.
Modules=======
``pinax.apps.waitinglist.admin``--------------------------------
.. automodule:: pinax.apps.waitinglist.admin :members: :undoc-members:
``pinax.apps.waitinglist.forms``--------------------------------
.. automodule:: pinax.apps.waitinglist.forms :members: :undoc-members:
``pinax.apps.waitinglist.models``----------------------------------
.. automodule:: pinax.apps.waitinglist.models :members: :undoc-members:
``pinax.apps.waitinglist.templatetags.waitinglist_tags``--------------------------------------------------------
.. automodule:: pinax.apps.waitinglist.templatetags.waitinglist_tags
http://pinaxproject.com/docs/dev/_sources/apps/waitinglist/reference.txt (2 of 3) [12/8/10 1:45:23 AM]
http://pinaxproject.com/docs/dev/_sources/apps/waitinglist/reference.txt
:members: :undoc-members:
``pinax.apps.waitinglist.views``--------------------------------
.. automodule:: pinax.apps.waitinglist.views :members: :undoc-members:
http://pinaxproject.com/docs/dev/_sources/apps/waitinglist/reference.txt (3 of 3) [12/8/10 1:45:23 AM]
http://pinaxproject.com/docs/dev/_sources/releases/0.5.1.txt
.. _ref-current-release-notes:
0.5.1=====
The 0.5.1 release brings various bug fixes and more stability to Pinax. We have fixed somebugs and improved the documentation. This release should be backward compatible, exceptwhere noted.
Python 2.4 support------------------
0.5.1 brings Python 2.4 compatibility. There are still many distributions out there thathave Python 2.4 as the default Python version.
Removal of Pownce support-------------------------
Pownce closed their doors on December 15, 2008 after being bought by Six Apart. There is nolonger any reason we should support Pownce.
You may need to remove some Pownce bits from your templates if you forked from the``complete_project`` locally.
Various bug-fixes-----------------
* r1292_ Fixed a bug in django_openidconsumer that prevented login on some deployments* r1288_ Removed an import that was never used in ``profiles/views.py``.* r1283_ `Issue #131`_ Added a missing datetime import in ``apps/local_apps/projects/forms.py``.* r1266_ Fixed a typo of ``ValidationError`` in ``apps/local_apps/account/forms.py``.* r1215_ `Issue #119`_ Added a missing import in ``apps/local_apps/misc/utils.py``.* r1193_ Added the about app to the basic_project ``INSTALLED_APPS`` list.
.. _r1292: http://code.pinaxproject.com/codebases/codebase/pinax/changesets/1292/
.. _r1288: http://code.pinaxproject.com/codebases/codebase/pinax/changesets/1288/
.. _r1283: http://code.pinaxproject.com/codebases/codebase/pinax/changesets/1283/
.. _r1266: http://code.pinaxproject.com/codebases/codebase/pinax/changesets/1266/
http://pinaxproject.com/docs/dev/_sources/releases/0.5.1.txt (1 of 2) [12/8/10 1:45:27 AM]
http://pinaxproject.com/docs/dev/_sources/releases/0.5.1.txt
.. _r1215: http://code.pinaxproject.com/codebases/codebase/pinax/changesets/1215/
.. _r1193: http://code.pinaxproject.com/codebases/codebase/pinax/changesets/1193/
.. _`Issue #131`: http://code.google.com/p/django-hotclub/issues/detail?id=131
.. _`Issue #119`: http://code.google.com/p/django-hotclub/issues/detail?id=119
http://pinaxproject.com/docs/dev/_sources/releases/0.5.1.txt (2 of 2) [12/8/10 1:45:27 AM]
http://pinaxproject.com/docs/dev/_sources/releases/index.txt
.. _ref-release-notes:
Pinax Release Notes===================
.. toctree:: :maxdepth: 1
0.5.1
http://pinaxproject.com/docs/dev/_sources/releases/index.txt [12/8/10 1:45:30 AM]