All Questions
Tagged with twitter-bootstrap-3 django
161
questions
17
votes
7
answers
21k
views
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....
16
votes
7
answers
8k
views
Error loading sample django-bootstrap3 template
I'm still new to Django and Bootstrap so I'm trying out the django-bootstrap package: https://github.com/dyve/django-bootstrap3
The sample template that is included on that page (with a change of url ...
10
votes
1
answer
9k
views
django :: How to style a CheckboxSelectMultiple in a form?
forms.py
class FormEntry(forms.ModelForm):
class Meta:
model = Entry
fields = ['name','price','share']
widgets = {
'share':forms.CheckboxSelectMultiple(),
}
after passing it ...
10
votes
2
answers
13k
views
Bootstrap 3 Responsive Panel Layout with Varying Heights
We are trying to use the bootstrap 3 panels to create a responsive grid layout, however we are unable to work out how to get them to display in the way that we want them. Below shows an example of ...
8
votes
4
answers
6k
views
Django: how to get the name of the template being rendered
I'm implementing a bootstrap navbar as show in this example here
Items in a navbar are <li>'s , the "selected" item has the attribute class="active":
<li class="active"> <a href="#"&...
8
votes
1
answer
3k
views
Rendering separate MultiWidget fields using Django Crispy Forms
My specific case is that I need this field rendered in one line (using Bootstrap 3):
So something like:
<div class="form-group">
<label>Amount:</label>
<div class="row"&...
6
votes
1
answer
6k
views
BooleanField checkbox not render correctly with crispy_forms using bootstrap
I am using crispy_forms and FormHelper. I have a model field declared as:
active = models.BooleanField(default=True)
And in my ModelForm, I have tried both the following in my Layout:
self....
6
votes
3
answers
10k
views
Display Form Field based on other Fields within the Django Form
I am trying to create a way to only display certain fields within a django form based on the bound data of another field within that same form. I'm familiar with the idea of form.field.bound_type but ...
6
votes
2
answers
8k
views
django-crispy-forms input size
According with django-crispy-form documentation, I will be able to change input width with class input-small. But my form always looks with width at 100%:
Also, If I add css_class to Field the size ...
5
votes
1
answer
9k
views
Different css margins for mobile & desktop without multiple {% block content %} in Django template
I need to change the margin-left that is applied to my main {% block content %} in my base.html template (that contains my navbar and other common elements) based on if the viewer is using mobile or ...
5
votes
1
answer
3k
views
Django CrispyForms - Render every form of a formset in separate bootstrap tabs
I would like to render each form of a formset in a different bootstrap3 tabs using django-crispyForms, but it seems to not be simple because crispyForms does not handle formset completely yet.
my ...
5
votes
2
answers
5k
views
How to make Bootstrap file browse button using django-crispy-forms
Here is my Django forms.py script, using django-crispy-forms
#!/usr/bin/env python
from django import forms
from .models import Method1
from crispy_forms.helper import FormHelper
from crispy_forms....
4
votes
3
answers
11k
views
Bootstrap 3 - Form horizontal not working
I'm using Django with CrispyForms and I'm updating an old project of mine to BS3.
The only thing I didn't find out how to adapt are form-horizontal. My forms used to look like this:
Now the label is ...
4
votes
2
answers
5k
views
Django: Bootstrap CDN or loading Bootstrap files from local server?
I am trying to make my first website. I am using Django for it. I have a question related to the inclusion of css/js from Bootstrap.
What is the difference between installing it and linking it using ...
4
votes
1
answer
2k
views
crispy-form's Helper doesn't take effect
It seems the FormHelper simply doesn't anything. Here's my Form:
class PerguntarForm(forms.Form):
title = forms.CharField(label='Título', max_length=200)
categoria = forms.ModelChoiceField(...