Commit 02207c48 authored by fred's avatar fred

redirect nonstop home to current day

parent e8ed4c31
from django.conf.urls import url
from .views import SomaDayArchiveView
from .views import SomaDayArchiveView, RedirectTodayView
urlpatterns = [
# Example: /2012/nov/10/
url(r'^$', RedirectTodayView.as_view()),
import datetime
from django.core.urlresolvers import reverse
from django.views.generic.base import RedirectView
from django.views.generic.dates import DayArchiveView
from .models import SomaLogLine
......@@ -7,3 +11,13 @@ class SomaDayArchiveView(DayArchiveView):
date_field = "play_timestamp"
make_object_list = True
allow_future = False
month_format = '%m'
class RedirectTodayView(RedirectView):
def get_redirect_url(self, *args, **kwargs):
today =
return reverse('archive_day', kwargs={
'year': today.year,
'month': today.month,
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment