~justin-fathomdb/nova/justinsb-openstack-api-volumes

« back to all changes in this revision

Viewing changes to vendor/Twisted-10.0.0/doc/web/examples/users.rpy.py

  • Committer: Jesse Andrews
  • Date: 2010-05-28 06:05:26 UTC
  • Revision ID: git-v1:bf6e6e718cdc7488e2da87b21e258ccc065fe499
initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# With this, you can have an instant "community web site",
 
2
# letting your shell users publish data in secure ways.
 
3
#
 
4
# Just put this script anywhere, and /path/to/this/script/<user>/
 
5
# will publish a user's ~/public_html, and a .../<user>.twistd/
 
6
# will attempt to contact a user's personal web server.
 
7
#
 
8
# For example, if you put this at the root of the web server
 
9
# as "users.rpy", and configure --allow-ignore-ext, then
 
10
# http://example.com/users/<name>/ and http://example.com/users/<name>.twistd
 
11
# will work similarily to how they work on twistedmatrix.com
 
12
 
 
13
from twisted.web import distrib
 
14
 
 
15
resource = registry.getComponent(distrib.UserDirectory)
 
16
if not resource:
 
17
    resource = distrib.UserDirectory()
 
18
    registry.setComponent(distrib.UserDirectory, resource)