from django.conf.urls import patterns, url

from surlex.dj import surl

from .feeds import NewspeakRSSFeed, NewspeakAtomFeed


urlpatterns = patterns('',
    # surl(r'^$', SomeView.as_view(),
    #     name='newspeak_home'
    # ),)

    # Static redirect to the RSS feed, until we have a 
    # page to show here.
    (r'^$', 'django.views.generic.simple.redirect_to',
        {'url': '/all/rss/', 'permanent': False}
    ),

    url(r'^all/rss/$', NewspeakRSSFeed(), name='rss_all'),
    url(r'^all/atom/$', NewspeakAtomFeed(), name='atom_all'),
)

from django.conf.urls import patterns, url

from django.views.generic.base import RedirectView

from surlex.dj import surl

from .feeds import NewspeakRSSFeed, NewspeakAtomFeed


urlpatterns = patterns('',
    # surl(r'^$', SomeView.as_view(),
    #     name='newspeak_home'
    # ),)

    # Static redirect to the RSS feed, until we have a
    # page to show here.
    url(r'^$', RedirectView.as_view(
        url='/all/rss/', permanent=False
    )),

    url(r'^all/rss/$', NewspeakRSSFeed(), name='rss_all'),
    url(r'^all/atom/$', NewspeakAtomFeed(), name='atom_all'),
)

Use class-based generic view for redirect.
Use class-based generic view for redirect.

Fixes #29; legacy method-based generic views are deprecated in Django.
  from django.conf.urls import patterns, url
+ 
+ from django.views.generic.base import RedirectView
  
  from surlex.dj import surl
  
  from .feeds import NewspeakRSSFeed, NewspeakAtomFeed
  
  
  urlpatterns = patterns('',
      # surl(r'^$', SomeView.as_view(),
      #     name='newspeak_home'
      # ),)
  
-     # Static redirect to the RSS feed, until we have a 
+     # Static redirect to the RSS feed, until we have a
      # page to show here.
-     (r'^$', 'django.views.generic.simple.redirect_to',
+     url(r'^$', RedirectView.as_view(
-         {'url': '/all/rss/', 'permanent': False}
+         url='/all/rss/', permanent=False
-     ),
+     )),
  
      url(r'^all/rss/$', NewspeakRSSFeed(), name='rss_all'),
      url(r'^all/atom/$', NewspeakAtomFeed(), name='atom_all'),
  )
  
Use class-based generic view for redirect.
## Code Before:
from django.conf.urls import patterns, url

from surlex.dj import surl

from .feeds import NewspeakRSSFeed, NewspeakAtomFeed


urlpatterns = patterns('',
    # surl(r'^$', SomeView.as_view(),
    #     name='newspeak_home'
    # ),)

    # Static redirect to the RSS feed, until we have a 
    # page to show here.
    (r'^$', 'django.views.generic.simple.redirect_to',
        {'url': '/all/rss/', 'permanent': False}
    ),

    url(r'^all/rss/$', NewspeakRSSFeed(), name='rss_all'),
    url(r'^all/atom/$', NewspeakAtomFeed(), name='atom_all'),
)

## Instruction:
Use class-based generic view for redirect.
## Code After:
from django.conf.urls import patterns, url

from django.views.generic.base import RedirectView

from surlex.dj import surl

from .feeds import NewspeakRSSFeed, NewspeakAtomFeed


urlpatterns = patterns('',
    # surl(r'^$', SomeView.as_view(),
    #     name='newspeak_home'
    # ),)

    # Static redirect to the RSS feed, until we have a
    # page to show here.
    url(r'^$', RedirectView.as_view(
        url='/all/rss/', permanent=False
    )),

    url(r'^all/rss/$', NewspeakRSSFeed(), name='rss_all'),
    url(r'^all/atom/$', NewspeakAtomFeed(), name='atom_all'),
)
