0

I just started new project and used django cookiecutter, which comes with django-allauth, now i modifyed default templates etc, but form is renderd as

<form class="login" method="POST" action="{% url 'account_login' %}">
        {% csrf_token %}
        {{ form|crispy }}
        {% if redirect_field_value %}
        <input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" />
        {% endif %}
        <button id="sign-in-button" class="btn btn-primary" type="submit">{% trans "Prijava" %}</button>
        <a class="button secondaryAction" href="{% url 'account_reset_password' %}">{% trans "Pozabljeno Geslo?" %}</a>
</form>

But as my app is not going to be in english i have a problem how to translate this? Should i just go to pip packages and rename them in forms.py? Or what would you suggest? Or is there a way to write form for allauth without using {{ form|crispy }} ?

pydanny
  • 7,954
  • 6
  • 34
  • 42
HyperX
  • 1,121
  • 2
  • 22
  • 42

1 Answers1

0

You can override standard forms with the config parameters that you establish in settings.py. It's documented here.

ACCOUNT_FORMS (={})

Used to override forms, for example: {‘login’: ‘myapp.forms.LoginForm’}

You can also try it with this param, which I think only adds extras but doesn't override the original form completely.

ACCOUNT_SIGNUP_FORM_CLASS = ‘myapp.forms.SignupForm’
e.barojas
  • 252
  • 3
  • 11