Even though I put this line in my settings.py :
LANGUAGE_CODE = 'pt-br'
TIME_ZONE = 'America/Sao_Paulo'
USE_I18N = True
USE_L10N = True
USE_TZ = True
DECIMAL_SEPARATOR = ','
DATE_INPUT_FORMATS = ['%d/%m/%Y']
DATE_FORMAT = r'd/m/Y'
As specified here : https://docs.djangoproject.com/en/1.10/ref/settings/#decimal-separator
Even with L10N set to False it won't recognize(although the language code should already set decimal separator as comma)
Django still won't recognize the comma as decimal separator
Actual error :
ValueError: could not convert string to float: '123,123'
The field is just a default FloatField, I'm not using forms.
What could be causing it to not recognize the comma?
This is the views.py code :
def new_object(request):
data = json.loads(request.body.decode("utf-8"))
model_name = data.get('model')
model = apps.get_model(app_label='cadastroimoveis', model_name=model_name)
obj = model(**data.get('fields'))
obj.save()
The sent request is just a JSON with the fields as strings
Edit: I just checked and not even the DATE_INPUT_FORMATS it working, it is still expecting the default values