1. kmdaily
  2. django-pim

Source

django-pim / sitetracker / urls.py

from django.conf.urls.defaults import patterns, url, include
from sitetracker.forms import HostingProviderForm, ServerForm, DomainForm
from sitetracker.models import HostingProvider
from sitetracker.feeds import ServerBookmarks

domain_urls = patterns('sitetracker.views',
    url(r'^$', 'domain_details', name='domain-view'),
    url(r'^update.py$', 'update_domain', {'form_class':DomainForm}, name='domain-edit'),
    url(r'^add_project.py$', 'add_project', name='domain-add-project'),
    url(r'^remove_project.py$', 'remove_project', name='domain-rm-project'),
)

server_urls = patterns('sitetracker.views',
    url(r'^$', 'server_details', name='server-view'),
    url(r'^update.py$', 'update_server', {'form_class':ServerForm}, name='server-edit'),
    url(r'^(?P<domain>[A-Za-z0-9\-\.]+)/', include(domain_urls)),
)

provider_urls = patterns('sitetracker.views',
    url(r'^$', 'details', {'queryset':HostingProvider.objects.all()}, name='hostingprovider-view'),
    url(r'^update.py$', 'update', {'form_class':HostingProviderForm}, name='hostingprovider-edit'),
    url(r'^(?P<server_slug>[\w-]+)/', include(server_urls)),
)

urlpatterns = patterns('sitetracker.views',
    url(r'^$', 'index', name='servers-home'),
    url(r'^new_hosting_provider.py$', 'create', {'form_class':HostingProviderForm}, name='hostingprovider-add'),
    url(r'^new_server.py$', 'create', {'form_class':ServerForm}, name='server-add'),
    url(r'^new_domain.py$', 'create', {'form_class':DomainForm}, name='domain-add'),
    url(r'^domains.xml$', ServerBookmarks()),
    url(r'^(?P<slug>[\w-]+)/', include(provider_urls)),
)