Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[djangoproject.com] Fixed #9246 - fixed some URLs.

git-svn-id: http://code.djangoproject.com/svn/djangoproject.com@9111 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 1b52f178179e7e163fba26fc84f522b1f8f17975 1 parent 89e6747
jacob authored
Showing with 14 additions and 8 deletions.
  1. +8 −0 djangodocs/urls.py
  2. +6 −8 djangodocs/views.py
View
8 djangodocs/urls.py
@@ -11,8 +11,15 @@
djangodocs.views.language,
),
url(
+ r'^(?P<lang>[a-z-]+)/(?P<version>[\w.-]+)/$',
+ djangodocs.views.document,
+ {'url': ''},
+ name = 'document-index',
+ ),
+ url(
r'^(?P<lang>[a-z-]+)/(?P<version>[\w.-]+)/search/$',
djangodocs.views.search,
+ name = 'document-search',
),
url(
r'^(?P<lang>[a-z-]+)/(?P<version>[\w.-]+)/_images/(?P<path>.*)$',
@@ -25,5 +32,6 @@
url(
r'^(?P<lang>[a-z-]+)/(?P<version>[\w.-]+)/(?P<url>[\w./-]*)/$',
djangodocs.views.document,
+ name = 'document-detail',
),
)
View
14 djangodocs/views.py
@@ -10,19 +10,17 @@
def index(request):
return HttpResponseRedirect(
- urlresolvers.reverse(document, kwargs={
+ urlresolvers.reverse('document-index', kwargs={
'lang': 'en',
'version': 'dev',
- 'url': '',
})
)
def language(request, lang):
return HttpResponseRedirect(
- urlresolvers.reverse(document, kwargs={
+ urlresolvers.reverse('document-index', kwargs={
'lang': lang,
'version': 'dev',
- 'url': '',
})
)
@@ -49,8 +47,8 @@ def document(request, lang, version, url):
'doc': pickle.load(open(doc, 'rb')),
'env': pickle.load(open(docroot.child('globalcontext.pickle'), 'rb')),
'update_date': datetime.datetime.fromtimestamp(docroot.child('last_build').mtime()),
- 'home': urlresolvers.reverse(document, kwargs={'lang':lang, 'version':version, 'url':''}),
- 'search': urlresolvers.reverse(search, kwargs={'lang':lang, 'version':version}),
+ 'home': urlresolvers.reverse('document-index', kwargs={'lang':lang, 'version':version}),
+ 'search': urlresolvers.reverse('document-search', kwargs={'lang':lang, 'version':version}),
}))
def images(request, lang, version, path):
@@ -84,6 +82,6 @@ def search(request, lang, version):
'query': request.GET.get('q'),
'query_string': mutable_get.urlencode(),
'env': pickle.load(open(docroot.child('globalcontext.pickle'), 'rb')),
- 'home': urlresolvers.reverse(document, kwargs={'lang':lang, 'version':version, 'url':''}),
- 'search': urlresolvers.reverse(search, kwargs={'lang':lang, 'version':version}),
+ 'home': urlresolvers.reverse('document-index', kwargs={'lang':lang, 'version':version}),
+ 'search': urlresolvers.reverse('document-search', kwargs={'lang':lang, 'version':version}),
}))
Please sign in to comment.
Something went wrong with that request. Please try again.