<commit_before># This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

from django.conf.urls.defaults import *
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.conf import settings
from django.http import HttpResponse
import base64
import re


from funfactory.monkeypatches import patch
patch()

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

## Monkeypatches:
## Here's the ideal place to put them if you need to monkeypatches anything
## during Django's start-up.
## ...

urlpatterns = patterns('',
    # Example:
    # (r'^dashboard/', include('dashboard.foo.urls')),
                       (r'^privacy/', include('privacy.urls')),
                       (r'.*/__history__.html$', lambda r: HttpResponse()),
                       (r'^builds/',
                        include('tinder.urls')),
                       (r'^source/', include('pushes.urls')),
                       (r'^dashboard/', include('l10nstats.urls')),
                       (r'^shipping',
                            include('shipping.urls')),
                       (r'^bugs/',
                            include('bugsy.urls')),
                       (r'^webby/',
                            include('webby.urls')),
                       (r'^accounts/',
                            include('accounts.urls')),
                       (r'^',
                        include('homepage.urls')),

    # Uncomment the admin/doc line below and add 'django.contrib.admindocs'
    # to INSTALLED_APPS to enable admin documentation:
    # (r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    (r'^admin/', include(admin.site.urls)),
)

handler500 = 'homepage.views.handler500'

# Usually, you would include this only for DEBUG, but let's keep
# this so that we can reverse resolve static.
# That way, we can move the site to /stage/foo without messing with
# the references to /media/.

# Remove leading and trailing slashes so the regex matches.
# TODO: consider subclassing django.views.static.serve with something
# that prints a warning message
static_url = settings.STATIC_URL.lstrip('/').rstrip('/')
urlpatterns += patterns('',
    url(r'^%s/(?P<path>.*)$' % static_url, 'django.views.static.serve',
     {'document_root': settings.STATIC_ROOT},
     'static'),
)

#if settings.DEBUG:
urlpatterns += staticfiles_urlpatterns()
<commit_msg>fixes bug 856165 - x-frame-options for __history__, r=Pike<commit_after># This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

from django.conf.urls.defaults import *
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.conf import settings
from django.http import HttpResponse
import base64
import re


from funfactory.monkeypatches import patch
patch()

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

## Monkeypatches:
## Here's the ideal place to put them if you need to monkeypatches anything
## during Django's start-up.
## ...


def simple_x_frame_view(request):
    response = HttpResponse()
    response['X-Frame-Options'] = 'SAMEORIGIN'
    return response


urlpatterns = patterns('',
    # Example:
    # (r'^dashboard/', include('dashboard.foo.urls')),
                       (r'^privacy/', include('privacy.urls')),
                       (r'.*/__history__.html$', simple_x_frame_view),
                       (r'^builds/',
                        include('tinder.urls')),
                       (r'^source/', include('pushes.urls')),
                       (r'^dashboard/', include('l10nstats.urls')),
                       (r'^shipping',
                            include('shipping.urls')),
                       (r'^bugs/',
                            include('bugsy.urls')),
                       (r'^webby/',
                            include('webby.urls')),
                       (r'^accounts/',
                            include('accounts.urls')),
                       (r'^',
                        include('homepage.urls')),

    # Uncomment the admin/doc line below and add 'django.contrib.admindocs'
    # to INSTALLED_APPS to enable admin documentation:
    # (r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    (r'^admin/', include(admin.site.urls)),
)


handler500 = 'homepage.views.handler500'

# Usually, you would include this only for DEBUG, but let's keep
# this so that we can reverse resolve static.
# That way, we can move the site to /stage/foo without messing with
# the references to /media/.

# Remove leading and trailing slashes so the regex matches.
# TODO: consider subclassing django.views.static.serve with something
# that prints a warning message
static_url = settings.STATIC_URL.lstrip('/').rstrip('/')
urlpatterns += patterns('',
    url(r'^%s/(?P<path>.*)$' % static_url, 'django.views.static.serve',
     {'document_root': settings.STATIC_ROOT},
     'static'),
)

#if settings.DEBUG:
urlpatterns += staticfiles_urlpatterns()

{'fraction_non_alphanumeric': 0.12659870250231697, 'fraction_numerical': 0.006302131603336422, 'mean_word_length': 2.4130297280202404, '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': '2023986', 'n_tokens_mistral': 1595, 'n_tokens_neox': 1517, 'n_words': 440}