zoukankan      html  css  js  c++  java
  • pyramid setup(修改版)

    pyramid setup
    参考

    http://docs.pylonsproject.org/en/latest/docs/pyramid.html

    今天是2012-03-12
    讲的都是安装好Python2.7,以及在ubuntu操作系统下面:
    1.首先装Pyramid,
    测试语句import setuptools,没有ImportError错误,ok。有错误,先装setuptools。下载ez_setup.py,然后执行语句python ez_setup.py。


    2.然后装virtualenv,
    用语句easy_install virtualenv

    3.用virtualenv创建Virtual Python Environment,
    virtualenv --no-site-packages env
    这个语句会创建一个env文件夹,这是一个Virtual Python Environment


    4.其次把Pyramid2.7装进Virtual Python Environment。
    cd env
    bin/easy_install pyramid

    5.执行测试代码,如下helloworld.py

    from wsgiref.simple_server import make_server
    from pyramid.config import Configurator
    from pyramid.response import Response

    def hello_world(request):
       return Response('Hello %(name)s!' % request.matchdict)

    if __name__ == '__main__':
       config = Configurator()
       config.add_route('hello''/hello/{name}')
       config.add_view(hello_world, route_name='hello')
       app = config.make_wsgi_app()
       server = make_server('0.0.0.0', 8080, app)
       server.serve_forever()
      

    /path/to/your/virtualenv/bin/python helloworld.py
    用浏览器访问http://localhost:8080/hello/world ,ok


    合乎自然而生生不息。。。
  • 相关阅读:
    sql 变量赋值
    mysql 行号 获取指定行数据
    SQL Server获取指定行的数据
    sql server 创建内联表值函数
    sql server 表变量存储临时查询数据
    sql server 循环操作
    oracle for in 学习
    oracle C# 访问
    sql server insert values 多值 与oracle 的不同
    mysql 如何选择随机行
  • 原文地址:https://www.cnblogs.com/samwu/p/2392269.html
Copyright © 2011-2022 走看看