1
Debian 6 시스템에서 Apache2 mod_wsgi를 사용하여 장고 프로젝트를 실행하려고합니다. 이 프로젝트는 개발 서버로이 프로젝트를 시작하면 잘 실행됩니다. 하지만 이제이 오류가 발생합니다 :모듈 이름이 없습니다. 장고에있는 mod_wsgi의 URL은 무엇입니까?
Exception Type: ImportError at/
Exception Value: No module named urls
내 프로젝트 이름은 genalytics입니다. fileupload라는 앱이 하나뿐입니다.
Listen 8000
<VirtualHost *:8000>
ServerName NFS
DocumentRoot /opt/genalytics
WSGIScriptAlias//opt/genalytics/genalytics/wsgi.py
<Directory /opt/genalytics/genalytics>
Order allow,deny
Allow from all
</Directory>
Alias /static /opt/genalytics/fileupload/static
</VirtualHost>
wsgi.py : 아파치의 httpd.conf의
genalytics/
├── fileupload
│ ├── backend.py
│ ├── backend.pyc
│ ├── backends.py
│ ├── backends.pyc
│ ├── django.wsgi
│ ├── encrypt.py
│ ├── encrypt.pyc
│ ├── forms.py
│ ├── forms.pyc
│ ├── functions.py
│ ├── functions.pyc
│ ├── __init__.py
│ ├── __init__.pyc
│ ├── middleware.py
│ ├── middleware.pyc
│ ├── models.py
│ ├── models.pyc
│ ├── static
│ │ ├── admin
│ │ │ ├── css
│ │ │ │ ├── base.css
│ │ │ │ ├── changelists.css
│ │ │ │ ├── dashboard.css
│ │ │ │ ├── forms.css
│ │ │ │ ├── ie.css
│ │ │ │ ├── login.css
│ │ │ │ ├── rtl.css
│ │ │ │ └── widgets.css
│ │ │ ├── img
│ │ │ │ ├── changelist-bg.gif
│ │ │ │ ├── changelist-bg_rtl.gif
│ │ │ │ ├── chooser-bg.gif
│ │ │ │ ├── tool-right.gif
│ │ │ │ ├── tool-right_over.gif
│ │ │ │ ├── tooltag-add.gif
│ │ │ │ ├── tooltag-add_over.gif
│ │ │ │ ├── tooltag-arrowright.gif
│ │ │ │ └── tooltag-arrowright_over.gif
│ │ │ └── js
│ │ │ ├── actions.js
│ │ │ ├── actions.min.js
│ │ │ ├── admin
│ │ │ │ ├── DateTimeShortcuts.js
│ │ │ │ ├── ordering.js
│ │ │ │ └── RelatedObjectLookups.js
│ │ │ ├── calendar.js
│ │ │ ├── collapse.js
│ │ │ └── urlify.js
│ │ ├── css
│ │ │ ├── datepicker.css
│ │ │ ├── datePicker.css
│ │ │ ├── jquery-ui.css~
│ │ │ ├── pro_dropline.css
│ │ │ ├── pro_dropline_ie.css
│ │ │ ├── screen.css
│ │ │ └── screen.css~
│ │ ├── endless_pagination
│ │ │ └── js
│ │ │ ├── endless.js
│ │ │ ├── endless_on_scroll.js
│ │ │ └── endless-pagination.js
│ │ │ ├── transfer.png
│ │ │ ├── ui-icons_454545_256x240.png
│ │ │ ├── upload.png
│ │ │ └── up.png
│ │ ├── js
│ │ │ ├── endless-pagination.js
│ │ │ ├── jquery
│ │ │ │ ├── Copy of custom_jquery.js
│ │ │ │ ├── custom_jquery.js
│ │ │ │ ├── date.js
│ │ │ │ ├── jquery-1.4.1.min.js
│ │ │ │ ├── jquery.bind.js
│ │ │ │ ├── jquery.datePicker.js
│ │ │ │ ├── jquery.dimensions.js
│ │ │ │ ├── jquery.filestyle.js
│ │ │ │ ├── jquery.pngFix.pack.js
│ │ │ │ ├── jquery.selectbox-0.5.js
│ │ │ │ ├── jquery.selectbox-0.5_style_2.js
│ │ │ │ ├── jquery.selectbox-0.5_style_3.js
│ │ │ │ ├── jquery.tablesorter.js
│ │ │ │ ├── jquery.tooltip.js
│ │ │ │ ├── jquery.usermode.js
│ │ │ │ ├── ui.checkbox.js
│ │ │ │ └── ui.core.js
│ │ │ ├── jquery-1.9.1.js
│ │ │ ├── jquery.js
│ │ │ ├── jquery-latest.js
│ │ │ ├── jquery.pajinate.js
│ │ │ ├── jquery.tablesorter.js
│ │ │ ├── jquery-ui-1.10.3.custom.min.js
│ │ │ ├── test.js~
│ │ │ └── transfer.js
│ │ ├── login.css
│ │ ├── PIE.htc
│ │ ├── style.css
│ │ └── style.css~
│ ├── svn-commit.tmp
│ ├── tasks.py
│ ├── tasks.py~
│ ├── tasks.pyc
│ ├── templates
│ │ ├── ajax.html
│ │ ├── base.html
│ │ ├── create_session.html
│ │ ├── create_session.html~
│ │ ├── deleted_files.html
│ │ ├── edit_session.html
│ │ ├── file_info.html
│ │ ├── footer.html
│ │ ├── forgot_password.html
│ │ ├── form.html
│ │ ├── header.html
│ │ ├── list_files.html
│ │ ├── list_session.html
│ │ ├── list_session.html~
│ │ ├── login_backend.html
│ │ ├── message_forgot.html
│ │ ├── nav.html
│ │ ├── new_password.html
│ │ ├── notify.html
│ │ ├── overview.html
│ │ ├── overview.html~
│ │ ├── password_successful.html
│ │ ├── reform.html
│ │ ├── registration
│ │ │ ├── password_reset_complete.html
│ │ │ ├── password_reset_confirm.html
│ │ │ ├── password_reset_done.html
│ │ │ ├── password_reset_email.html
│ │ │ └── password_reset_form.html
│ │ ├── right.html
│ │ ├── search_result.html
│ │ ├── shared_by_me.html
│ │ ├── shared_with_me.html
│ │ ├── style.css
│ │ ├── synced.html
│ │ ├── test.html
│ │ ├── test.html~
│ │ ├── thanks.html
│ │ ├── uploaded_files.html
│ │ ├── uploaded_files.html~
│ │ └── uploaded_notify.html
│ ├── tests.py
│ ├── views.py
│ ├── views.py~
│ └── views.pyc
├── genalytics
│ ├── __init__.py
│ ├── __init__.pyc
│ ├── settings.py
│ ├── settings.py~
│ ├── settings.pyc
│ ├── urls.py
│ ├── urls.pyc
│ ├── wsgi.py
│ ├── wsgi.py~
│ └── wsgi.pyc
└── manage.py
내용 : 여기
ROOT_URLCONF = 'genalytics.urls'
내 프로젝트의 트리 구조입니다 : 내 settings.py에 사용할 수있다 콘텐츠 :
import os
import sys
sys.path.append('/opt/genalytics')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "genalytics.settings")
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
장고 1.5. 고맙습니다!
당신이 응용 프로그램에 대한 가상 환경을 사용하고 있습니다. –
아파치 로그를 확인 하시겠습니까? virtualenv를 사용하고 있다면 wsgi 파일에서 virtualenv 경로를 추가해야합니다. –
오, 죄송합니다. 저는 virtualenv를 사용하지 않는다고 말했습니다. – pynovice