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

Filter by
Sorted by
Tagged with
0 votes
0 answers
14 views

as_crispy_field filter does not render the model's validation errors

views.py: class LoadRequestView(BSModalFormView): template_name = 'sales_portal/activation_request.html' body_template_name = 'sales_portal/activation_request_body.html' form_class = ...
  • 519
0 votes
1 answer
308 views

AttributeError -Settings' object has no attribute 'CRISPY_TEMPLATE_PACK'

I am trying to buildtodo list webapp in django. when i try to run 'python manage.py runserver' but am receiving this error AttributeError: 'Settings' object has no attribute 'CRISPY_TEMPLATE_PACK' Any ...
-2 votes
0 answers
39 views

ModuleNotFoundError: No module named 'crispy_bootstrap5', crispy forms django

I am new to Django and I am trying to learn/use crispy forms to create a registration/login form. however i keep getting a ModuleNotFound error on the 'crispy_bootstrap5'. I am using intellij and have ...
  • 1
0 votes
1 answer
26 views

javascript does not work in a Django crispy form

I want to create a client, with country, province, city selected based on 3 different models : class Country(models.Model): Country = models.CharField(max_length=100, unique=True) def __str__(...
0 votes
1 answer
22 views

crispy forms creating fields with id of other form

I am trying to add some JS to my password field, so I need its ID. I am getting error: It makes sense if I look into HTML with inspect. There are 2 identical password fields, but in my forms, I am ...
1 vote
2 answers
50 views

Overriding the default class attribute using django-crispy-forms

I am currently learning how to use django crispy forms and can't figure out this issue. I am using it alongside bootstrap5. I have the following form : class CommentForm(forms.ModelForm): class ...
0 votes
0 answers
9 views

How to ,centralize deselect search box in django crispy form

I created a searchable dropdown box in django with crispy forms using dselect() like so: form.html {% extends 'layout.html' %} {% load crispy_forms_tags %} {% block content %} <div class="...
10 votes
2 answers
3k views

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 ...
  • 103
0 votes
0 answers
30 views

Change crispy forms string representation

Crispy forms use the string representation of objects provided by the str method of the objects' class: I need to change this behaviour (please, help me). In my crispy form the labels of the choices ...
1 vote
1 answer
19 views

Split radio buttons in several groups with crispy-forms

I would like to create a django form to plan a meeting. I have to propose several timeslots, and regroup them by day, like in the following image. Is it possible to do that with crispy-forms, by using ...
  • 529
0 votes
1 answer
68 views

Crispy forms label inside of field

Using Bootstrap5, Django and Crispy Forms to create a calculator application. Application works as expected however I want to make changes to the appearance of the forms. I've already removed the ...
1 vote
0 answers
11 views

CrispyError at /account/register |as_crispy_field got passed an invalid or inexistent field

I need help to fix this. Error during template rendering In template /*/dev/ecommerce/account/templates/account/registration/register.html, error at line 45 |as_crispy_field got passed an invalid or ...
0 votes
0 answers
31 views

Using django crispy-forms wrap to wrap multiple properties

I have a form with lots of repetition and I want to use the wrap function of django crispy forms to reduce this. This is the form as it stands: class MyForm(ModelForm): def __init__(self, *args, *...
  • 360
1 vote
1 answer
20 views

Django crispy forms language settings

I am a beginner at web application development using django framework. I am creating a crispy form to update the user information and upload an image. The html file contains two forms, one for ...
  • 31
0 votes
0 answers
19 views

Form attributes duplicating in '.controls' div when using CheckboxSelectMultiple widget with Crispy Forms

I have a form that's meant to filter results in a list view. I'm using HTMX to submit a GET request whenever the form changes, and I'm using Crispy Forms to render the form (including the hx ...
0 votes
0 answers
8 views

Django TemporaryUploadedFile not rendered if form is invalid

I have a form that contains FileField as one of its fields. Each field in the form is rendered using as_crispy_field. Issue: If I entered all the inputs (including the file), and the form got re-...
0 votes
0 answers
18 views

Django as_crispy_field doesn't render the TemporaryUploadedFile data

I have a Django formset that receives the POST request data once submitted, and it saves it (including the uploading file) normally to my database, but if the form is invalid, the page renders again ...
0 votes
1 answer
72 views

django crispy form does not work in the template

I'm trying to make my form-fields to be in a row like this html code down below, but it does not work, I want all the fields in the PrimryForm class to be in a row not in a column: Html code: <...
0 votes
0 answers
56 views

Why django forms shows input in column instead of a row

I wonder why django modelForm shows input in a column instead of a row like this: I like all input in my model to be in a row when putting {{ form|crispy}} in the template, as you can see in the ...
0 votes
1 answer
29 views

How rename input class in crispy-form Dlango

How rename input class "numberinput form-control"? <input type="number" name="sq" step="0.1" class="numberinput form-control" required="" ...
  • 1
1 vote
0 answers
26 views

Cannot save a modelform using Django Crispy Forms

I cannot save my form because the payload is not formatted correctly.. I'm using HTMX for rendering the form in a modal here's the code: forms.py class RecipeForm(forms.ModelForm): title = forms....
0 votes
0 answers
21 views

How to define and render Django formset for registeting hours spent on a project each day during a month?

I building a Django site where users can register their time spent working on a particular project (Time Report). In the future Time reports will be subject to approval process and possibly sources ...
  • 1
1 vote
0 answers
43 views

Div with class 'input-group' Shrinking form width in Django Crispy Forms

I have a form (class "form-control mb-3") with a MultiWidget select field and text field which currently renders as: I want to use crispy forms to render the time field in line with the ...
  • 35
0 votes
0 answers
77 views

How can I save the data from my Django crispy form

This is how my form looks like: When I press submit and go to the page where the post should be rendered, then I cannot see the post I just have created. This is the page where I have my form: '...
  • 129
0 votes
0 answers
55 views

How to use a django template variable in django-crispy bootstrap AppendedText or PrependedText?

I saw that a similar question was asked 10 years ago about buttons and that it was resolved. I was naive enough to think that maybe it was possible for other fields ^^ Have I missed something ? As ...
  • 1
0 votes
0 answers
33 views

How can I send Boolean fields via Django send_mail

I am fairly new to Python and Django, I am trying to use the build in send_mail and having a few issues with the boolean fields I want to be included in the email that is sent, I have had no issues ...
  • 5
0 votes
1 answer
55 views

How to render out DateTime selection on form in Django

I am trying to make a website form for someone to select what equipment they need, and have another for returning the equipment. I have it all set up and can see it in the admin panel. Everything is ...
  • 5
0 votes
0 answers
37 views

Problem in creating dynamic form fields in Django App using crispy form

I have one Model Given as below:- class FeeItemAmount(models.Model): id = models.AutoField(primary_key=True) fee_item = models.ForeignKey(FeeItem, on_delete=models.CASCADE) class_obj = ...
0 votes
1 answer
205 views

crispy_forms is not working : ModuleNotFoundError: No module named 'crispy_forms'

Steps that I followed pip install django-crispy-forms add inside setting.py INSTALLED_APPS = [ ... 'crispy_forms', ... ] and CRISPY_TEMPLATE_PACK = 'uni_form' press the run icon of ...
  • 41
0 votes
0 answers
33 views

I'm trying to change the standard django registration using crispy-forms, but at the same time the registration confirmation email stops coming

Installed crispy-forms and configured templates for authentication. Everything works well. Problem with registration. With the standard registration form, I fill out the forms, then an email is sent ...
  • 1
1 vote
1 answer
201 views

django htmx change hx-get url after user input from radio buttons

This is forms.py: class OrderForm(forms.ModelForm): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.helper = FormHelper() self.helper.attrs = { ...
1 vote
1 answer
71 views

Django Crispy Form doesn't add or update database

Hello, I am writing a small project about a car shop and this is the problem I came up with. I'm trying to add a new car and everything seems to work, but when I fill out the form and click submit, it ...
  • 13
0 votes
0 answers
39 views

Adding help text to a django from

I want to add help text/tool tip when a user hovers over a form field. I have a model form based on this model: class MyModel(TimeStampedModel): MY_CHOICES = [tuple([x,x]) for x in range(1,8)] ...
  • 360
0 votes
1 answer
130 views

How to implement tooltip with django form

I have a model form based on this model: class MyModel(TimeStampedModel): MY_CHOICES = [tuple([x,x]) for x in range(1,8)] p1 = models.IntegerField("P1", default='1', help_text='text1'...
  • 360
1 vote
1 answer
60 views

Django FieldError: Unsupported lookup 'kategorie' for IntegerField or join on the field not permitted

I have a Django Table with Crispy Filter and I would like to filter in Data table based on Category. But I am getting FieldError. I tried to define my filter field by this way in filters.py: kategorie ...
0 votes
1 answer
111 views

How to change css_class for all <div> rows in Crispy form

I am using Crispy forms to render my Django form. It works smoothly but I struggle with updating the css_class for my rows. Any suggestions how to solve this? The form is retrieved from the forms....
1 vote
1 answer
35 views

Django Dynamically Add Forms Based On Key Value Pairs List

Is there a way to dynamically create formsets based on an API response. This would easily be done in JS, however, the app is running Django's MVT and I would like to create the form dynamically within ...
  • 21
-2 votes
1 answer
57 views

Django crispy forms prepend box set width

I am using crispy forms to make a django form which has several rows. The default behaviour is for the prepend box to be just the size of the text within it. However this looks messy when there are ...
  • 360
0 votes
0 answers
92 views

How to validate crispy form with ajax request?

I am trying to validate a crispy-form through AJAX to re-render any resulting form errors When I click on link organizations_list/organizations_list.html and html is rendering everything is ok. Next, ...
0 votes
1 answer
26 views

Django - getting properly formatted decimals in forms (+crispy)?

I have the following model: class Probe(models.Model): name = models.CharField("Probe name", max_length=200, blank=True, null=True) order = models.IntegerField("ordering", ...
0 votes
1 answer
73 views

Django how do you AutoComplete a ForeignKey Input field using Crispy Forms

Looking for any assistance as i just can't seem to get this. I have a 'category' field that has approx 4000 categories in it, sourced from my table "Category". When a user inputs their ...
  • 29
0 votes
1 answer
42 views

How to change help text colour in password reset form?

I have a password reset form (crispy form) in Django, I just changed background colour to black and text colour to white. But help text is remaining black as you can see: I tried to assign CSS style ...
0 votes
1 answer
78 views

django crispy forms and bootstrap5 floating labels

I could use some help. I'm trying to use floating labels in a form. It works fine if I hand-code the html. But when I move it to crispy, I lose the floating behavior of the label and the label ...
  • 5
0 votes
0 answers
166 views

Display bootstrap element in django-forms

I want to use an element of a bootstrap template in my django-form: It's html code looks like this: <div class="form-group"> <div class="choices" data-type="...
0 votes
1 answer
314 views

Modelling custom form using django crispy form

I have this problem where I want to model the style of a field using django-crispy-forms from a template downloaded from the internet. The field looks like this: and the html for this section is (...
  • 421
0 votes
1 answer
32 views

Django Crispy Form filter by is_staff

I have a form to upload article posts but how would I filter the author so it just shows users who have the is_staff role, I also need it to show authors as usernames rather than email adresses Here ...
0 votes
1 answer
97 views

How to use JavaScript client-side encryption/decryption in django forms / crispy forms? Is there any python package available which can do this

Django Form fields needs to be encrypted at server side and needs to be decrypted in client browser while rendering and vice versa for form submission One approach is using JS cryptographic libraries ...
  • 1
0 votes
0 answers
25 views

CrispyError: |as_crispy_field got passed an invalid or inexistent field

**models.py** class Employee(models.Model): fullname = models.CharField(max_length=100) emp_code = models.CharField(max_length=3) mobile = models.CharField(max_length=15) position = models....
0 votes
0 answers
50 views

Login in django failing after adding css to login page

I have a basic django website running on a postgres database. The login page code was structured as follows, {% extends "_base.html" %} {% load crispy_forms_tags %} {% block title %}Log In{% ...
0 votes
1 answer
96 views

as_crispy_field got passed an invalid or inexistent field

im getting this error as_crispy_field got passed an invalid or inexistent field every time im trying to use as_crispy_field with forms here is my code models.py class Customer_Email(models.Model): ...

1
2 3 4 5
17