<commit_before>from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from django.contrib.staticfiles.views import serve
from rest_framework.routers import DefaultRouter

from quickly.buttons.api.view import ButtonViewSet
from quickly.schedules.api.view import SchedulesViewSet
from quickly.services.api.view import ServiceViewSet
from quickly.families.api.view import FamilyViewSet

from quickly.panic.api.views import Panic

# Define routes, using the default router so the API is browsable.
router = DefaultRouter(trailing_slash=False)
router.register(r'/schedules', SchedulesViewSet)
router.register(r'/services', ServiceViewSet)
router.register(r'/buttons', ButtonViewSet)
router.register(r'/families', FamilyViewSet)

urlpatterns = [
    # / routes to index.html
    url(r'^$', serve,
        kwargs={'path': 'index.html'}),

    url(r'^admin', include(admin.site.urls)),
    url(r'^api/panic/$', Panic.as_view()),
    url(r'^api', include(router.urls)),
    url(r'^.*', serve, kwargs={'path': 'index.html'}),
]

if settings.DEBUG and settings.MEDIA_ROOT:
    urlpatterns += static(settings.MEDIA_URL,
                          document_root=settings.MEDIA_ROOT)<commit_msg>added csrf exempt<commit_after>from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from django.contrib.staticfiles.views import serve
from django.views.decorators.csrf import csrf_exempt
from rest_framework.routers import DefaultRouter

from quickly.buttons.api.view import ButtonViewSet
from quickly.schedules.api.view import SchedulesViewSet
from quickly.services.api.view import ServiceViewSet
from quickly.families.api.view import FamilyViewSet

from quickly.panic.api.views import Panic

# Define routes, using the default router so the API is browsable.
router = DefaultRouter(trailing_slash=False)
router.register(r'/schedules', SchedulesViewSet)
router.register(r'/services', ServiceViewSet)
router.register(r'/buttons', ButtonViewSet)
router.register(r'/families', FamilyViewSet)

urlpatterns = [
    # / routes to index.html
    url(r'^$', serve,
        kwargs={'path': 'index.html'}),

    url(r'^admin', include(admin.site.urls)),
    url(r'^api/panic/$', csrf_exempt(Panic.as_view())),
    url(r'^api', include(router.urls)),
    url(r'^.*', serve, kwargs={'path': 'index.html'}),
]

if settings.DEBUG and settings.MEDIA_ROOT:
    urlpatterns += static(settings.MEDIA_URL,
                          document_root=settings.MEDIA_ROOT)
{'fraction_non_alphanumeric': 0.11861174675819985, 'fraction_numerical': 0.0, 'mean_word_length': 4.9343891402714934, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2797263', 'n_tokens_mistral': 799, 'n_tokens_neox': 781, 'n_words': 187}