Am in a problem when deoply my django web app to local apache server,its worked in Development server. My project name is 'DjangoApis'
project's structure : home/ji/Desktop/testcloud/DjangoApis/
__init__.py
django.wsgi
settings.py
manage.py
urls.py
mywebapp
--> __init__.py
--> static
--> templates
--> urls.py
--> views.py
myapis ( create it as a project itself)
--> __init__.py
--> manage.py
--->....
settings.py:
INSTALLED_APPS = (
'DjangoApis.mywebapp',
'DjangoApis.myapis',
)
django.wsgi:
**
import os
import sys
path = '/home/ji/Desktop/testcloud.aws'
if path not in sys.path:
sys.path.append(path)
os.environ['DJANGO_SETTINGS_MODULE'] = 'DjangoApis.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
**
urls.py in Project folder(DjangoApis):
urlpatterns = patterns('',
url(r'^admin/', include(admin.site.urls)),
)
urlpatterns = patterns('',
(r'^api/', include('DjangoApis.myapis.url')),
(r'^', include('DjangoApis.mywebapp.urls')),
)
/etc/apache2/sites-enabled
VirtualHost *:80
ServerName test.webapp
DocumentRoot /home/ji/Desktop/testcloud/DjangoApis
<Directory /home/ji/Desktop/testcloud/DjangoApis>
Order allow,deny
Allow from all
</Directory>
WSGIDaemonProcess test.webapp processes=2 threads=15 display-name=%{GROUP}
WSGIProcessGroup test.webapp
WSGIScriptAlias / /home/ji/Desktop/testcloud/DjangoApis/django.wsgi
/VirtualHost
when I run in browser< I got Internal Server Error.
error log:
tail /var/log/apache2/error.log
[Thu Dec 08 06:26:32 2011] [error] [client 127.0.0.1] default_translation = _fetch(settings.LANGUAGE_CODE)
[Thu Dec 08 06:26:32 2011] [error] [client 127.0.0.1] File "/usr/lib/pymodules/python2.7/django/utils/translation/trans_real.py", line 162, in _fetch
[Thu Dec 08 06:26:32 2011] [error] [client 127.0.0.1] app = import_module(appname)
[Thu Dec 08 06:26:32 2011] [error] [client 127.0.0.1] File "/usr/lib/pymodules/python2.7/django/utils/importlib.py", line 35, in import_module
[Thu Dec 08 06:26:32 2011] [error] [client 127.0.0.1] __import__(name)
[Thu Dec 08 06:26:32 2011] [error] [client 127.0.0.1] TemplateSyntaxError: Caught ImportError while rendering: No module named myapis
[Thu Dec 08 17:56:46 2011] [notice] SIGUSR1 received. Doing graceful restart
[Thu Dec 08 17:56:46 2011] [warn] mod_wsgi: Compiled for Python/2.7.2rc1.
[Thu Dec 08 17:56:46 2011] [warn] mod_wsgi: Runtime using Python/2.7.2+.
[Thu Dec 08 17:56:46 2011] [notice] Apache/2.2.20 (Ubuntu) mod_wsgi/3.3 Python/2.7.2+ configured -- resuming normal operations
Note: Am using django piston.Please help me to rectify the problem,Thanks in advance.