Why does python xmlrpc call get PermissionError when run through apache? - python

Here's /home/blakeh/test.py, which doesn't really do anything but illustrate the problem with minimal code:
#!/usr/local/bin/python3
import xmlrpc.client
if __name__ == "__main__":
client = xmlrpc.client.ServerProxy('http://localhost:8010')
client.foo()
If I run this directly as the apache user, there's no permission problem with making the RPC "foo" call. It only occurs if I run it through apache. I'm using python 3.5.2.
In an apache .conf file I have this:
ScriptAlias /test "/home/blakeh/test.py"
If I run this curl command:
curl -gix "" http://localhost/test
... I get an internal server error, with this appended to /var/log/httpd/error_log:
[Wed Jan 04 21:23:09 2017] [error] [client ::1] Traceback (most recent call last):
[Wed Jan 04 21:23:09 2017] [error] [client ::1] File "/home/blakeh/test.py", line 7, in <module>
[Wed Jan 04 21:23:09 2017] [error] [client ::1] client.foo()
[Wed Jan 04 21:23:09 2017] [error] [client ::1] File "/usr/local/lib/python3.5/xmlrpc/client.py", line 1092, in __call__
[Wed Jan 04 21:23:09 2017] [error] [client ::1] return self.__send(self.__name, args)
[Wed Jan 04 21:23:09 2017] [error] [client ::1] File "/usr/local/lib/python3.5/xmlrpc/client.py", line 1432, in __request
[Wed Jan 04 21:23:09 2017] [error] [client ::1] verbose=self.__verbose
[Wed Jan 04 21:23:09 2017] [error] [client ::1] File "/usr/local/lib/python3.5/xmlrpc/client.py", line 1134, in request
[Wed Jan 04 21:23:09 2017] [error] [client ::1] return self.single_request(host, handler, request_body, verbose)
[Wed Jan 04 21:23:09 2017] [error] [client ::1] File "/usr/local/lib/python3.5/xmlrpc/client.py", line 1146, in single_request
[Wed Jan 04 21:23:09 2017] [error] [client ::1] http_conn = self.send_request(host, handler, request_body, verbose)
[Wed Jan 04 21:23:09 2017] [error] [client ::1] File "/usr/local/lib/python3.5/xmlrpc/client.py", line 1259, in send_request
[Wed Jan 04 21:23:09 2017] [error] [client ::1] self.send_content(connection, request_body)
[Wed Jan 04 21:23:09 2017] [error] [client ::1] File "/usr/local/lib/python3.5/xmlrpc/client.py", line 1289, in send_content
[Wed Jan 04 21:23:09 2017] [error] [client ::1] connection.endheaders(request_body)
[Wed Jan 04 21:23:09 2017] [error] [client ::1] File "/usr/local/lib/python3.5/http/client.py", line 1102, in endheaders
[Wed Jan 04 21:23:09 2017] [error] [client ::1] self._send_output(message_body)
[Wed Jan 04 21:23:09 2017] [error] [client ::1] File "/usr/local/lib/python3.5/http/client.py", line 934, in _send_output
[Wed Jan 04 21:23:09 2017] [error] [client ::1] self.send(msg)
[Wed Jan 04 21:23:09 2017] [error] [client ::1] File "/usr/local/lib/python3.5/http/client.py", line 877, in send
[Wed Jan 04 21:23:09 2017] [error] [client ::1] self.connect()
[Wed Jan 04 21:23:09 2017] [error] [client ::1] File "/usr/local/lib/python3.5/http/client.py", line 849, in connect
[Wed Jan 04 21:23:09 2017] [error] [client ::1] (self.host,self.port), self.timeout, self.source_address)
[Wed Jan 04 21:23:09 2017] [error] [client ::1] File "/usr/local/lib/python3.5/socket.py", line 711, in create_connection
[Wed Jan 04 21:23:09 2017] [error] [client ::1] raise err
[Wed Jan 04 21:23:09 2017] [error] [client ::1] File "/usr/local/lib/python3.5/socket.py", line 702, in create_connection
[Wed Jan 04 21:23:09 2017] [error] [client ::1] sock.connect(sa)
[Wed Jan 04 21:23:09 2017] [error] [client ::1] PermissionError: [Errno 13] Permission denied
What could explain the difference in behavior? Thanks!

