高斯金字塔 拉普拉斯金字塔_新金字塔遗址

高斯金字塔 拉普拉斯金字塔

alternate text

For the first time in 10 years, http://aclark.net is not powered by Plone.

这是10年来的第一次,Plone不再支持http://aclark.net。

Nothing against Plone: it’s still one of the greatest loves of my life (inasmuch as you can love a software and community, as I do).

没有什么可以反对Plone的:它仍然是我一生中最伟大的爱之一(就像我一样,因为你可以爱一个软件和社区)。

为什么 (Why)

This was not the result of a revolutionary plan, rather more of an evolution. It happened like this:

这不是革命计划的结果,而是进化的结果。 事情是这样的:

  • As soon as Plone 4.3a1 was released (a year ago?) I deployed a new Plone site to aclark.net with it, featuring a Diazo (new Plone theming engine) theme.
  • Around the same time I became obsessed with deploying to Heroku, and also gained an interest in Python 3.
  • A few months ago, I got tired of paying $11/month to host my Plone site so I converted the site to static HTML and moved it to GitHub pages. But the result was flawed because maintenance involved editing duplicate copies of the website content (e.g. both clients.html and clients/foo.html contained the same text describing “foo”).
  • 只要Plone的4.3a1发布(一年前?)我部署一个新的Plone网站aclark.net有了它,配备了重氮 (新Plone的主题引擎)的主题。
  • 大约在同一时间,我开始沉迷于部署到Heroku,并且对Python 3也产生了兴趣。
  • 几个月前,我已经厌倦了每月支付11美元来托管我的Plone网站,所以我将该网站转换为静态HTML并将其移至GitHub页面 。 但是结果存在缺陷,因为维护涉及编辑网站内容的重复副本(例如,clients.html和clients / foo.html都包含描述“ foo”的相同文本)。

So when it came time to do more than a few casual edits, I knew I had to find a new approach. That’s when various elements of the Universe conspired to lead me in a new direction.

因此,当需要进行一些不定期的编辑时,我知道我必须找到一种新的方法。 那时,宇宙的各个元素共同引导我迈向新的方向。

怎么样 (How)

金字塔 (Pyramid)

I spent a lot of time (~ 1 year) developing pythonpackages.com in Pyramid, but the result was a mess (code-wise). I’m in the process of rewriting and open sourcing it, but it’s slow going. So what better way to get started than to do a small-ish site in Pyramid for fun?

我花了很多时间(〜1年)在Pyramid中开发pythonpackages.com ,但结果却是一团糟(代码方面)。 我正在重写和开源它,但是进展缓慢。 那么,有什么比在Pyramid上做一个小型娱乐网站更好的入门方法呢?

关于我 (about.me)

I also recently gave in and created an about.me site. I was impressed by their content editing features, and my ability to create a page that looked OK using them.

最近,我也屈服并创建了一个about.me网站 。 他们的内容编辑功能和使用它们创建看起来不错的页面的能力给我留下了深刻的印象。

In my about.me profile, I used a picture of me and a picture of DC I took in early 2012. When it came time to redo aclark.net I felt like I really wanted to capture the simplicity of the about.me site, so I used the same photo in the background.

在我的about.me个人资料中,我使用了我的照片和我在2012年初拍摄的DC的照片。当需要重做aclark.net时,我觉得我真的很想捕捉about.me网站的简单性,所以我在后台使用了同一张照片。

引导程序 (Bootstrap)

Bootstrap is old news at this point, but I really enjoy using it and I particularly like that they have added more example templates. So I combined my background photo with one of their example templates and a new site idea was born. As I’m not a particularly talented visual artist, my ability to produce something that looked OK (with code this time) was exciting.

目前,Bootstrap是个老新闻,但我真的很喜欢使用它,我特别喜欢他们添加了更多示例模板。 因此,我将背景图片与他们的示例模板之一结合在一起,从而诞生了一个新的网站创意。 因为我不是一个特别有才华的视觉艺术家,所以我制作出看起来不错的东西(这次使用代码)的能力令人兴奋。

什么 (What)

Until I added a contact form, the site was entirely unremarkable. There are views and routes and templates, typical fare for a web framework. Here is the entire “main routine”:

在我添加联系表格之前,该网站完全不算什么。 有视图,路线和模板,这是Web框架的典型功能。 这是整个“主例程”:

 from from pyramid.session pyramid.session import import UnencryptedCookieSessionFactoryConfig
UnencryptedCookieSessionFactoryConfig
from from pyramid.config pyramid.config import import Configurator
Configurator
from from .redir .redir import import blog
blog
from from .redir .redir import import blog_entry
blog_entry
from from .redir .redir import import blog_slash
blog_slash
from from .views .views import import contact
contact
from from .views .views import import default
default
import import deform_bootstrap


deform_bootstrap


