[Answer]-Django: Custom form __init__() and ReverseMatch errors

1👍

default is a valid parameter for a Model‘s CharField.

For a form field, the valid parameter is initial

Try:

type = forms.CharField(max_length=2, choices=ACTIVITY_CHOICES, initial=RUNNING) #initial instead of default

Documentation on initial here

Now your reverse match is a totally different issue. (Woudl recommend digging into it, and creating a new question if you are still stuck – hint: the URL is not resolving to anything.)

Leave a comment