Velkan's suggestion to check selinux worked. I could get this working by putting it in permissive mode with "setenforce 0". Adding this as an "answer" so I can mark it as solved.

Related

Scipy Crashes on Apache Server

I have a Python 2.7 script using NLTK that runs fine on command prompt. When I ran it in a local Apache server on the same machine, it crashes and the error log shows "NotImplementedError: cannot determine number of cpus" while loading scipy. More detailed messages are shown below. Anyone else have the same problem?
.....
[Thu Aug 09 18:07:50 2018] [error] [client ::1] File "interpnd.pyx", line 1, in init scipy.interpolate.interpnd\r, referer: http://localhost/index.html
[Thu Aug 09 18:07:50 2018] [error] [client ::1] File "C:\Anaconda2\lib\site-packages\scipy\spatial\__init__.py", line 95, in \r, referer: http://localhost/index.html
[Thu Aug 09 18:07:50 2018] [error] [client ::1] from .ckdtree import *\r, referer: http://localhost/index.html
[Thu Aug 09 18:07:50 2018] [error] [client ::1] File "ckdtree.pyx", line 31, in init scipy.spatial.ckdtree\r, referer: http://localhost/index.html
[Thu Aug 09 18:07:50 2018] [error] [client ::1] File "C:\Anaconda2\lib\multiprocessing\__init__.py", line 136, in cpu_count\r, referer: http://localhost/index.html
[Thu Aug 09 18:07:50 2018] [error] [client ::1] raise NotImplementedError('cannot determine number of cpus')\r, referer: http://localhost/index.html
[Thu Aug 09 18:07:50 2018] [error] [client ::1] NotImplementedError: cannot determine number of cpus\r, referer: http://localhost/index.html

What causes Django to use 500.html only 3 out of 6 times?

