Ticket #29411: minimal_example.diff

File minimal_example.diff, 1.6 KB (added by Torsten Bronger, 7 years ago)

Patch to create a minimal example.

  • bug/settings.py

    diff -Naur bug/bug/settings.py bug_new/bug/settings.py
    old new  
    3737    'django.contrib.sessions',
    3838    'django.contrib.messages',
    3939    'django.contrib.staticfiles',
     40    'bug'
    4041]
    4142
    4243MIDDLEWARE = [
  • bug/templates/main.html

    diff -Naur bug/bug/templates/main.html bug_new/bug/templates/main.html
    old new  
     1{{ example_form }}
  • bug/urls.py

    diff -Naur bug/bug/urls.py bug_new/bug/urls.py
    old new  
    1515"""
    1616from django.contrib import admin
    1717from django.urls import path
     18import bug.views
    1819
    1920urlpatterns = [
    2021    path('admin/', admin.site.urls),
     22    path("", bug.views.main),
    2123]
  • bug/views.py

    diff -Naur bug/bug/views.py bug_new/bug/views.py
    old new  
     1import pickle
     2import django.forms as forms
     3from django.shortcuts import render
     4
     5
     6class ExampleForm(forms.Form):
     7    boolean_field = forms.BooleanField()
     8
     9
     10def main(request):
     11    pickle.dump(forms.Form(), open("/dev/null", "wb"))
     12    return render(request, "main.html", {"example_form": ExampleForm()})
  • manage.py

    diff -Naur bug/manage.py bug_new/manage.py
    old new  
    1 #!/usr/bin/env python
     1#!/usr/bin/env python3
    22import os
    33import sys
    44
Back to Top