开发者

Django + Adsense on Google App Engine

I have a problem with Django on Google App Engine. I finished to design html templet for my web application and I imported them on django using django template system. The problem is google ad-sense. I can say ad-sense banner on the html version of my pages if i try to open them in my browser. But nothing appear if I try to do the same operation with them loaded in django. I also tried to develop a simple html template that contains only the adSense script, if i load this on django it returns a white page. No b开发者_运维技巧anner, nothing. What can i do to solve this problem?


adsense is javascript, if your django is returning nothing check your HttpResponse and how you are generating the template. it looks like you need to specify in settings.py the location of the template file.


you may want add the following (in settings.py):

import os
ROOT_PATH = os.path.dirname(__file__)
TEMPLATE_DIRS = (
    os.path.join(ROOT_PATH, 'templates')
)

then put your django templates in a sub-directory to your project called "/templates"

or try the process of elimination: comment out any javascript and see if you can generate the template from django.


I solved the problem! Sorry, I accidentally added some character with erroneous codeing.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