开发者

How to push changes through django?

I've been given the keys to a website written in Python on the Django framework. I have a php background, so I'm not used to having to worry about compliation, etc.

I'm just trying to change the copyright at the footer. I found the template that holds the html... it's called base.html, in the 'templates' folder. I changed the copyright from 2010 to 2011, but it's not showing up on the site.

Should I need to开发者_如何学C recompile anything in order for my changes to show up?


there are two different things.

if you change your python files, it is complicated. most of time, you need restart your server to see changes.

But I think your problem is totally different. You use django.template.loaders.cached.Loader

you can check it in your settings.py

anyway if you use this template loader( I think so), you need to restart your webserver again.

if you don't want to restart your server for template change, you must remove django.template.loaders.cached.Loader from TEMPLATE_LOADERS and restart your server once... because you change your python file. after this step, when you change your template files, see changes without restart.

django docs: http://docs.djangoproject.com/en/1.3/ref/templates/api/


Sounds like an important task ;) Your python scripts (.py) are compiled to bytecode files (.pyc) automatically. If the .py file has changed or there is no .pyc file, your python interpreter will automatically compile.

AFAIK, template files (.html) are not cached in memory. But .pyc files are, and often it is necessary to tell apache to reload. To me, it sounds more like you're changing the wrong .html file or the wrong part of the html code.

With respect to compiling, python is much like php, except that it saves its bytecode for later use.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