python的线上环境配置
1.安装python 2.7 http://www.cnblogs.com/strikebone/p/3970512.html
2.安装相关前置工具 pip, Django
http://www.cnblogs.com/strikebone/p/3958897.html
3.安装mysql的组件 http://www.cnblogs.com/strikebone/p/3975372.html
4.安装apxs, mod_wsgi
yum install httpd-devel.x86_64
wget https://github.com/GrahamDumpleton/mod_wsgi/archive/4.3.0.tar.gz
4.搞定apache的配置
在Apache配置文件httpd.conf中,增加一行:
LoadModule wsgi_module modules/mod_wsgi.so
<VirtualHost *:9000>
ServerName 127.0.0.1
DocumentRoot /home/q/abc/firstsite
WSGIScriptAlias / /home/q/abc/apache/django.wsgi
<Directory />
Order deny,allow
Allow from all
</Directory>
<Directory /home/q/abc/firstsite/static>
Allow from all
</Directory>
alias /static/ /home/q/abc/firstsite/static/
</VirtualHost>
遇到问题可以参考这个文章:
http://abloz.com/2012/10/26/compile-and-install-apache-python-module-mod_wsgi.html
问题:访问500,看apache错误日志:Exception occurred processing WSGI script '/var/www/server/apache/django.wsgi'.
AppRegistryNotReady: The translation infrastructure cannot be initialized before the apps registry is ready. Check that you don't make non-lazy gettext calls at import time.
问题解决:
from
django.core.wsgi
import
get_wsgi_application
application
=
get_wsgi_application()
最新文章
- 数据上下文【 DnContext】【EF基础系列7】
- Android 实现分页(使用TabWidget/TabHost)
- hihocoder-平衡树&#183;SBT
- 最全面的Java多线程用法解析
- mybatis系列-16-spring和mybatis整合
- WS103C8例程——串口2【worldsing笔记】
- Linux如何用QQ?Linux下QQ使用的几种方案
- HDU-------An Easy Task
- 安卓EditText按钮
- 使用EntityFramework中DbSet.Set(Type entityType)方法碰到的问题
- select2 取值 遍历 设置默认值
- UITableViewStyleGrouped模式下多余间距
- 07Axios
- promise在angular中的基本使用
- yii js
- zabbix3.x自动发现主机
- VMware Workstation 安装 mac OS 时遇到 不可恢复错误: (vcpu-0)
- 专访UI中国认证设计师卤大湿 | 一位UI大师关于UI设计的思考
- Spring事务传播属性介绍(二).mandatory、not_supported、never、supports
- 项目中遇到的问题——jsp:include