Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Cleaning up a bunch of hard coded urls to make site development easier.

  • Loading branch information...
commit d07d2c5f07c3052bfe751d5b64fc02c18bfd5c0d 1 parent 984d1e4
@justinabrahms justinabrahms authored
View
2  django_website/apps/blog/urls.py
@@ -11,5 +11,5 @@
(r'^(?P<year>\d{4})/(?P<month>[a-z]{3})/(?P<day>\w{1,2})/$', 'archive_day', info_dict),
(r'^(?P<year>\d{4})/(?P<month>[a-z]{3})/$', 'archive_month', info_dict),
(r'^(?P<year>\d{4})/$', 'archive_year', info_dict),
- (r'^/?$', 'archive_index', info_dict),
+ url(r'^/?$', 'archive_index', info_dict, name="blog-index"),
)
View
2  django_website/apps/docs/urls.py
@@ -1,7 +1,7 @@
from django.conf.urls.defaults import *
urlpatterns = patterns('django_website.apps.docs.views',
- (r'^$', 'doc_index'),
+ url(r'^$', 'doc_index', name="doc_index"),
(r'^(?P<version>[\d.]+)/$', 'doc_index'),
(r'^models/$', 'model_index'),
(r'^models/(?P<slug>\w+)/$', 'model_detail'),
View
12 django_website/templates/base.html
@@ -24,13 +24,13 @@
<div id="container">
<div id="header">
- <h1 id="logo"><a href="http://www.djangoproject.com/"><img src="{{ MEDIA_URL }}img/site/hdr_logo.gif" alt="Django" /></a></h1>
+ <h1 id="logo"><a href="{% url homepage %}"><img src="{{ MEDIA_URL }}img/site/hdr_logo.gif" alt="Django" /></a></h1>
<ul id="nav-global">
- <li id="nav-homepage"><a href="http://www.djangoproject.com/">Home</a></li>
- <li id="nav-download"><a href="http://www.djangoproject.com/download/">Download</a></li>
- <li id="nav-documentation"><a href="http://docs.djangoproject.com/">Documentation</a></li>
- <li id="nav-weblog"><a href="http://www.djangoproject.com/weblog/">Weblog</a></li>
- <li id="nav-community"><a href="http://www.djangoproject.com/community/">Community</a></li>
+ <li id="nav-homepage"><a href="{% url homepage %}">Home</a></li>
+ <li id="nav-download"><a href="{% url download %}">Download</a></li>
+ <li id="nav-documentation"><a href="{% url doc_index %}">Documentation</a></li>
+ <li id="nav-weblog"><a href="{% url blog-index %}">Weblog</a></li>
+ <li id="nav-community"><a href="{% url community-index %}">Community</a></li>
<li id="nav-code"><a href="http://code.djangoproject.com/">Code</a></li>
</ul>
</div>
View
3  django_website/urls.py
@@ -32,7 +32,7 @@
}
urlpatterns = patterns('',
- (r'^$', 'django.views.generic.simple.direct_to_template', {'template': 'homepage.html'}),
+ url(r'^$', 'django.views.generic.simple.direct_to_template', {'template': 'homepage.html'}, name="homepage"),
(r'^accounts/', include('django_website.apps.accounts.urls')),
(r'^admin/(.*)', admin.site.root),
(r'^comments/$', 'django.views.generic.list_detail.object_list', comments_info_dict),
@@ -54,6 +54,7 @@
(r'^sitemap\.xml$', cache_page(sitemap_views.sitemap, 60 * 60 * 6), {'sitemaps': sitemaps}),
(r'^weblog/', include('django_website.apps.blog.urls')),
(r'^freenode\.9xJY7YIUWtwn\.html$', 'django.views.generic.simple.direct_to_template', {'template': 'freenode_tmp.html'}),
+ url(r'^download$', 'django.contrib.flatpages.views.flatpage', {'url': 'download'}, name="download"),
)
if settings.DEVELOPMENT_MODE:
Please sign in to comment.
Something went wrong with that request. Please try again.