免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
楼主: aixcradent

Python Web框架大比拼 [复制链接]

论坛徽章:
0
发表于 2012-03-26 14:21 |显示全部楼层
skywalk163 发表于 2012-03-24 22:48
hehe ,小的用webpy,大的用pylons
这个世界就ok了


善! 不知道现在Pyramid怎样了. 这个[小]和[大]的意义非凡!

论坛徽章:
4
CU大牛徽章
日期:2013-03-13 15:29:07CU大牛徽章
日期:2013-03-13 15:29:49CU大牛徽章
日期:2013-03-13 15:30:192015年迎新春徽章
日期:2015-03-04 09:57:09
发表于 2012-03-30 00:38 |显示全部楼层
投了 django 和 web.py ,django可以说比较臃肿了,其实flask真心不错。

论坛徽章:
0
发表于 2012-04-01 16:15 |显示全部楼层
大家有关于Web框架的资料文档或是开源项目代码吗?欢迎分享!

论坛徽章:
0
发表于 2012-05-02 16:24 |显示全部楼层
回复 3# zyd320


    哪里的python社区比较火啊,帮忙推荐几个。

论坛徽章:
0
发表于 2012-05-02 16:26 |显示全部楼层
本帖最后由 ygl23 于 2012-05-02 16:29 编辑

有没有用过 Nginx + UWSGI + Django 搭建python高性能WEB服务器环境


1、平台环境说明
   1.1、项目位置:/opt/www/Purgesys
    创建项目方法:


cd /opt/www
django-admin.py startproject Purgesys


  1.2、查看项目(出现以下文件结构说明项目已创建成功)
   #tree Purgesys


Purgesys
|-- __init__.py
|-- manage.py
|-- settings.py
`-- urls.py

2、 启动应用
python manage.py runserver

正常访问 http://127.0.0.1:8000/  


3、创建应用模块
cd /opt/www/Purgesys
vi django.py

import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'Purgesys.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()

    uwsgi 启动应用
uwsgi -s : 9000 -w django.py

错误信息:

*** Starting uWSGI 1.2-rc3 (64bit) on [Wed May  2 11:43:10 2012] ***
compiled with version: 4.1.2 20080704 (Red Hat 4.1.2-4 on 01 May 2012 14:16:56
detected number of CPU cores: 2
current working directory: /opt/osqa/Purgesys
detected binary path: /usr/sbin/uwsgi
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
*** WARNING: you are running uWSGI without its master process manager ***
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
uwsgi socket 0 bound to TCP address :36530 (port auto-assigned) fd 3
Python version: 2.5.1 (r251:54863, May  1 2012, 14:14:04)  [GCC 4.1.2 20080704 (Red Hat 4.1.2-4]
*** Python threads support is disabled. You can enable it with --enable-threads ***
Python main interpreter initialized at 0x798fa80
your server socket listen backlog is limited to 100 connections
*** Operational MODE: single process ***
  File "./django.py", line 2
    os.environ['DJANGO_SETTINGS_MODULE'] = 'Purgesys.settings'
    ^
IndentationError: unexpected indent
unable to load app 0 (mountpoint='') (callable not found or import error)
*** no app loaded. going in full dynamic mode ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI worker 1 (and the only) (pid: 29694, cores: 1)

向各位大虾请教,这是什么原因,如何解决?

论坛徽章:
2
CU十二周年纪念徽章
日期:2013-10-24 15:41:34IT运维版块每日发帖之星
日期:2016-07-04 06:20:00
发表于 2012-05-03 11:02 |显示全部楼层
回复 15# ygl23


            uwsgi 启动应用
uwsgi -s : 9000 -w django.py

改下启动的参数,试试:
uwsgi -s :9000  --wsgi-file django.py

论坛徽章:
0
发表于 2012-05-10 10:28 |显示全部楼层
正打算学习  看看结果

论坛徽章:
0
发表于 2012-05-17 22:01 |显示全部楼层
大家看怎么样 我认为很好.

论坛徽章:
0
发表于 2012-05-22 13:34 |显示全部楼层
Tornado

论坛徽章:
13
15-16赛季CBA联赛之同曦
日期:2016-01-28 19:52:032015亚冠之北京国安
日期:2015-10-07 14:28:19NBA常规赛纪念章
日期:2015-05-04 22:32:03处女座
日期:2015-01-15 19:45:44卯兔
日期:2014-10-28 16:17:14白羊座
日期:2014-05-24 15:10:46寅虎
日期:2014-05-10 09:50:35白羊座
日期:2014-03-12 20:52:17午马
日期:2014-03-01 08:37:27射手座
日期:2014-02-19 19:26:54子鼠
日期:2013-11-30 09:03:56狮子座
日期:2013-09-08 08:37:52
发表于 2012-06-15 17:51 |显示全部楼层
Django @_@
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP