Re: attribute required and error XML

2017-03-02 Thread chun974
Thanks, ludovic coues,
I have find the solution. I used eclipse whith django. In the setting.py I 
have modify (DEFAULT_CONTENT_TYPE='application/xhtml+xml') to 
(DEFAULT_CONTENT_TYPE='text/html'). It's OK with this. You're right!!
Thanks :) !

Le mercredi 1 mars 2017 10:53:54 UTC+1, ludovic coues a écrit :
>
> I can't answer on your issue exactly, but  is not an XML 
> doctype. It's the html5 doctype which as far as I know is SGML and not XML.
>
> Try removing the line starting with 
> On 28 Feb 2017 7:46 p.m., "chun974" <maletie...@gmail.com > 
> wrote:
>
> Hi all,
> I have  an problem. When I use the django library  form, It create an 
> attribute "required" for an input. But when I look on my explorer (firefox 
> or chrome or IE) i have a XML error. 
>
> "XML parsing error: malformed".
>
> this is my code : 
> "
> class LoginForm(forms.Form):
> email = forms.EmailField(label='Courriel :')
> password = forms.CharField(label='Mot de passe :',
> widget = forms.PasswordInput) 
>  
> def clean(self):
> cleaned_data = super (LoginForm,self).clean()
> email = cleaned_data.get("email")
> password = cleaned_data.get("password")
> if email and password:
> if password != 'bob' or email != 'b...@bob.fr ' :
> raise forms.ValidationError("Adresse de courriel ou mot de 
> passe erroné.")   
> return cleaned_data
> "
>
> this is my déclaration for XML and doctype : 
> "
> 
> 
>
> http://www.w3.org/1999/xhtml; xml:lang="fr"> "
>
> I can put "required=False" and it's OK, but I want that my input is required 
> (required=True it's not OK)
> XML don't accept that required  attribute is alone, whithout "= someting".
>
> If someone has had this problem? 
>
> Django 1.10
> Firefox last update
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users...@googlegroups.com .
> To post to this group, send email to django...@googlegroups.com 
> .
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/8cb6a10b-fc89-4f9a-814e-a905ea9eef6b%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/django-users/8cb6a10b-fc89-4f9a-814e-a905ea9eef6b%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9d0c5f4b-92e0-43fc-a161-ae088655a013%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


attribute required and error XML

2017-02-28 Thread chun974
Hi all,
I have  an problem. When I use the django library  form, It create an 
attribute "required" for an input. But when I look on my explorer (firefox 
or chrome or IE) i have a XML error. 

"XML parsing error: malformed".

this is my code : 
"
class LoginForm(forms.Form):
email = forms.EmailField(label='Courriel :')
password = forms.CharField(label='Mot de passe :',
widget = forms.PasswordInput)  
def clean(self):
cleaned_data = super (LoginForm,self).clean()
email = cleaned_data.get("email")
password = cleaned_data.get("password")
if email and password:
if password != 'bob' or email != 'b...@bob.fr' :
raise forms.ValidationError("Adresse de courriel ou mot de 
passe erroné.")   
return cleaned_data
"

this is my déclaration for XML and doctype : 
"



http://www.w3.org/1999/xhtml; xml:lang="fr"> "

I can put "required=False" and it's OK, but I want that my input is required 
(required=True it's not OK)
XML don't accept that required  attribute is alone, whithout "= someting".

If someone has had this problem? 

Django 1.10
Firefox last update

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8cb6a10b-fc89-4f9a-814e-a905ea9eef6b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.