error in file reading after deploy with mod_wsgi
Hi,
in my views.py i have the following code:
from django.http import HttpResponse
def index(request):
fp = open('public/index.html')
html = fp.read()
fp.close()
return HttpResponse(html)
this works fine when i use "python manage.py runserver", and the page
serves up ok.
but when i deploy it with apache + mod_wsgi, on that particular fp
line, i will get the exception of:
Request Method: GET
Request URL: http://localhost/test/
Django Version: 1.1.1
Python Version: 2.6.1
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware')
Traceback:
File "/Library/Python/2.6/site-packages/django/core/handlers/base.py"
in get_response
92. response = callback(request, *callback_args,
**callback_kwargs)
File "/Users/test/views.py" in index
4. fp = open('public/index.html')
Exception Type: IOError at /test/
Exception Value: (2, 'No such file or directory')
any idea why i will run into this problem?
Thanks!
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home