I don't know where I got this from, but I consider it to be the best
convention for choosing quote types:

Use double quotes for strings meant for human consumption, use single
quotes for everything else.

Text, trans strings, model verbose_names: double quotes
Dict keys, HTML tags, flags, and similar: single quotes

Use triple quotes for long blocks of text, ideally only necessary for
human-readable strings.

On Tue, Oct 29, 2013 at 12:31 AM, Zach Borboa <[email protected]> wrote:
>
>> Here's an example from the django source where we are using double quotes
>> in python instead of single quotes. The following code prints out html using
>> single quotes instead of the double quotes regularly seen in html.
>>
>>     return format_html("<input type='hidden' name='csrfmiddlewaretoken'
>> value='{0}' />", csrf_token)
>>
>> instead of:
>>
>>     return format_html('<input type="hidden" name="csrfmiddlewaretoken"
>> value="{0}" />', csrf_token)
>
>
>
> This message inadvertently got deleted. If it was supposed to be removed. My
> apologies; feel free to again remove it.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/django-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/ca45bbf4-5167-4f6b-ad3b-517957e10ced%40googlegroups.com.
>
> For more options, visit https://groups.google.com/groups/opt_out.



-- 
Andrés Osinski
http://www.andresosinski.com.ar/

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CA%2BxF-Pyr6NHLd4AC8us%3DCAk4%3DpXht_tKBOxTeL9RVkhc9rjUfA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to