WebFaction
Community site: login faq

I am running the photologue django app, it creates thumbnails of images on the fly and needs to write to the static media server. I have a Symbolic link to static-only app as my static media server - as per webfaction documentation. How do I grant the Django app write access to the static app?

I am assuming this is the problem, the exact error is: Caught OSError while rendering: [Errno 13] Permission denied: /<homedir>

Thanks,

Andrew

Traceback: File "/home/cwpd/webapps/wl_django/lib/python2.6/django/core/handlers/base.py" in get_response 100. response = callback(request, callback_args, callback_kwargs) File "/home/cwpd/webapps/wl_django/myproject/views.py" in search_photos 28. return render_to_response('photologue/photo_list_searched.html', {'object_list': returned_list}) File "/home/cwpd/webapps/wl_django/lib/python2.6/django/shortcuts/init.py" in render_to_response 20. return HttpResponse(loader.render_to_string(*args, kwargs), httpresponse_kwargs) File "/home/cwpd/webapps/wl_django/lib/python2.6/django/template/loader.py" in render_to_string 186. return t.render(context_instance) File "/home/cwpd/webapps/wl_django/lib/python2.6/django/template/init.py" in render 173. return self.render(context) File "/home/cwpd/webapps/wl_django/lib/python2.6/django/template/_init.py" in render 167. return self.nodelist.render(context) File "/home/cwpd/webapps/wl_django/lib/python2.6/django/template/_init.py" in render 796. bits.append(self.render_node(node, context)) File "/home/cwpd/webapps/wl_django/lib/python2.6/django/template/debug.py" in render_node 72. result = node.render(context) File "/home/cwpd/webapps/wl_django/lib/python2.6/django/template/loader_tags.py" in render 125. return compiled_parent.render(context) File "/home/cwpd/webapps/wl_django/lib/python2.6/django/template/_init.py" in render 167. return self.nodelist.render(context) File "/home/cwpd/webapps/wl_django/lib/python2.6/django/template/_init.py" in render 796. bits.append(self.render_node(node, context)) File "/home/cwpd/webapps/wl_django/lib/python2.6/django/template/debug.py" in render_node 72. result = node.render(context) File "/home/cwpd/webapps/wl_django/lib/python2.6/django/template/loader_tags.py" in render 125. return compiled_parent.render(context) File "/home/cwpd/webapps/wl_django/lib/python2.6/django/template/_init.py" in render 167. return self.nodelist.render(context) File "/home/cwpd/webapps/wl_django/lib/python2.6/django/template/_init.py" in render 796. bits.append(self.render_node(node, context)) File "/home/cwpd/webapps/wl_django/lib/python2.6/django/template/debug.py" in render_node 72. result = node.render(context) File "/home/cwpd/webapps/wl_django/lib/python2.6/django/template/loader_tags.py" in render 62. result = block.nodelist.render(context) File "/home/cwpd/webapps/wl_django/lib/python2.6/django/template/init.py" in render 796. bits.append(self.render_node(node, context)) File "/home/cwpd/webapps/wl_django/lib/python2.6/django/template/debug.py" in render_node 72. result = node.render(context) File "/home/cwpd/webapps/wl_django/lib/python2.6/django/template/defaulttags.py" in render 258. return self.nodelist_true.render(context) File "/home/cwpd/webapps/wl_django/lib/python2.6/django/template/init.py" in render 796. bits.append(self.render_node(node, context)) File "/home/cwpd/webapps/wl_django/lib/python2.6/django/template/debug.py" in render_node 72. result = node.render(context) File "/home/cwpd/webapps/wl_django/lib/python2.6/django/template/defaulttags.py" in render 174. nodelist.append(node.render(context)) File "/home/cwpd/webapps/wl_django/lib/python2.6/django/template/debug.py" in render 89. output = self.filter_expression.resolve(context) File "/home/cwpd/webapps/wl_django/lib/python2.6/django/template/init.py" in resolve 553. obj = self.var.resolve(context) File "/home/cwpd/webapps/wl_django/lib/python2.6/django/template/init.py" in resolve 696. value = self.resolve_lookup(context) File "/home/cwpd/webapps/wl_django/lib/python2.6/django/template/_init.py" in _resolve_lookup 731. current = current() File "/home/cwpd/webapps/wl_django/lib/python2.6/django/utils/functional.py" in _curried 55. return _curried_func(*(args+moreargs), dict(kwargs, *morekwargs)) File "/home/cwpd/webapps/wl_django/lib/python2.6/photologue/models.py" in _get_SIZE_url 309. self.create_size(photosize) File "/home/cwpd/webapps/wl_django/lib/python2.6/photologue/models.py" in create_size 385. os.makedirs(self.cache_path()) File "/usr/local/lib/python2.6/os.py" in makedirs 150. makedirs(head, mode) File "/usr/local/lib/python2.6/os.py" in makedirs 150. makedirs(head, mode) File "/usr/local/lib/python2.6/os.py" in makedirs 150. makedirs(head, mode) File "/usr/local/lib/python2.6/os.py" in makedirs 150. makedirs(head, mode) File "/usr/local/lib/python2.6/os.py" in makedirs 157. mkdir(name, mode)

asked 05 Jan '11, 18:21

Andrew G
111
accept rate: 0%

Fixed it, my bad. Had MEDIA_ROOT = 'cwpd/webapps/wl_static/' when it should have been MEDIA_ROOT = '/home/cwpd/webapps/wl_static/'

(06 Jan '11, 18:02) Andrew G

Hi,

It looks like the problem here is that you have the MEDIA_ROOT or STATIC_ROOT set to your /home/user directory instead of set to the full directory of the symlink directory.

Also you may need to configure Photologue to use the correct directory.

Django does this to try to protect from tree traversal attacks.

permanent link

answered 05 Jan '11, 18:38

klynton
1.6k1210
accept rate: 41%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×909
×125
×64
×22

question asked: 05 Jan '11, 18:21

question was seen: 5,958 times

last updated: 06 Jan '11, 18:02

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM