These are chat archives for django/django

6th
Jun 2016
samkurma
@samkurma
Jun 06 2016 13:45
hii by using this code, i am able to print form errors, {%if form.errors%}
{{form.errors}}
{%endif%}
But i want to print these errors at field itself
how can i do that
anyone please
It's the inline formset
Filip Figiel
@megapctr
Jun 06 2016 13:47
You can use form.field.errors
samkurma
@samkurma
Jun 06 2016 13:49
@filip, it's not printing the errors now...
{%if form.errors%}
{{form.field.errors}}
{%endif%}
Filip Figiel
@megapctr
Jun 06 2016 13:51
No, you have to access a real form field
Like, if you were iterating through the fields
Then the field has attribute errors
samkurma
@samkurma
Jun 06 2016 13:52
could u please suggest me an example please
i put it in this way, {% for form in studentFormset.forms %}
{%if form.errors%}
{{form.field.errors}}
{%endif%}
in your case, you have to iterate to get forms
then you have to iterate again to get form fields
for field in form ... for form in forms
samkurma
@samkurma
Jun 06 2016 13:55
Thanks, i tries that, but it's showing on top of the form, But i want to display at field it self, lt's say i have 10 fields, i am getting at 9th field, i want to show at 9th field itself, not on top of the form
mpachas
@mpachas
Jun 06 2016 14:00
@samkurma take a look to django source code, find the proper template and try to understand it. It gets easier
Nathan Nichols
@nqthqn
Jun 06 2016 17:00
Could someone explain these errors to me? RuntimeError: populate() isn't reentrant and Call to 'site.addsitedir()' failed. I am trying to deploy my django site using apache and mod_wsgi
Patrick Harding
@senorpatricio
Jun 06 2016 17:03
who is your host?
Nathan Nichols
@nqthqn
Jun 06 2016 17:04
self hosted on a VM
ubuntu
looks like that runtimeerror is just a cover for another error. This might help you find the reall problem
Nathan Nichols
@nqthqn
Jun 06 2016 17:06
maybe
Nathan Nichols
@nqthqn
Jun 06 2016 17:13
another weird error I am seeing I get Failed building wheel for PyYAML but then pip freeze shows it was installed...