About 3,520,000 results
Open links in new tab
  1. Django Forms: pass parameter to form - Stack Overflow

    Feb 2, 2013 · Django Forms: pass parameter to form Asked 12 years, 9 months ago Modified 4 years, 11 months ago Viewed 79k times

  2. Django Forms: if not valid, show form with error message

    Feb 1, 2013 · In Django forms, it can check whether the form is valid: if form.is_valid(): return HttpResponseRedirect('/thanks/') But I'm missing what to do if it isn't valid? How do I return the …

  3. How do I add a placeholder on a CharField in Django?

    Look at the widgets documentation. Basically it would look like: q = forms.CharField(label='search', widget=forms.TextInput(attrs={'placeholder': 'Search'})) More …

  4. CSS styling in Django forms - Stack Overflow

    Apr 4, 2015 · Check Working with Django forms as an example what is available for each field in the form ({{field}} for example is just outputting the input tag, not the label and so on).

  5. python - Django set default form values - Stack Overflow

    ;-) (Or rather, Django form constructors understand the special "initial" variable and iterate through its contents without you needing to do anything extra). Personally, I prefer to specify default …

  6. How to create password input field in django - Stack Overflow

    Feb 17, 2012 · A field in django forms is not the same as a field in HTML forms. The field in HTML forms is the same as the widget in django forms.

  7. In a Django form, how do I make a field readonly (or disabled) so …

    Nov 28, 2008 · 540 In a Django form, how do I make a field read-only (or disabled)? When the form is being used to create a new entry, all fields should be enabled - but when the record is …

  8. Django's forms.Form vs forms.ModelForm - Stack Overflow

    Aug 16, 2017 · Could anyone explain to me similarities and differences of Django's forms.Form & forms.ModelForm?

  9. Setting the selected value on a Django forms.ChoiceField

    Setting the selected value on a Django forms.ChoiceField Asked 16 years, 7 months ago Modified 11 months ago Viewed 202k times

  10. What's the best way to store a phone number in Django models?

    I am storing a phone number in model like this: phone_number = models.CharField(max_length=12) The user would enter a phone number and I would use the …