推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
Mianco
V2EX  ›  Python

用Python实现这样的功能难不难?

  •  
  •   Mianco · Apr 7, 2012 · 5853 views
    This topic created in 5331 days ago, the information mentioned may be changed or developed.
    web服务器是nginx,大家知道对静态内容很友好的

    想用python写个程序,跑在服务器上,每隔一段时间(时间较长,至少大于12小时)生产一个纯html页面,新生产的页面覆盖了之前的页面,作为网站的首页。

    因为首页时不时需要更新的,直接从源代码修改太麻烦,所以用python写了动态网络应用,可以让用户修改提交新内容,修改后程序生成单纯的html页面。

    这样的机制复杂吗?python程序每隔一定时间自动生成html页面,要想实现这样的功能需要掌握哪方面的细节技术,包括服务器层面和python层面。
    8 replies  •  1970-01-01 08:00:00 +08:00
    fanzeyi
    fanzeyi
    Apr 7, 2012
    1
    cron + python
    vendetta
    vendetta
    Apr 7, 2012
    2
    做缓存不行么?
    wangg800
    wangg800
    Apr 8, 2012
    4
    首先, 你的生成首页功能是应该由你的网站语言来完成的, 如php. 也就是说你要做的就是一个定时执行的功能。 你可以用python定时请求php, 也可以用别的脚本, 或者做计划任务都行。我是这样认为的, 不知道怎么样。
    xiexingjia
    xiexingjia
    Apr 8, 2012
    5
    @wangg800 亲,python也是可以做web的哦,既然lz是想用python做,为什么非要指条用php的路呢。
    likuku
    likuku
    Apr 8, 2012 via iPhone
    6
    原始网站首页是什么语言生成的,最好就拿那种语言来搞。最高程度代码复用嘛。
    cxh116
    cxh116
    Apr 8, 2012
    7
    rails有caches_page的功能,帮你把整个页面生成html,支持定时过期,动作触发过期(Sweepers)
    cute
    cute
    Apr 8, 2012
    8
    nginx_srccache moudle
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2059 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 14:51 · PVG 22:51 · LAX 06:51 · JFK 09:51
    ♥ Do have faith in what you're doing.