2010-04-21 4 views
1

글쎄, 지금 몇 일 동안이 주위를 걷고있다 ... 나는 도움을 요청할 시간이라고 생각한다. 설치가 정상이라고 생각한다. 서버 OS : Centos 5 Python -v 2.6.5 장고 -v (1, 1, 1, '최종', 0) Django 배포 문제

내 아파치의 conf :

<VirtualHost *:80> 
    DocumentRoot /opt/workshop 
    ServerName taller.antell.com.py 
    WSGIScriptAlias//opt/workshop/workshop.wsgi 
    WSGIDaemonProcess taller.antell.com.py user=ignacio group=ignacio processes=2 threads=25 
    ErrorLog /opt/workshop/apache.error.log 
    CustomLog /opt/workshop/apache.custom.log combined 

    <Directory "/opt/workshop"> 
      Options +ExecCGI +FollowSymLinks -Indexes -MultiViews 
      AllowOverride All 
      Order allow,deny 
      Allow from all 
    </Directory> 
</VirtualHost> 

내 mod_wsgi에의 conf :

import os 
import sys 

sys.path.append('/opt/workshop') 

os.environ['DJANGO_SETTINGS_MODULE'] = 'workshop.settings' 
os.environ['PYTHON_EGG_CACHE'] = '/tmp/.python-eggs' 

import django.core.handlers.wsgi 
application = django.core.handlers.wsgi.WSGIHandler() 

오류 나는 내 아파치 오류 로그에 받고 있어요 것은 :

