Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

387
Views
remove (* char) from the required field label in form

I'm trying to change the label of the fields that are required in django form using labels in Meta class . so after writing the code using this doc , i have a problem because the name of the field changes but the -> * character <- stays there .

Code :

from django.utils.translation import gettext_lazy as _
class Meta:
    model = ...
    fields = ...
    widgets = ...

    labels = {
        'email': _('email (necessary)'),
        'username': _('name (necessary)'), # the result of this -> name(necessary)* 
    }

Template :

{% extends "blog/base.html" %}
{% load crispy_forms_tags %}
{% block content %}

<h1>USERS REGISTER PAGE IS FOUND!</h1>
<br>
<hr>

<div>
    <form method="POST">
        {% csrf_token %}
        <fieldset class="form-group">
            <legend class="border-bottom mb-4">Join Today</legend>
            {{ form|crispy }}
        </fieldset>
        <div class="form-group">
            <button type="submit" class="btn btn-outline-info">Sign Up</button>
        </div>
    </form>
    <div class="border-top pt-3">
        <small class="text-muted">
            Already Have An Account ? <a class="ml-2" href="{% url 'users-login' %}">Sign In</a>
        </small>
    </div>
</div>

{% endblock content %}

so , how can I remove this annoying * ?

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

The root cause here was apparently the django-crispy-forms package being used for rendering the form.

Its documentation has a section on the "required" asterisks; the easiest, as linked, is to hide the asterisk field; you don't need to change the labels:

.asteriskField {
    display: none;
}
over 4 years ago · Santiago Trujillo Report

0

when we use this form on django project , where is the location of the file that include this part :

.asteriskField {
display: none;}
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!