2

我尝试了夹层,并为此感到兴奋。将其部署到 ubuntu 服务器 + apache2 + mod_wsgi。但我无法插入图像,看不到浏览窗口。当我尝试访问 /gallery/ 时,总是发生错误。我是新手,很绝望,请帮忙。

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配置文件

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
 }

我失败的测试网站:http : //www.globalunicom.com admin/@richard

我尝试直接在服务器上安装夹层。运行 apache2 服务器和 mysql。httpd.conf 和 wsgi.py 保持不变。不幸的是 /gallery 和 admin 无法上传图片。只是这一次,得到了另一个问题,如下所示。好像我不能使用一个缩略图

我是这个地区的新手。我非常感谢您所做的所有努力。非常感谢!我希望我能采取下一步行动,请指导我详细说明您将要提到的所有内容(一步一步)。提前致谢。

Firefox 浏览器 FileSystemEncodingChanged 在 /gallery/

尝试访问路径中包含 unicode 字符的文件,但不知何故,当前语言环境不支持 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小路:

['/home/webapp/test5/test5', '/home/webapp/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 日星期日 23:33:21 +0800

4

1 回答 1

1

尝试将此添加到您的 http.conf

Alias /gallery /your/route/to/gallery/in/your/file/system

<Directory /your/route/to/gallery/in/your/file/system
Order deny,allow
Allow from all
</Directory>
于 2012-08-12T03:15:56.540 回答