[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122] mod_wsgi (pid=11459): Exception occurred processing WSGI script '/opt/workshop/workshop.wsgi'. 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122] Traceback (most recent call last): 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122] File "/opt/python2.6/lib/python2.6/site-packages/django/core/handlers/wsgi.py", line 241, in __call__ 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122]  response = self.get_response(request) 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122] File "/opt/python2.6/lib/python2.6/site-packages/django/core/handlers/base.py", line 134, in get_response 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122]  return self.handle_uncaught_exception(request, resolver, exc_info) 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122] File "/opt/python2.6/lib/python2.6/site-packages/django/core/handlers/base.py", line 154, in handle_uncaught_exception 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122]  return debug.technical_500_response(request, *exc_info) 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122] File "/opt/python2.6/lib/python2.6/site-packages/django/views/debug.py", line 40, in technical_500_response 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122]  html = reporter.get_traceback_html() 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122] File "/opt/python2.6/lib/python2.6/site-packages/django/views/debug.py", line 114, in get_traceback_html 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122]  return t.render(c) 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122] File "/opt/python2.6/lib/python2.6/site-packages/django/template/__init__.py", line 178, in render 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122]  return self.nodelist.render(context) 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122] File "/opt/python2.6/lib/python2.6/site-packages/django/template/__init__.py", line 779, in render 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122]  bits.append(self.render_node(node, context)) 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122] File "/opt/python2.6/lib/python2.6/site-packages/django/template/debug.py", line 81, in render_node 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122]  raise wrapped 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122] TemplateSyntaxError: Caught an exception while rendering: No module named vehicles 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122] 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122] Original Traceback (most recent call last): 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122] File "/opt/python2.6/lib/python2.6/site-packages/django/template/debug.py", line 71, in render_node 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122]  result = node.render(context) 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122] File "/opt/python2.6/lib/python2.6/site-packages/django/template/debug.py", line 87, in render 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122]  output = force_unicode(self.filter_expression.resolve(context)) 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122] File "/opt/python2.6/lib/python2.6/site-packages/django/template/__init__.py", line 572, in resolve 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122]  new_obj = func(obj, *arg_vals) 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122] File "/opt/python2.6/lib/python2.6/site-packages/django/template/defaultfilters.py", line 687, in date 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122]  return format(value, arg) 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122] File "/opt/python2.6/lib/python2.6/site-packages/django/utils/dateformat.py", line 269, in format 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122]  return df.format(format_string) 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122] File "/opt/python2.6/lib/python2.6/site-packages/django/utils/dateformat.py", line 30, in format 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122]  pieces.append(force_unicode(getattr(self, piece)())) 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122] File "/opt/python2.6/lib/python2.6/site-packages/django/utils/dateformat.py", line 175, in r 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122]  return self.format('D, j M Y H:i:s O') 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122] File "/opt/python2.6/lib/python2.6/site-packages/django/utils/dateformat.py", line 30, in format 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122]  pieces.append(force_unicode(getattr(self, piece)())) 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122] File "/opt/python2.6/lib/python2.6/site-packages/django/utils/encoding.py", line 71, in force_unicode 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122]  s = unicode(s) 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122] File "/opt/python2.6/lib/python2.6/site-packages/django/utils/functional.py", line 201, in __unicode_cast 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122]  return self.__func(*self.__args, **self.__kw) 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122] File "/opt/python2.6/lib/python2.6/site-packages/django/utils/translation/__init__.py", line 62, in ugettext 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122]  return real_ugettext(message) 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122] File "/opt/python2.6/lib/python2.6/site-packages/django/utils/translation/trans_real.py", line 286, in ugettext 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122]  return do_translate(message, 'ugettext') 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122] File "/opt/python2.6/lib/python2.6/site-packages/django/utils/translation/trans_real.py", line 276, in do_translate 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122]  _default = translation(settings.LANGUAGE_CODE) 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122] File "/opt/python2.6/lib/python2.6/site-packages/django/utils/translation/trans_real.py", line 194, in translation 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122]  default_translation = _fetch(settings.LANGUAGE_CODE) 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122] File "/opt/python2.6/lib/python2.6/site-packages/django/utils/translation/trans_real.py", line 180, in _fetch 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122]  app = import_module(appname) 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122] File "/opt/python2.6/lib/python2.6/site-packages/django/utils/importlib.py", line 35, in import_module 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122]  __import__(name) 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122] ImportError: No module named vehicles 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122] 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122] mod_wsgi (pid=11463): Exception occurred processing WSGI script '/opt/workshop/workshop.wsgi'. 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122] Traceback (most recent call last): 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122] File "/opt/python2.6/lib/python2.6/site-packages/django/core/handlers/wsgi.py", line 241, in __call__ 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122]  response = self.get_response(request) 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122] File "/opt/python2.6/lib/python2.6/site-packages/django/core/handlers/base.py", line 73, in get_response 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122]  response = middleware_method(request) 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122] File "/opt/python2.6/lib/python2.6/site-packages/django/middleware/common.py", line 56, in process_request 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122]  if (not _is_valid_path(request.path_info) and 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122] File "/opt/python2.6/lib/python2.6/site-packages/django/middleware/common.py", line 142, in _is_valid_path 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122]  urlresolvers.resolve(path) 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122] File "/opt/python2.6/lib/python2.6/site-packages/django/core/urlresolvers.py", line 303, in resolve 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122]  return get_resolver(urlconf).resolve(path) 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122] File "/opt/python2.6/lib/python2.6/site-packages/django/core/urlresolvers.py", line 218, in resolve 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122]  sub_match = pattern.resolve(new_path) 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122] File "/opt/python2.6/lib/python2.6/site-packages/django/core/urlresolvers.py", line 216, in resolve 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122]  for pattern in self.url_patterns: 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122] File "/opt/python2.6/lib/python2.6/site-packages/django/core/urlresolvers.py", line 245, in _get_url_patterns 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122]  patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122] File "/opt/python2.6/lib/python2.6/site-packages/django/core/urlresolvers.py", line 240, in _get_urlconf_module 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122]  self._urlconf_module = import_module(self.urlconf_name) 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122] File "/opt/python2.6/lib/python2.6/site-packages/django/utils/importlib.py", line 35, in import_module 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122]  __import__(name) 
[Wed Apr 21 15:17:48 2010] [error] [client 190.128.226.122] ImportError: No module named vehicles.urls 

은 분명히 내 차량 모듈 (응용 프로그램의 하나)에 문제가있다, 내가 갇혀 ... 내 손을주십시오, 또 다른 한가지는 때 내가 시도 :

[[email protected] workshop]# python manage.py runserver 0:8000 
응용 완벽하게 실행

, 난 문제가 뭔가를 클릭하지 않는 WSGI의 conf에 가까운 일이라고 생각 ....

TKS ...

업데이트 :DIR 디렉토리의 모습워크샵 ...

