Questions tagged [django-crispy-forms]

django-crispy-forms is a pluggable Django app that helps to write DRY forms by providing additional capability to configure and control the rendered HTML

django-crispy-forms is a Django application that lets you easily build, customize and reuse forms using your favorite CSS framework, without writing template code and without having to take care of annoying details.

django-crispy-forms provides you with a |crispy filter and {% crispy %} tag that will let you control the rendering behavior of your Django forms in a very elegant and DRY way. Have full control without writing custom form templates. All this without breaking the standard way of doing things in Django, so it plays nice with any other form application.

822 questions
35
votes
1 answer

How to render Django forms.ChoiceField as Twitter Bootstrap dropdown

What is the most efficient way (in terms of programming/maintenance effort, elegance) to render a Django forms.ChoiceField as a Twitter Bootstrap dropdown using one of the django-bootstrap, django-bootstrap-form, django-bootstrap-toolkit,…
34
votes
2 answers

How to set css class of a label in a django form declaration?

I'm using django-uniform and to use some uniform features, I'm looking for a way to add css class directly from form declaration (for independents widgets). (as a bonus, here my reusable read-only home made mixin snippet...) from django import…
christophe31
  • 6,359
  • 4
  • 34
  • 46
25
votes
1 answer

use Crispy form with ModelForm

I've been running into crispy form, and it seems to do exactly what I want: render forms with bootstrap layout. Now, the example talk about using forms.Form. This is ok, I can create mine by writing the code like this: class…
EsseTi
  • 4,079
  • 5
  • 36
  • 63
22
votes
3 answers

Django returns 'TemplateDoesNotExist' when using Crispy Forms

Using Crispy Forms with Django, I can only get a TemplateDoesNotExist error when using any feature of Crispy Forms. As I'm new to Crispy Forms (which seems to be universally recommended for quickly making forms look better), I have followed the…
Dave
  • 323
  • 1
  • 2
  • 5
22
votes
16 answers

ImportError: No module named crispy-forms

I'm working on some django apps, pretty noob still. Would like to use crispy-forms, but eclipse and django doesnt recognize it. Trying to runserver or shell: $ python manage.py runserver this happens: Traceback (most recent call last): File…
beowwwulf
  • 259
  • 1
  • 2
  • 7
20
votes
6 answers

Remove Labels in a Django Crispy Forms

Does anybody know if there is a correct way to remove labels in a crispy form? I got as far as this: self.fields['field'].label = "" But it's not a very nice solution.
Ron
  • 22,128
  • 31
  • 108
  • 206
19
votes
2 answers

Django form with fields from two different models

I need to display one form, with multiple fields from 2 different models. Form will contain only part of fields from models, and layout will be made using the crispy forms. My models: class Company(BaseModel): title =…
dease
  • 2,975
  • 13
  • 39
  • 75
17
votes
7 answers

crispy-forms: add css class for one of the inputs

In my forms.py I have [...] self.helper.layout = Layout( Field('name'), Field('description'), ) self.helper.form_class = 'form-horizontal' self.helper.label_class = 'col-md-2 col-xs-3' self.helper.field_class = 'col-md-10…
speendo
  • 13,045
  • 22
  • 71
  • 107
16
votes
5 answers

Django 1.8 & Django Crispy Forms: Is there a simple, easy way of implementing a Date Picker?

There are an awful lot of date/datetime picker implementations out there. Are there any that integrate with Django and Crispy Forms particularly well, and how are they used? I'm looking to minimise development effort, maximise simplicity, and make…
StringsOnFire
  • 2,726
  • 5
  • 28
  • 50
16
votes
4 answers

Django - Disable form select field validation

I have a form that lets me first select a product type and then select the product. As i have 1000+ products i use the following to filter the product list to improve performance. I have the following inlineform in my views.py OrderLineFormSet =…
phicon
  • 3,549
  • 5
  • 32
  • 62
16
votes
4 answers

django crispy forms: Nesting a formset within a form

I have a django Formset that I'd like to layout in the middle of another form. I'm using django-crispy-forms to set the layout in the parent form's __init__: from crispy_forms.helper import FormHelper from crispy_forms.layout import Submit, Layout,…
Neil
  • 7,042
  • 9
  • 43
  • 78
16
votes
4 answers

Displaying multiple Rows and Columns in django-crispy-forms

I'm using django-crispy-forms with Twitter Bootstrap , and I'm having some issues with customizing my forms into multiple rows and columns. One example problem is that nothing happens when I try to split the form into two columns: class…
martinpaulucci
  • 2,322
  • 5
  • 24
  • 28
15
votes
2 answers

Where are templates to django-filter package?

I am a little bit confused. https://github.com/carltongibson/django-filter/blob/develop/django_filters/rest_framework/backends.py From line 31 to 37 - here is a logic, if I have crispy instaled, package should use…
pmoniq
  • 951
  • 10
  • 24
13
votes
6 answers

TemplateDoesNotExist at /users/register/ bootstrap5/uni_form.html

I am building a registration form for my django project, and for styling it I am using crispy forms. But, when I run my server and go to my registration page, I see this error: Internal Server Error: /users/register/ Traceback (most recent call…
Samyak Jain
  • 347
  • 1
  • 4
  • 17
13
votes
2 answers

Django Crispy Form Split Field Layouts

We have a crispy form where we want to be able to render different fields in different parts of our forms HTML template, however we can't find a way of doing this in the Crispy Documentation. Below is some slightly made-up code to illustrate what we…
robjohncox
  • 3,639
  • 3
  • 25
  • 51
1
2 3
54 55