There are two problems in the example code shown in the start page "Intro to Django" section:
-
Forms example shows a contact form with sender and cc_myself fields that would likely be broken or vulnerable to abuse in actual use. This example was adapted from Django's forms docs, which are being updated to avoid suggesting unsafe forms practices (see ticket-37162). Although the start page is just a code fragment, we should probably update it to match.
Current code:
class BandContactForm(forms.Form):
subject = forms.CharField(max_length=100)
message = forms.TextField()
sender = forms.EmailField()
cc_myself = forms.BooleanField(required=False)
Suggestion: rename the last two fields:
class BandContactForm(forms.Form):
subject = forms.CharField(max_length=100)
message = forms.TextField()
contact_email = forms.EmailField()
join_fan_club = forms.BooleanField(required=False)
(Or @nessita suggests just removing the example from that section.)
-
Admin example has broken code due to incorrect indentation. (Reported by Cyrilattie in Discord #documentation channel.)
The last two lines of the example (admin.site.register(...)) need to be outdented to work properly.
There are two problems in the example code shown in the start page "Intro to Django" section:
Forms example shows a contact form with
senderandcc_myselffields that would likely be broken or vulnerable to abuse in actual use. This example was adapted from Django's forms docs, which are being updated to avoid suggesting unsafe forms practices (see ticket-37162). Although the start page is just a code fragment, we should probably update it to match.Current code:
Suggestion: rename the last two fields:
(Or @nessita suggests just removing the example from that section.)
Admin example has broken code due to incorrect indentation. (Reported by Cyrilattie in Discord #documentation channel.)
The last two lines of the example (
admin.site.register(...)) need to be outdented to work properly.