Ticket #30091: min_example.diff

File min_example.diff, 1.5 KB (added by Mark Gregson, 6 years ago)

Patch to create minimal project reproducing the bug

  • mysite/settings.py

    diff --git a/mysite/settings.py b/mysite/settings.py
    index 1fa9bff..a4bef25 100644
    a b BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))  
    2323SECRET_KEY = '2kf%#c!qp142t*!nt!4ad@)jscuqxor2^iv8dr9oxyp$+@(bqa'
    2424
    2525# SECURITY WARNING: don't run with debug turned on in production!
    26 DEBUG = True
     26DEBUG = False
    2727
    28 ALLOWED_HOSTS = []
     28ALLOWED_HOSTS = ['localhost']
    2929
    3030
    3131# Application definition
    INSTALLED_APPS = [  
    4141
    4242MIDDLEWARE = [
    4343    'django.middleware.security.SecurityMiddleware',
    44     'django.contrib.sessions.middleware.SessionMiddleware',
    4544    'django.middleware.common.CommonMiddleware',
     45    'django.contrib.sessions.middleware.SessionMiddleware',
    4646    'django.middleware.csrf.CsrfViewMiddleware',
    4747    'django.contrib.auth.middleware.AuthenticationMiddleware',
    4848    'django.contrib.messages.middleware.MessageMiddleware',
    4949    'django.middleware.clickjacking.XFrameOptionsMiddleware',
    5050]
    5151
     52CSRF_USE_SESSIONS = True
     53
    5254ROOT_URLCONF = 'mysite.urls'
    5355
    5456TEMPLATES = [
  • mysite/urls.py

    diff --git a/mysite/urls.py b/mysite/urls.py
    index b58234f..ea341cf 100644
    a b Including another URLconf  
    1515"""
    1616from django.conf.urls import url
    1717from django.contrib import admin
     18from django.http import HttpResponse
     19
     20
     21def home(request):
     22    return HttpResponse('Hello world!')
     23
    1824
    1925urlpatterns = [
    2026    url(r'^admin/', admin.site.urls),
     27    url(r'^$', home, name='home')
    2128]
Back to Top