[[email protected] workshop]# ls -l 
total 504 
-rw-r--r-- 1 root root 22706 Apr 21 15:17 apache.custom.log 
-rw-r--r-- 1 root root 408141 Apr 21 15:17 apache.error.log 
-rw-r--r-- 1 root root  0 Apr 17 10:56 __init__.py 
-rw-r--r-- 1 root root 124 Apr 21 11:09 __init__.pyc 
-rw-r--r-- 1 root root 542 Apr 17 10:56 manage.py 
-rw-r--r-- 1 root root 3326 Apr 17 10:56 settings.py 
-rw-r--r-- 1 root root 2522 Apr 21 11:09 settings.pyc 
drw-r--r-- 4 root root 4096 Apr 17 10:56 templates 
-rw-r--r-- 1 root root 381 Apr 21 13:42 urls.py 
-rw-r--r-- 1 root root 398 Apr 21 13:00 urls.pyc 
drw-r--r-- 2 root root 4096 Apr 21 13:44 vehicles 
-rw-r--r-- 1 root root 38912 Apr 17 10:56 workshop.db 
-rw-r--r-- 1 root root 263 Apr 21 15:30 workshop.wsgi 

차량은

[[email protected] vehicles]# ls -l 
total 52 
-rw-r--r-- 1 root root 390 Apr 17 10:56 admin.py 
-rw-r--r-- 1 root root 967 Apr 21 13:00 admin.pyc 
-rw-r--r-- 1 root root 732 Apr 17 10:56 forms.py 
-rw-r--r-- 1 root root 2086 Apr 21 13:00 forms.pyc 
-rw-r--r-- 1 root root 0 Apr 17 10:56 __init__.py 
-rw-r--r-- 1 root root 133 Apr 21 11:36 __init__.pyc 
-rw-r--r-- 1 root root 936 Apr 17 10:56 models.py 
-rw-r--r-- 1 root root 1827 Apr 21 11:36 models.pyc 
-rw-r--r-- 1 root root 514 Apr 17 10:56 tests.py 
-rw-r--r-- 1 root root 989 Apr 21 13:44 tests.pyc 
-rw-r--r-- 1 root root 1035 Apr 17 10:56 urls.py 
-rw-r--r-- 1 root root 1935 Apr 21 13:00 urls.pyc 
-rw-r--r-- 1 root root 3164 Apr 17 10:56 views.py 
-rw-r--r-- 1 root root 4081 Apr 21 13:00 views.pyc 

업데이트 2 :이

# Django settings for workshop project. 

DEBUG = True 
TEMPLATE_DEBUG = DEBUG 

ADMINS = (
    ('Ignacio Rojas', '[email protected]'), 
    ('Fabian Biedermann', '[email protected]'), 
) 

MANAGERS = ADMINS 

DATABASE_ENGINE = 'sqlite3' 
DATABASE_NAME = '/opt/workshop/workshop.db' 
DATABASE_USER = '' 
DATABASE_PASSWORD = '' 
DATABASE_HOST = '' 
DATABASE_PORT = '' 

# Local time zone for this installation. Choices can be found here: 
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name 
# although not all choices may be available on all operating systems. 
# If running in a Windows environment this must be set to the same as your 
# system time zone. 
TIME_ZONE = 'America/Asuncion' 

# Language code for this installation. All choices can be found here: 
# http://www.i18nguy.com/unicode/language-identifiers.html 
LANGUAGE_CODE = 'es-py' 

SITE_ID = 1 

# If you set this to False, Django will make some optimizations so as not 
# to load the internationalization machinery. 
USE_I18N = True 

# Absolute path to the directory that holds media. 
# Example: "/home/media/media.lawrence.com/" 
MEDIA_ROOT = '' 

# URL that handles the media served from MEDIA_ROOT. Make sure to use a 
# trailing slash if there is a path component (optional in other cases). 
# Examples: "http://media.lawrence.com", "http://example.com/media/" 
MEDIA_URL = '' 

# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a 
# trailing slash. 
# Examples: "http://foo.com/media/", "/media/". 
ADMIN_MEDIA_PREFIX = '/media/' 

# Make this unique, and don't share it with anybody. 
SECRET_KEY = '11y0_jb=+b4^[email protected]#g$-ihk5*v&[email protected]*9$w8jalp' 

MIDDLEWARE_CLASSES = (
    'django.middleware.common.CommonMiddleware', 
    'django.contrib.sessions.middleware.SessionMiddleware', 
    'django.contrib.auth.middleware.AuthenticationMiddleware', 
) 

ROOT_URLCONF = 'workshop.urls' 

TEMPLATE_DIRS = (
    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". 
    # Always use forward slashes, even on Windows. 
    # Don't forget to use absolute paths, not relative paths. 
    "/opt/workshop/templates" 
) 

INSTALLED_APPS = (
    'django.contrib.admin', 
    'django.contrib.auth', 
    'django.contrib.contenttypes', 
    'django.contrib.sessions', 
    'django.contrib.sites', 
    'workshop.vehicles', 
) 

