Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

391
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda