开发者

Django inserts AdSense Code?

开发者 https://www.devze.com 2023-03-30 09:10 出处:网络
I\'m running the 1.3 Django tutorial, and have got a development server running the polls application.In chrome, I open the web developer widget and inspect the structure of the page.I have:

I'm running the 1.3 Django tutorial, and have got a development server running the polls application. In chrome, I open the web developer widget and inspect the structure of the page. I have:

<html>
<head></head>
<body>
<some form stuff>
<body>
<style>code in question</style>
</html>

The template for this page is simply the stuff inside the body tags. So Django is adding on everything else. Apparently when it does so, it adds this trailing declaration, which seems to contain Google AdSense css classes.

Anyone know what's up with that?

views.py imports my models,

Http404,

HttpResponseRediect,

HttpResponse,

RequestContext,

get_object_or_404,

render_to_response,

reverse

none of that seems to have anything to do with AdSense. As I mentioned, I'm just running the tutorial, have not started setti开发者_JS百科ng up my site yet.


I can say for certainty that "Django" is not adding anything - not even the html and body tags. They are not present in the HTML that Chrome is receiving. However, the Chrome inspector needs your page to be a valid HTML document, so it re-interprets some things, including adding open and close tags where necessary.

If you looked at View Source instead, you would see what the page actually looks like.

0

精彩评论

暂无评论...
验证码 换一张
取 消