This is the bizarre.
I have a 500.html template below. When I refer to a page that does not exist via the url, my 500.html will show three times (if I try to reload the page repeatedly), then I get the apache Internal Server Error three times. My broser keeps flipping between the two.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>Page unavailable</title>
</head>
<body>
<h1>Page unavailable</h1>
<p>Sorry, but the requested page is unavailable due to a
server hiccup.</p>
<p>Our engineers have been notified, so check back later.</p>
</body>
</html>
During the three times I get the Apache Internal Server Error, the error logs say 500.html does not exist - but it does. It pulled it up three times before.
I cleared the cache and tried a different browser with the same results.
Thanks for any help.
EDIT 1
Excerpt from error log:
[Tue Mar 05 22:28:22 2013] [error] [client 127.0.0.1] mod_python (pid=8262, interpreter='127.0.1.1', phase='PythonHandler', handler='django.core.handlers.modpython'): Application error
[Tue Mar 05 22:28:22 2013] [error] [client 127.0.0.1] ServerName: '127.0.1.1'
[Tue Mar 05 22:28:22 2013] [error] [client 127.0.0.1] DocumentRoot: '/var/www'
[Tue Mar 05 22:28:22 2013] [error] [client 127.0.0.1] URI: '/test'
[Tue Mar 05 22:28:22 2013] [error] [client 127.0.0.1] Location: '/test'
[Tue Mar 05 22:28:22 2013] [error] [client 127.0.0.1] Directory: None
[Tue Mar 05 22:28:22 2013] [error] [client 127.0.0.1] Filename: '/www/test/wsgi.py'
[Tue Mar 05 22:28:22 2013] [error] [client 127.0.0.1] PathInfo: ''
[Tue Mar 05 22:28:22 2013] [error] [client 127.0.0.1] Traceback (most recent call last):
[Tue Mar 05 22:28:22 2013] [error] [client 127.0.0.1] File "/usr/lib/python2.7/dist-packages/mod_python/importer.py", line 1537, in HandlerDispatch\n default=default_handler, arg=req, silent=hlist.silent)
[Tue Mar 05 22:28:22 2013] [error] [client 127.0.0.1] File "/usr/lib/python2.7/dist-packages/mod_python/importer.py", line 1229, in _process_target\n result = _execute_target(config, req, object, arg)
[Tue Mar 05 22:28:22 2013] [error] [client 127.0.0.1] File "/usr/lib/python2.7/dist-packages/mod_python/importer.py", line 1128, in _execute_target\n result = object(arg)
[Tue Mar 05 22:28:22 2013] [error] [client 127.0.0.1] File "/usr/lib/python2.7/dist-packages/django/core/handlers/modpython.py", line 180, in handler\n return ModPythonHandler()(req)
[Tue Mar 05 22:28:22 2013] [error] [client 127.0.0.1] File "/usr/lib/python2.7/dist-packages/django/core/handlers/modpython.py", line 158, in __call__\n response = self.get_response(request)
[Tue Mar 05 22:28:22 2013] [error] [client 127.0.0.1] File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py", line 153, in get_response\n response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
[Tue Mar 05 22:28:22 2013] [error] [client 127.0.0.1] File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py", line 228, in handle_uncaught_exception\n return callback(request, **param_dict)
[Tue Mar 05 22:28:22 2013] [error] [client 127.0.0.1] File "/usr/lib/python2.7/dist-packages/django/utils/decorators.py", line 91, in _wrapped_view\n response = view_func(request, *args, **kwargs)
[Tue Mar 05 22:28:22 2013] [error] [client 127.0.0.1] File "/usr/lib/python2.7/dist-packages/django/views/defaults.py", line 32, in server_error\n t = loader.get_template(template_name) # You need to create a 500.html template.
[Tue Mar 05 22:28:22 2013] [error] [client 127.0.0.1] File "/usr/lib/python2.7/dist-packages/django/template/loader.py", line 145, in get_template\n template, origin = find_template(template_name)
[Tue Mar 05 22:28:22 2013] [error] [client 127.0.0.1] File "/usr/lib/python2.7/dist-packages/django/template/loader.py", line 138, in find_template\n raise TemplateDoesNotExist(name)
[Tue Mar 05 22:28:22 2013] [error] [client 127.0.0.1] TemplateDoesNotExist: 500.html
I would try restarting apache. I've noticed inconsistencies in how urls are handled after any change. This sounds very similar to a problem I had when a url would sometimes load on refresh.

Flask framework on Openshift unable to load module

