<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.views.generic import TemplateView

from core.views import flat_page
from users.views import user_dashboard


urlpatterns = [
    url(r'^$', TemplateView.as_view(template_name="index.html"), name='index'),
    url(r'^dashboard/$', user_dashboard, name='user_dashboard'),
    url(r'^accounts/', include('users.urls')),
    url(r'^proposals/', include('proposals.urls')),
    url(r'^admin/', include(admin.site.urls)),
]

if settings.URL_PREFIX:
    urlpatterns = [
        url(r'^{prefix}'.format(prefix=settings.URL_PREFIX),
            include(urlpatterns)),
    ]

# User-uploaded files like profile pics need to be served in development
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

# Catch-all URL pattern must be put last.
urlpatterns += [
    url(r'^(?P<path>.+)/$', flat_page, name='page'),
]<commit_msg>Fix catch-all URLs with prefix<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.views.generic import TemplateView

from core.views import flat_page
from users.views import user_dashboard


urlpatterns = [
    url(r'^$', TemplateView.as_view(template_name="index.html"), name='index'),
    url(r'^dashboard/$', user_dashboard, name='user_dashboard'),
    url(r'^accounts/', include('users.urls')),
    url(r'^proposals/', include('proposals.urls')),
    url(r'^admin/', include(admin.site.urls)),
]

if settings.URL_PREFIX:
    urlpatterns = [
        url(r'^{prefix}'.format(prefix=settings.URL_PREFIX),
            include(urlpatterns)),
    ]

# User-uploaded files like profile pics need to be served in development
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

# Catch-all URL pattern must be put last.
if settings.URL_PREFIX:
    urlpatterns += [
        url(r'^{prefix}(?P<path>.+)/$'.format(prefix=settings.URL_PREFIX),
            flat_page, name='page'),
    ]
else:
    urlpatterns += [url(r'^(?P<path>.+)/$', flat_page, name='page')]
{'fraction_non_alphanumeric': 0.14664867296446243, 'fraction_numerical': 0.0, 'mean_word_length': 4.687979539641944, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, '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': '5289793', 'n_tokens_mistral': 712, 'n_tokens_neox': 712, 'n_words': 155}