You're looking at the wrong thing. The <pre> tags were added by your browser.
Chrome and Firefox show cleaned up HTML in firebug/web inspector. In the case
of a bad MIME type, it treats it as text, and wraps everything in HTML for
displaying. When people say to check the Content-Type header, you should look
in the network tab.
On Jan 9, 2013, at 1:57 AM, Ryoichiro Kamiya wrote:
> It's been resolved. The following mimetype property in views.py added the
> <pre> tags.
>
> return render_to_response('prayer/service_index.html', datadict,
> mimetype="application/json; charset=utf-8")
>
> Thanks,
> Ryo
>
> On Wednesday, January 9, 2013 11:07:14 AM UTC+9, Ryoichiro Kamiya wrote:
> Thanks all for seeing this thread.
>
> With further experiment, the result shows the HTML source with <pre> tag even
> after emptying the contents of the Django template file. When I tested it in
> various browsers, the browser automatically added basic HTML structure with
> <pre> tag on top of my contents. I compared the line endings and encoding
> with another page that working correctly, but couldn't find any difference.
>
> I'll mark this as closed as it seemed not an issue resulting from Django.
> Everyone, thanks for replying to my question. Have a nice day!
>
> Regards,
> Ryo
>
> On Tuesday, January 8, 2013 2:31:16 PM UTC+9, djangobie wrote:
> Than <pre> is the issues, as it 'll display the content (inside it) as it is
> .. making it preformated.
> can't guess how you got your code wrapped in it in the first place.
>
> Thanks
>
> On Tuesday, January 8, 2013 6:29:53 AM UTC+5, Ryoichiro Kamiya wrote:
> Thanks jjmutumi, stauros!
>
> I am not using "autoescape" tag in my template. Thanks.
>
> I am just checking the source on the back of HTML source displayed with
> Firebug as jmutumi suggested.
> It seemed an auto-inserted <pre> tag before & after the source. (Please find
> the attached. thanks)
>
> Any ideas how this can be added?
>
> Ryo
>
> On Monday, January 7, 2013 5:22:30 AM UTC+9, stauros wrote:
> Hello,
> maybe any "autoescape" template tags on the wrong spot?
>
>
> On Sun, Jan 6, 2013 at 9:46 PM, Joseph Mutumi <[email protected]> wrote:
> Hello,
>
> I think you should also check the 'Content-Type' being received client-side
> in the HTTP headers. You can use something curl or Firebug.
>
>
> On Sun, Jan 6, 2013 at 1:40 PM, Ryoichiro Kamiya <[email protected]>
> wrote:
> Hi,
>
> I'm testing Django template rendering in development environment, but one of
> the page shows HTML source (after all Django tag executed) instead of HTML.
>
> 1. Content Type
> The first thing I check is the Content Type but it's correctly set up (and
> it's in header template and shared with other pages that show contents
> correctly.
>
> <meta http-equiv="Content-Type" content="text/html" charset="utf-8">
>
>
>
> When I copied & pasted to another template and it works.
>
> 2. Browser
> I checked it in another browser (i.e. Chrome) but it returned the same result.
>
> 3. Reboot runserver
> also it didn't change the output.
>
> Is there anything else I should check?
> Thanks in advance.
>
> Regards,
> Ryo
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/FyjKgMAxm0YJ.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>
>
> --
> Stavros
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/52PmLUnVVSIJ.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
Peter of the Norse
[email protected]
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.