So I have created a flask application in OS from the OS quickstart on github. The app works great on my local system. when i push the app to OS it builds but I get an error 500 in the browser.
Any ideas or assistance would be appreciated.
Here is the source code from the application file:
#!/usr/bin/python import os
virtenv = os.environ['APPDIR'] + '/virtenv/'
os.environ['PYTHON_EGG_CACHE'] = os.path.join(virtenv, 'lib/python2.6/site-packages')
virtualenv = os.path.join(virtenv, 'bin/activate_this.py')
try:
execfile(virtualenv, dict(__file__=virtualenv))
except IOError:
pass
from run import app as application
Here is the source from the run.py file
from app import app
app.run(debug = True)
Here are the errors from the logs (Stripped the HASH ID for my site):
[Sun Aug 05 15:46:08 2012] [error] * Running on http://127.0.0.1:5000/
[Sun Aug 05 15:46:08 2012] [error] [client 127.3.153.129] mod_wsgi (pid=28484): Target WSGI script '/var/lib/stickshift/HASH-ID-HERE/app-root/runtime/repo/wsgi/application' cannot be loaded as Python module.
[Sun Aug 05 15:46:08 2012] [error] [client 127.3.153.129] mod_wsgi (pid=28484): Exception occurred processing WSGI script '/var/lib/stickshift/HASH-ID-HERE/app-root/runtime/repo/wsgi/application'.
[Sun Aug 05 15:46:08 2012] [error] [client 127.3.153.129] Traceback (most recent call last):
[Sun Aug 05 15:46:08 2012] [error] [client 127.3.153.129] File "/var/lib/stickshift/HASH-ID-HERE/app-root/runtime/repo/wsgi/application", line 13, in <module>
[Sun Aug 05 15:46:08 2012] [error] [client 127.3.153.129] from run import app as application
[Sun Aug 05 15:46:08 2012] [error] [client 127.3.153.129] File "/var/lib/stickshift/HASH-ID-HERE/app-root/runtime/repo/wsgi/run.py", line 2, in <module>
[Sun Aug 05 15:46:08 2012] [error] [client 127.3.153.129] app.run(debug = True)
[Sun Aug 05 15:46:08 2012] [error] [client 127.3.153.129] File "/var/lib/stickshift/HASH-ID-HERE/ws/virtenv/lib/python2.6/site-packages/Flask-0.9-py2.6.egg/flask/app.py", line 739, in run
[Sun Aug 05 15:46:08 2012] [error] [client 127.3.153.129] run_simple(host, port, self, **options)
[Sun Aug 05 15:46:08 2012] [error] [client 127.3.153.129] File "/var/lib/stickshift/HASH-ID-HERE/ws/virtenv/lib/python2.6/site-packages/Werkzeug-0.8.3-py2.6.egg/werkzeug/serving.py", line 613, in run_simple
[Sun Aug 05 15:46:08 2012] [error] [client 127.3.153.129] test_socket.bind((hostname, port))
[Sun Aug 05 15:46:08 2012] [error] [client 127.3.153.129] File "<string>", line 1, in bind
[Sun Aug 05 15:46:08 2012] [error] [client 127.3.153.129] error: [Errno 13] Permission denied
[Sun Aug 05 15:46:09 2012] [error] * Running on http://127.0.0.1:5000/
[Sun Aug 05 15:46:09 2012] [error] [client 127.3.153.129] mod_wsgi (pid=31302): Target WSGI script '/var/lib/stickshift/HASH-ID-HERE/app-root/runtime/repo/wsgi/application' cannot be loaded as Python module.
[Sun Aug 05 15:46:09 2012] [error] [client 127.3.153.129] mod_wsgi (pid=31302): Exception occurred processing WSGI script '/var/lib/stickshift/HASH-ID-HERE/app-root/runtime/repo/wsgi/application'.
[Sun Aug 05 15:46:09 2012] [error] [client 127.3.153.129] Traceback (most recent call last):
[Sun Aug 05 15:46:09 2012] [error] [client 127.3.153.129] File "/var/lib/stickshift/HASH-ID-HERE/app-root/runtime/repo/wsgi/application", line 13, in <module>
[Sun Aug 05 15:46:09 2012] [error] [client 127.3.153.129] from run import app as application
[Sun Aug 05 15:46:09 2012] [error] [client 127.3.153.129] File "/var/lib/stickshift/HASH-ID-HERE/app-root/runtime/repo/wsgi/run.py", line 2, in <module>
[Sun Aug 05 15:46:09 2012] [error] [client 127.3.153.129] app.run(debug = True)
[Sun Aug 05 15:46:09 2012] [error] [client 127.3.153.129] File "/var/lib/stickshift/HASH-ID-HERE/ws/virtenv/lib/python2.6/site-packages/Flask-0.9-py2.6.egg/flask/app.py", line 739, in run
[Sun Aug 05 15:46:09 2012] [error] [client 127.3.153.129] run_simple(host, port, self, **options)
[Sun Aug 05 15:46:09 2012] [error] [client 127.3.153.129] File "/var/lib/stickshift/HASH-ID-HERE/ws/virtenv/lib/python2.6/site-packages/Werkzeug-0.8.3-py2.6.egg/werkzeug/serving.py", line 613, in run_simple
[Sun Aug 05 15:46:09 2012] [error] [client 127.3.153.129] test_socket.bind((hostname, port))
[Sun Aug 05 15:46:09 2012] [error] [client 127.3.153.129] File "<string>", line 1, in bind
[Sun Aug 05 15:46:09 2012] [error] [client 127.3.153.129] error: [Errno 13] Permission denied
You should not be trying to run the Flask built in development server when hosting under mod_wsgi. Go back and check the mod_wsgi documentation in Flask as to what you are meant to be doing.
http://flask.pocoo.org/docs/deploying/mod_wsgi/
So I have finally figured out what was wrong with my code. I was missing a line in my run.py file so the incorrect file looked like this:
Incorrect file:
from app import app
app.run()
This is the corrected working file:
from app import app
if __name__ == "__main__": #Need this line for Openshift
app.run()
The if statement is apparently needed when deployed to production servers like Apache
Have you checked the following description from flask website at:
http://flask.pocoo.org/docs/deploying/mod_wsgi/#working-with-virtual-environments
Problem: application gives permission errors
Probably caused by your application running as the wrong user. Make sure the folders the application needs access to have the proper
privileges set and the application runs as the correct user (user and
group parameter to the WSGIDaemonProcess directive)