TEMPLATE_CONTEXT_PROCESSORS = (
    'django.core.context_processors.auth', 
    'django.core.context_processors.debug', 
    'django.core.context_processors.i18n', 
    'django.core.context_processors.media', 
) 

이의 시험에 출력하는 것입니다 내 settings.py입니다 : http://blog.dscpl.com.au/2010/03/improved-wsgi-script-for-use-with.html

__name__ = settings 
__file__ = /opt/django/workshop/settings.pyc 
os.getpid() = 7207 
os.getcwd() = /opt/django/workshop 
os.curdir = . 
sys.path = ['/opt/django', '/opt/django/workshop', '/opt/django/workshop', '/opt/python2.6/lib/python26.zip', '/opt/python2.6/lib/python2.6', '/opt/python2.6/lib/python2.6/plat-linux2', '/opt/python2.6/lib/python2.6/lib-tk', '/opt/python2.6/lib/python2.6/lib-old', '/opt/python2.6/lib/python2.6/lib-dynload', '/opt/python2.6/lib/python2.6/site-packages'] 
sys.modules.keys() = ['copy_reg', 'encodings', 'site', '__builtin__', '__main__', 'encodings.encodings', 'abc', 'posixpath', 'errno', 'encodings.codecs', '_abcoll', 'types', '_codecs', '_warnings', 'genericpath', 'stat', 'zipimport', 'encodings.__builtin__', 'warnings', 'UserDict', 'encodings.utf_8', 'sys', 'codecs', 'os.path', 'settings', 'signal', 'linecache', 'posix', 'encodings.aliases', 'exceptions', 'os'] 
sys.modules.has_key('workshop') = False 
__name__ = workshop.settings 
__file__ = /opt/django/workshop/settings.pyc 
os.getpid() = 7207 
os.getcwd() = /opt/django/workshop 
os.curdir = . 
sys.path = ['/opt/django', '/opt/django/workshop', '/opt/django/workshop', '/opt/python2.6/lib/python26.zip', '/opt/python2.6/lib/python2.6', '/opt/python2.6/lib/python2.6/plat-linux2', '/opt/python2.6/lib/python2.6/lib-tk', '/opt/python2.6/lib/python2.6/lib-old', '/opt/python2.6/lib/python2.6/lib-dynload', '/opt/python2.6/lib/python2.6/site-packages'] 
sys.modules.keys() = ['django.core.exceptions', 'django.core.management.django', 'copy_reg', 'sre_compile', 'django.conf.os', 'locale', '_sre', 'functools', 'encodings', 'django.conf.global_settings', 'site', '__builtin__', 'django.core.management', 'django.core.management.sys', 'django.utils.functional', '__main__', 'operator', 'encodings.encodings', 'django.utils.re', 'django.core.management.imp', 'django.core.management.color', 'abc', 'posixpath', 'django.utils', 'imp', 'errno', 'encodings.codecs', 'gettext', 'sre_constants', 'django.conf', 're', '_abcoll', 'types', 'django.utils.importlib', '_codecs', 'django.core.management.optparse', 'django.core.management.base', '_struct', '_warnings', 'django.conf.django', 'genericpath', 'stat', 'zipimport', 'encodings.__builtin__', 'string', 'django.utils.termcolors', 'warnings', 'optparse', 'UserDict', 'struct', 'encodings.utf_8', 'django.utils.sys', 'textwrap', 'sys', 'django.django', 'codecs', 'django.utils.version', 'django.utils.os', 'copy', 'workshop.settings', 'os.path', 'strop', '_functools', '_locale', 'django.conf.time', 'django.conf.re', 'workshop.sys', 'settings', 'workshop', 'signal', 'django.core', 'django.utils.django', 'django', 'django.core.management.os', 'linecache', 'posix', 'encodings.aliases', 'time', 'exceptions', 'sre_parse', 'os', 'workshop.os'] 
sys.modules.has_key('workshop') = True 
sys.modules['wokshop'].__name__ = workshop 
sys.modules['workshop'].__file__ = /opt/django/workshop/__init__.pyc 
os.environ['DJANGO_SETTINGS_MODULE'] = workshop.settings 

새로운 WSGI :

import sys 

sys.path.insert(0, '/opt/django/workshop') 
sys.path.insert(0, '/opt/django') 

import settings 

import django.core.management 
django.core.management.setup_environ(settings) 
utility = django.core.management.ManagementUtility() 
command = utility.fetch_command('runserver') 

