我尝试了夹层,并对此感到兴奋。将其部署到ubuntu服务器+ apache2 + mod_wsgi。 但我无法插入图像,无法看到浏览窗口。 当我尝试访问/ gallery /时,总是发生错误。 我是新的和绝望的,请给予帮助。使用Apache2部署夹层时发生错误
WSGI.PY
import os, sys, site
sys.stdout = sys.stderr
# Add the virtual Python environment site-packages directory to the path
ve_path = '/home/webapp/richardeng/lib/python2.7/site-packages'
site.addsitedir(ve_path)
# put the Django project on sys.path
sys.path.insert(0, ve_path)
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), ".")))
# Avoid ``[Errno 13] Permission denied: '/var/www/.python-eggs'`` messages
os.environ['PYTHON_EGG_CACHE'] = '/tmp'
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
from django.core.handlers.wsgi import WSGIHandler
HTTPD.CONF
WSGIScriptAlias//home/webapp/richardeng/project/wsgi.py
WSGIPythonPath /home/webapp/richardeng/lib/python2.7/site-packages
Alias /static/ /home/webapp/richardeng/project/static/
<Directory /home/webapp/richardeng/project/static>
Order deny,allow
Allow from all
</Directory>
<Directory /home/webapp/richardeng/project>
<Files wsgi.py>
Order deny,allow
Allow from all
</Files>
</Directory>
我用以下结构:
FABRIC = {
"SSH_USER": "vagrant", # SSH username
"SSH_PASS": "vagrant", # SSH password (consider key-based authentication)
"SSH_KEY_PATH": "", # Local path to SSH key file, for key-based auth
"HOSTS": ["192.168.124.12", ], # List of hosts to deploy to
"VIRTUALENV_HOME": "/home/vagrant", # Absolute remote path for virtualenvs
"PROJECT_NAME": "mymezz", # Unique identifier for project
"REQUIREMENTS_PATH": "requirements/project.txt", # Path to pip requirements, relative to project
"GUNICORN_PORT": 8000, # Port gunicorn will listen on
"LOCALE": "en_US.UTF-8", # Should end with ".UTF-8"
"LIVE_HOSTNAME": "192.168.124.12", # Host for public site.
"REPO_URL": "git://github.com/nimbis/mezzanine-project.git", # Git or Mercurial remote repo URL for the project
"DB_PASS": "password", # Live database password
"ADMIN_PASS": "default", # Live admin user password
}
我的失败测试Web:http://www.globalunicom.com管理员/ @理查德
我试着直接在服务器上安装夹层。运行apache2服务器和mysql。 httpd.conf和wsgi.py保持不变。 不幸的是,图片库和管理员无法实现上传图片。只有这一次,又得到了另一个问题如下。似乎我不能使用一个缩略图
我是这方面的新手。我非常感谢你们所做出的所有努力。非常感谢你! 我希望我可以采取下一步行动,请详细指导我(婴儿一步)关于你即将提到的一切。提前致谢。
Firefox浏览器 /FileSystemEncodingChanged在/画廊试图
访问是在包含其路径中的Unicode字符的文件,但不知何故,当前的locale不支持UTF-8。您可能需要将“LC_ALL”设置为正确的值,例如:'en_US.UTF-8'。
请求方法:GET 请求URL:http://www.globalunicom.com/gallery/ Django的版本:1.4.1 异常类型:FileSystemEncodingChanged 异常值:试图
访问是在包含其路径中的Unicode字符的文件,但不知何故当前的区域设置不支持utf-8。您可能需要将“LC_ALL”设置为正确的值,例如:'en_US.UTF-8'。
异常地点:/home/webapp/test5/lib/python2.7/site-packages/mezzanine/core/templatetags/mezzanine_tags.py缩略图,线244 Python的可执行文件:在/ usr/bin中/ Python的 的Python版本:2.7.3 Python的路径:
[ '/家庭/ web应用/ TEST5/TEST5', '/家庭/ web应用/ TEST5', “/home/webapp/test5/lib/python2.7/ site-packages/setuptools-0.6c11-py2.7.egg', '/home/webapp/test5/lib/python2.7/site-packages/pip-1.1-py2.7.egg', '/ home /webapp/test5/lib/python2.7/site-packages', '/usr/local/lib/python2.7/dist-packages/pip- 1.1-py2.7.egg', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-linux2', '/usr/lib/python2.7/lib- tk', '/usr/lib/python2.7/lib-old', '/ usr/lib/python2。7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/ usr/lib/pymodules/python2.7' ]
服务器时间:星期日,2012年8月12日二十三时33分21秒+0800
你能在你的错误日志看并发布你得到的实际错误?它是否也正确使用dev服务器运行?是否安装了PIL? 夹层是一个很好的选择。 – joshcartme 2012-08-10 06:25:40
您的应用程序将以Apache用户身份运行。该用户是否具有所需的所有目录/文件所需的访问权限,包括如果要将文件存储到文件系统中则可以编写该文件? – 2012-08-11 04:49:20