Django throws a 500 error

Dear Python/Django expert,
Due to recent server migration, my python-powered django app throws a 500 page. The log file is listed below. Can you please give me some help in diagnosing this problem?
==========================
[haiyang#web aihaiyang]$ tail ~/logs/user/error_django_aihaiyang_log
[Fri Jun 29 17:25:57 2012] [error] [client 127.0.0.1] return callback(request, **param_dict), referer: http://aihaiyang.com/synlex/syntactic/
[Fri Jun 29 17:25:57 2012] [error] [client 127.0.0.1] File "/home/haiyang/webapps/django_aihaiyang/lib/python2.5/django/utils/decorators.py", line 93, in _wrapped_view, referer: http://aihaiyang.com/synlex/syntactic/
[Fri Jun 29 17:25:57 2012] [error] [client 127.0.0.1] response = view_func(request, *args, **kwargs), referer: http://aihaiyang.com/synlex/syntactic/
[Fri Jun 29 17:25:57 2012] [error] [client 127.0.0.1] File "/home/haiyang/webapps/django_aihaiyang/lib/python2.5/django/views/defaults.py", line 30, in server_error, referer: http://aihaiyang.com/synlex/syntactic/
[Fri Jun 29 17:25:57 2012] [error] [client 127.0.0.1] t = loader.get_template(template_name) # You need to create a 500.html template., referer: http://aihaiyang.com/synlex/syntactic/
[Fri Jun 29 17:25:57 2012] [error] [client 127.0.0.1] File "/home/haiyang/webapps/django_aihaiyang/lib/python2.5/django/template/loader.py", line 157, in get_template, referer: http://aihaiyang.com/synlex/syntactic/
[Fri Jun 29 17:25:57 2012] [error] [client 127.0.0.1] template, origin = find_template(template_name), referer: http://aihaiyang.com/synlex/syntactic/
[Fri Jun 29 17:25:57 2012] [error] [client 127.0.0.1] File "/home/haiyang/webapps/django_aihaiyang/lib/python2.5/django/template/loader.py", line 138, in find_template, referer: http://aihaiyang.com/synlex/syntactic/
[Fri Jun 29 17:25:57 2012] [error] [client 127.0.0.1] raise TemplateDoesNotExist(name), referer: http://aihaiyang.com/synlex/syntactic/
[Fri Jun 29 17:25:57 2012] [error] [client 127.0.0.1] TemplateDoesNotExist: 500.html, referer: http://aihaiyang.com/synlex/syntactic/
=========================
Thanks,
Haiyang
You need to create a 500.html template and put it in your template_dir
Template does not exist: 500.html

Django OSError: [Errno 13] Permission denied: 'static'

I tried almost for a week, but could not solve this problem, and could not find anything online, that can help me.
I have a multi-domain server with Centos 5.3, and a Django project, I must deploy. I installed python 2.7 to /usr/local/python2.7 for Django 1.3 to work, also installed and enabled mod_wsgi.
Next, what I did, was checkout this project, and create virtualenv in home directory of user, who will own this application. I created wsgi script:
import os
import sys
import site
# path to domain specific virtual environment where python packages will be installed
site.addsitedir('/home/user/domain.com/project/env/lib/python2.7/site-packages')
sys.path.append('/home/user/domain.com/project/')
sys.path.append('/home/user/domain.com/project/application/')
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
from django.core.handlers.wsgi import WSGIHandler
application = WSGIHandler()
and configured virtualhost.
<VirtualHost \
79.98.31.117:80\
>
ServerName masinis.lt
ServerAlias \
www.masinis.lt
DocumentRoot "/home/user/domain.com/"
WSGIScriptAlias / /home/user/domain.com/project/wsgi_script.wsgi
<Directory "/home/tomas/masinis.lt/liveopenly/">
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
Alias /static/ /home/user/domain.com/project/application/static/
<Directory "/home/user/domain.com/project/application/static/">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
What I call project, is actually a folder for virtualenv, instructions and application itself.Application in this case is django project - it has apps, settings and other stuff inside. Also it uses external applications, that are stored in virtualenv folder.
When I try to get to domain.com, I get 500 error. And error_log gives me this:
[Mon Feb 27 00:40:10 2012] [error] [client 78.63.254.43] mod_wsgi (pid=11655): Exception occurred processing WSGI script '/home/user/domain.com/project/masinis_lt.wsgi'.
[Mon Feb 27 00:40:10 2012] [error] [client 78.63.254.43] Traceback (most recent call last):
[Mon Feb 27 00:40:10 2012] [error] [client 78.63.254.43] File "/home/user/domain.com/project/env/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 273, in __call__
[Mon Feb 27 00:40:10 2012] [error] [client 78.63.254.43] response = self.get_response(request)
[Mon Feb 27 00:40:10 2012] [error] [client 78.63.254.43] File "/home/user/domain.com/project/env/lib/python2.7/site-packages/django/core/handlers/base.py", line 169, in get_response
[Mon Feb 27 00:40:10 2012] [error] [client 78.63.254.43] response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
[Mon Feb 27 00:40:10 2012] [error] [client 78.63.254.43] File "/home/user/domain.com/project/env/lib/python2.7/site-packages/django/core/handlers/base.py", line 218, in handle_uncaught_exception
[Mon Feb 27 00:40:10 2012] [error] [client 78.63.254.43] return callback(request, **param_dict)
[Mon Feb 27 00:40:10 2012] [error] [client 78.63.254.43] File "/home/user/domain.com/project/application/middleware.py", line 44, in server_error
[Mon Feb 27 00:40:10 2012] [error] [client 78.63.254.43] return HttpResponseServerError(t.render(Context({'MEDIA_URL': settings.MEDIA_URL})))
[Mon Feb 27 00:40:10 2012] [error] [client 78.63.254.43] File "/home/user/domain.com/project/env/lib/python2.7/site-packages/django/template/base.py", line 123, in render
[Mon Feb 27 00:40:10 2012] [error] [client 78.63.254.43] return self._render(context)
[Mon Feb 27 00:40:10 2012] [error] [client 78.63.254.43] File "/home/user/domain.com/project/env/lib/python2.7/site-packages/django/template/base.py", line 117, in _render
[Mon Feb 27 00:40:10 2012] [error] [client 78.63.254.43] return self.nodelist.render(context)
[Mon Feb 27 00:40:10 2012] [error] [client 78.63.254.43] File "/home/user/domain.com/project/env/lib/python2.7/site-packages/django/template/base.py", line 744, in render
[Mon Feb 27 00:40:10 2012] [error] [client 78.63.254.43] bits.append(self.render_node(node, context))
[Mon Feb 27 00:40:10 2012] [error] [client 78.63.254.43] File "/home/user/domain.com/project/env/lib/python2.7/site-packages/django/template/base.py", line 757, in render_node
[Mon Feb 27 00:40:10 2012] [error] [client 78.63.254.43] return node.render(context)
[Mon Feb 27 00:40:10 2012] [error] [client 78.63.254.43] File "/home/user/domain.com/project/env/lib/python2.7/site-packages/django/template/loader_tags.py", line 127, in render
[Mon Feb 27 00:40:10 2012] [error] [client 78.63.254.43] return compiled_parent._render(context)
[Mon Feb 27 00:40:10 2012] [error] [client 78.63.254.43] File "/home/user/domain.com/project/env/lib/python2.7/site-packages/django/template/base.py", line 117, in _render
[Mon Feb 27 00:40:10 2012] [error] [client 78.63.254.43] return self.nodelist.render(context)
[Mon Feb 27 00:40:10 2012] [error] [client 78.63.254.43] File "/home/user/domain.com/project/env/lib/python2.7/site-packages/django/template/base.py", line 744, in render
[Mon Feb 27 00:40:10 2012] [error] [client 78.63.254.43] bits.append(self.render_node(node, context))
[Mon Feb 27 00:40:10 2012] [error] [client 78.63.254.43] File "/home/user/domain.com/project/env/lib/python2.7/site-packages/django/template/base.py", line 757, in render_node
[Mon Feb 27 00:40:10 2012] [error] [client 78.63.254.43] return node.render(context)
[Mon Feb 27 00:40:10 2012] [error] [client 78.63.254.43] File "/home/user/domain.com/project/env/lib/python2.7/site-packages/django/template/loader_tags.py", line 127, in render
[Mon Feb 27 00:40:10 2012] [error] [client 78.63.254.43] return compiled_parent._render(context)
[Mon Feb 27 00:40:10 2012] [error] [client 78.63.254.43] File "/home/user/domain.com/project/env/lib/python2.7/site-packages/django/template/base.py", line 117, in _render
[Mon Feb 27 00:40:10 2012] [error] [client 78.63.254.43] return self.nodelist.render(context)
[Mon Feb 27 00:40:10 2012] [error] [client 78.63.254.43] File "/home/user/domain.com/project/env/lib/python2.7/site-packages/django/template/base.py", line 744, in render
[Mon Feb 27 00:40:10 2012] [error] [client 78.63.254.43] bits.append(self.render_node(node, context))
[Mon Feb 27 00:40:10 2012] [error] [client 78.63.254.43] File "/home/user/domain.com/project/env/lib/python2.7/site-packages/django/template/base.py", line 757, in render_node
[Mon Feb 27 00:40:10 2012] [error] [client 78.63.254.43] return node.render(context)
[Mon Feb 27 00:40:10 2012] [error] [client 78.63.254.43] File "/home/user/domain.com/project/env/lib/python2.7/site-packages/django_static/templatetags/django_static.py", line 208, in render
[Mon Feb 27 00:40:10 2012] [error] [client 78.63.254.43] symlink_if_possible=self.symlink_if_possible)
[Mon Feb 27 00:40:10 2012] [error] [client 78.63.254.43] File "/home/user/domain.com/project/env/lib/python2.7/site-packages/django_static/templatetags/django_static.py", line 493, in _static_file
[Mon Feb 27 00:40:10 2012] [error] [client 78.63.254.43] _mkdir(os.path.dirname(new_filepath))
[Mon Feb 27 00:40:10 2012] [error] [client 78.63.254.43] File "/home/user/domain.com/project/env/lib/python2.7/site-packages/django_static/templatetags/django_static.py", line 624, in _mkdir
[Mon Feb 27 00:40:10 2012] [error] [client 78.63.254.43] _mkdir(head)
[Mon Feb 27 00:40:10 2012] [error] [client 78.63.254.43] File "/home/user/domain.com/project/env/lib/python2.7/site-packages/django_static/templatetags/django_static.py", line 624, in _mkdir
[Mon Feb 27 00:40:10 2012] [error] [client 78.63.254.43] _mkdir(head)
[Mon Feb 27 00:40:10 2012] [error] [client 78.63.254.43] File "/home/user/domain.com/project/env/lib/python2.7/site-packages/django_static/templatetags/django_static.py", line 626, in _mkdir
[Mon Feb 27 00:40:10 2012] [error] [client 78.63.254.43] os.mkdir(newdir)
[Mon Feb 27 00:40:10 2012] [error] [client 78.63.254.43] OSError: [Errno 13] Permission denied: 'static'
When I try to run in development mode (manage.py runserver), everything running, but it looks, like static file are not found, when accessing the page. While server log shows 302 response...
What could be the problem?

Categories