command.validate() 

import django.conf 
import django.utils 

django.utils.translation.activate(django.conf.settings.LANGUAGE_CODE) 

import django.core.handlers.wsgi 

application = django.core.handlers.wsgi.WSGIHandler() 

함께 해결 :

chmod -R 755 workshop && chown -R apache:apache workshop 
+0

디렉토리 구조를 표시 할 수 있습니까? 특히, 실제 앱을 포함하고있는'workshop' 디렉토리의 두 번째'workshop' 디렉토리가있을 가능성이 있습니까? –

+0

-rw-r-r-- 1 루트 루트 apache.custom.log -rw-r-r-- 1 루트 루트 apache.error.log -rw-r-r-- 1 루트 루트 __init__ .py -rw-r-r-- 1 루트 루트 __init __. pyc -rw-r-r-- 1 루트 루트 manage.py -rw-r-r-- 1 루트 루트 settings.py -rw-r-r-- 1 루트 루트 설정 .pyc drw-r-r-- 4 루트 루트 템플릿 -rw-r-r-- 1 루트 루트 urls.py -rw-r --r-- 1 루트 루트 urls.pyc drw-r-r-- 2 루트 루트 차량 -rw-r-r-- 1 루트 루트 workshop.db -rw-r-r-- –

+0

'ls -1'을 사용하여 그것을 평평하게하고, 우리가 볼 수 있도록 질문을 편집하십시오. 주석 때문에 서식이 잘못되었습니다. –

답변

4

시도는 settings.py 파일과이 들어있는 디렉토리를 모두 추가 (... 미디어, 템플릿 등) 그렇지 않으면 나머지 파이썬 애플리케이션을 혼합 할 것이기 때문에 옵션 3 걸릴 것이다 상위 디렉토리에서 sys.path. 더 나은 방법은 'http://blog.dscpl.com.au/2010/03/improved-wsgi-script-for-use-with.html'을 읽고 끝에 오른쪽에 설명 된 WSGI 스크립트 파일 내용을 사용하십시오 (문제가 발생한 이유에 대한 게시물을 읽은 후에). :-)


당신이 'DRW-R - r--로 2 개 루트 루트 차량'로 권한을 게시 다른 의견에

UPDATE 1.

'x'비트가 디렉토리에 설정되어 있지 않습니다. 그러면 디렉터리에 무엇이 있는지 확인하기 위해 디렉터리 목록을 생성 할 수 있어야하는 모든 항목이 실패하게됩니다.

즉, 모든 디렉터리 사용 권한을 살펴보고 'drwxr-xr-x'로 수정하십시오.

또한 루트가 디렉토리를 소유 했으므로 응용 프로그램이 디렉토리에 쓸 필요가 있으면이를 수행 할 수 없습니다.

요약하면 디렉터리/파일 사용 권한 문제.

+0

그것은 다소 당황 스럽지만 chmod-R 755 워크샵 && chown -R apache : 아파치 워크샵이 사건을 해결했습니다 ... 모두들 감사합니다! –

+0

남자, 이것으로 하루가 절약되었습니다. 완전히 다른 문제. 감사합니다. – Ulf

0

내 생각 엔 경로가이 아니라면 당신은 sys.path.append('/opt/workshop/workshop') 을해야하고 실제로 WSGI 파일에 따라서 /opt/workshop/workshop/

때문이다 대신 workshop.settings이 (가) settings이어야합니다.

[편집] 내가 보는 방법에는 3 가지 옵션이 있습니다.

  1. sys에 opt을 추가하십시오.경로 그래서 workshop.urls 및 작업 (나쁜 생각이 이럴 opt 이후 anything`는
  2. workshop에 파이썬 코드를 이동 (또는 뭔가 다른) 디렉토리 (수 있도록
  3. 모든 경로에서 workshop 제거를 포함 할 수 있는지 그것은 __init__.py)
  4. 을 포함

는 개인적으로 나는

+0

/opt/workshop/workshop /이 될 수 없거나 아파치는'ls'을 수행 한 디렉토리에 로그를 출력하지 않을 것입니다. –

+0

나는 그것이 후자라고 생각한다./opt/workshop이 시스템 경로에 있으면/opt/workshop/workshop 디렉토리 구조가 실제로 작동합니다. 적어도 설정 모듈은 workshop.settings에 있습니다. –

+0

그게 사실입니다 잭 M. 그 경우 그것은 지금 그것을 죽이는 설정 일 것입니다 :) – Wolph