Source

freehg / urls.py

Full commit
from django.conf.urls.defaults import *

from django.views.generic.simple import direct_to_template
from django.views.generic import list_detail

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

from freehg.repos.models import Repo

repo_info = {
    "queryset" : Repo.objects.all(),
    "template_name": "repositories.html",
}


urlpatterns = patterns('',
    # Example:
    #(r'^freehg/', include('freehg.foo.urls')),
    (r'^$', 'freehg.repos.views.frontpage'),
    (r'^accounts/login/$', 'django.contrib.auth.views.login'),
    (r'^accounts/logout/$', 'django.contrib.auth.views.logout', {'next_page': '/'}),
    (r'^accounts/profile/$', 'freehg.accountviews.profile'),
    (r'^accounts/change_password/$',
            'django.contrib.auth.views.password_change'),
    (r'^accounts/change_password/done/$',
            'django.contrib.auth.views.password_change_done'),

    (r'^tos/', direct_to_template, {'template':'tos.html'}),
    (r'^about/', direct_to_template, {'template':'about.html'}),
    (r'^faq/', direct_to_template, {'template':'faq.html'}),
    (r'^workflow/', direct_to_template, {'template':'workflow.html'}),

    url(r'^u/(?P<username>\w(\w|-|\.)+\w)/(?P<reponame>\w(\w|-|\.)+\w)/$',
      'freehg.repos.views.summary', name="repo_summary"),
      
    url(r'^u/(?P<username>\w(\w|-|\.)+\w)/(?P<reponame>\w(\w|-|\.)+\w)/fork$',
      'freehg.repos.views.fork_repo', name="fork_repo"),
      
    (r'^u/(?P<username>\w(\w|-|\.)+\w)/(?P<reponame>\w(\w|-|\.)+\w)/edit/$',
            'freehg.repos.views.edit_repo'),
    (r'^u/(?P<username>\w(\w|-|\.)+\w)/(?P<reponame>\w(\w|-|\.)+\w)/delete/$',
            'freehg.repos.views.delete_repo'),
    (r'^repo_deleted/$', direct_to_template, {'template':'repos/deleted.html'}),

    (r'^u/$', 'freehg.views.user_list'),
    (r'^u/(?P<username>\w(\w|-|\.)+\w)/$', 'freehg.views.user_detail'),
    (r'^repositories/$', list_detail.object_list, repo_info),

    # Uncomment this for admin:
    (r'^admin/', include(admin.site.urls)),
)

from django.conf import settings
if settings.DEBUG:
    urlpatterns += patterns('',
            (r'^static/(?P<path>.*)$', 'django.views.static.serve', 
             {'document_root': 'htdocs/static'}),)

#from freehg.htpasswdutils import monkeypatch_user_model
#monkeypatch_user_model()