<commit_before>from django.conf.urls import url, include
from django.http import HttpResponseRedirect
from django.conf import settings
from django.contrib.auth import views as auth_views
from . import views

urlpatterns = [
    # Authentication
    ## Override logout next_page
    url(r'^accounts/logout/$', auth_views.logout, {'next_page': '/'}, name='auth_logout'),
    url(r'^accounts/', include('registration.backends.hmac.urls')),

    # Backend urls
    url(r'^$', views.HomeView.as_view(), name='home'),
    url(r'^submit$', views.SubmitView.as_view(), name='submit'),
    url(r'^scores$', views.ScoreboardView.as_view(), name='scores'),
    url(r'^chals$', views.ChallengesView.as_view(), name='chals'),
    url(r'^chals/hint/(?P<buy_hint>[0-9]+)/buy', views.ChallengesView.as_view(), name='buy_hint'),
    url(r'^stats$', views.StatisticsView.as_view(), name='stats'),
]<commit_msg>Add login_required decorator to protected sites<commit_after>from django.conf.urls import url, include
from django.contrib.auth import views as auth_views
from . import views
from django.contrib.auth.decorators import login_required

urlpatterns = [
    # Authentication
    ## Override logout next_page
    url(r'^accounts/logout/$',
        auth_views.logout,
        {'next_page': '/'},
        name='auth_logout'),
    url(r'^accounts/',
        include('registration.backends.hmac.urls')),

    # Backend urls
    url(r'^$',
        views.HomeView.as_view(),
        name='home'),
    url(r'^submit$',
        login_required(views.SubmitView.as_view()),
        name='submit'),
    url(r'^scores$',
        views.ScoreboardView.as_view(),
        name='scores'),
    url(r'^chals$',
        login_required(views.ChallengesView.as_view()),
        name='chals'),
    url(r'^chals/hint/(?P<buy_hint>[0-9]+)/buy',
        login_required(views.ChallengesView.as_view()),
        name='buy_hint'),
    url(r'^stats$',
        views.StatisticsView.as_view(),
        name='stats'),
]
{'fraction_non_alphanumeric': 0.1697061803444782, 'fraction_numerical': 0.002026342451874367, 'mean_word_length': 3.876543209876543, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7429868', 'n_tokens_mistral': 678, 'n_tokens_neox': 645, 'n_words': 107}