def def mainmain (( global_configglobal_config , , **** settingssettings ):
    ):
    """
"""
    Oppan wsgi style! Configure and return WSGI application.
    Oppan wsgi style! Configure and return WSGI application.
    """
        """
    my_session_factory my_session_factory = = UnencryptedCookieSessionFactoryConfigUnencryptedCookieSessionFactoryConfig (( 'itsaseekreet''itsaseekreet' )
    )
    config config = = ConfiguratorConfigurator (( session_factorysession_factory == my_session_factorymy_session_factory )
    )
    configconfig .. add_routeadd_route (( 'blog''blog' , , '/blog''/blog' )
    )
    configconfig .. add_routeadd_route (( 'blog_entry''blog_entry' , , '/blog/{entry:.*}''/blog/{entry:.*}' )
    )
    configconfig .. add_routeadd_route (( 'blog_slash''blog_slash' , , '/blog/''/blog/' )
    )
    configconfig .. add_routeadd_route (( 'contact''contact' , , '/contact''/contact' )
    )
    configconfig .. add_routeadd_route (( 'clients''clients' , , '/clients''/clients' )
    )
    configconfig .. add_routeadd_route (( 'projects''projects' , , '/projects''/projects' )
    )
    configconfig .. add_routeadd_route (( 'services''services' , , '/services''/services' )
    )
    configconfig .. add_routeadd_route (( 'team''team' , , '/team''/team' )
    )
    configconfig .. add_routeadd_route (( 'testimonials''testimonials' , , '/testimonials''/testimonials' )
    )
    configconfig .. add_routeadd_route (( 'root''root' , , '/''/' )
    )
    configconfig .. add_static_viewadd_static_view (
        (
        'static''static' , , 'aclarknet:static''aclarknet:static' , , cache_max_agecache_max_age == 36003600 )
    )
    configconfig .. add_viewadd_view (( blogblog , , route_nameroute_name == 'blog''blog' )
    )
    configconfig .. add_viewadd_view (( blog_entryblog_entry , , route_nameroute_name == 'blog_entry''blog_entry' )
    )
    configconfig .. add_viewadd_view (( blog_slashblog_slash , , route_nameroute_name == 'blog_slash''blog_slash' )
    )
    configconfig .. add_viewadd_view (
        (
        defaultdefault ,
        ,
        rendererrenderer == 'aclarknet:templates/clients.mak''aclarknet:templates/clients.mak' ,
        ,
        route_nameroute_name == 'clients''clients' )
    )
    configconfig .. add_viewadd_view (
        (
        contactcontact ,
        ,
        rendererrenderer == 'aclarknet:templates/contact.mak''aclarknet:templates/contact.mak' ,
        ,
        route_nameroute_name == 'contact''contact' )
    )
    configconfig .. add_viewadd_view (
        (
        defaultdefault ,
        ,
        rendererrenderer == 'aclarknet:templates/projects.mak''aclarknet:templates/projects.mak' ,
        ,
        route_nameroute_name == 'projects''projects' )
    )
    configconfig .. add_viewadd_view (
        (
        defaultdefault ,
        ,
        rendererrenderer == 'aclarknet:templates/root.mak''aclarknet:templates/root.mak' ,
        ,
        route_nameroute_name == 'root''root' )
    )
    configconfig .. add_viewadd_view (
        (
        defaultdefault ,
        ,
        rendererrenderer == 'aclarknet:templates/services.mak''aclarknet:templates/services.mak' ,
        ,
        route_nameroute_name == 'services''services' )
    )
    configconfig .. add_viewadd_view (
        (
        defaultdefault ,
        ,
        rendererrenderer == 'aclarknet:templates/testimonials.mak''aclarknet:templates/testimonials.mak' ,
        ,
        route_nameroute_name == 'testimonials''testimonials' )
    )
    configconfig .. add_viewadd_view (
        (
        defaultdefault ,
        ,
        rendererrenderer == 'aclarknet:templates/team.mak''aclarknet:templates/team.mak' ,
        ,
        route_nameroute_name == 'team''team' )
    )
    configconfig .. includeinclude (( deform_bootstrapdeform_bootstrap )
    )
    return return configconfig .. make_wsgi_appmake_wsgi_app ()
()

联系表 (Contact form)

But then I wanted a contact form. Which lead me to wanting an elegant way to send mail via Heroku. Which lead me to discover SendGrid. Which lead me create some primitive marketing features I am quite proud of and excited about.

但是后来我想要联系表格。 这导致我想通过一种优雅的方式通过Heroku发送邮件。 这导致我发现SendGrid 。 这使我创造了一些令我感到骄傲和激动的原始营销功能。

I still ended up sending mail “the old way” via GMail. But now I send two mails: one to info@aclark.net to alert our staff about the lead (using GMail). And one to the lead acknowledging their submission (using SendGrid). SendGrid keeps a record of all the leads we’ve contacted, amongst other “fancy marketing features”. Here’s the relevant view code:

我仍然最终通过GMail发送邮件“旧方法”。 但是现在我发了两封邮件:一封到info @ aclark 。 网络以提醒我们的员工有关线索(使用GMail)。 并率先确认他们的提交(使用SendGrid)。 SendGrid记录了我们已联系的所有潜在客户的记录,以及其他“精美的营销功能”。 这是相关的视图代码:

谁在乎 (Who cares)

The best thing about all of this being able to run the site 100% for free on Heroku. Also:

所有这些的最好的事情就是能够在Heroku上免费100%免费运行该网站。 也:

  • Python 3 compat!
  • Free caching via CloudFlare
  • Free ping service from Pingdom keeps the site from “going to sleep” (HT: natea).
  • Updating the site fits my workflow. If I’m the content editor, I don’t necessarily need or want to use Plone to edit my content. I can save Plone for my clients, and focus on what makes them happy with their CMS system.
  • Python 3兼容!
  • 通过CloudFlare免费缓存
  • Pingdom提供的免费ping服务可防止站点“入睡”(HT:natea)。
  • 更新网站适合我的工作流程。 如果我是内容编辑器,则不一定需要或不想使用Plone来编辑我的内容。 我可以为客户保存Plone,并专注于使他们对CMS系统满意的因素

翻译自: https://www.pybloggers.com/2013/04/new-pyramid-site/

高斯金字塔 拉普拉斯金字塔

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值