First time here? Check out the FAQ!
0

SuspiciousOperation: Attempted access to ... error when trying collectstatic

I am adding a new skin in my home directory. For simplicity, I copied media and template files from askbot source code to check if am able to plugin a new skin.

So my skin dir looks like this

/home/joey/custom/my_skin/
...media/
......... images jquery-openid js style
...templates/

Following are the changes done to settings.py

ASKBOT_EXTRA_SKINS_DIR = '/home/joey/custom/'
STATICFILES_DIRS = ((os.path.join(ASKBOT_ROOT, 'skins'), ASKBOT_EXTRA_SKINS_DIR),)

When I run python manage.py collectstatic I am seeing:

SuspiciousOperation: Attempted access to '/home/joey/mysite/askbot/skins/my_skin/media/js/output-words.html' denied.

If I delete that file, I am seeing

SuspiciousOperation: Attempted access to '/home/joey/mysite/askbot/skins/my_skin/media/bootstrap/css/bootstrap.min.css' denied.

I am able to runserver but without css. It's only html..kindly help

File permissions:

drwxrwxrwx 5 joey joey 4096 Dec 10 08:38 js
drwxrwxrwx 3 joey joey 4096 Dec 10 08:38 jquery-openid
drwxrwxrwx 5 joey joey 4096 Dec 10 08:38 images
drwxrwxrwx 3 joey joey 4096 Dec 10 08:38 style
Joey's avatar
31
Joey
asked 2013-12-12 14:59:54 -0600, updated 2013-12-12 15:28:18 -0600
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

0

Have a look at the file and directory access permissions to those files, including any directories along the path leading to those files.

I don't know where that specific error comes from, maybe it is system dependent, but it appears to be simply a file access error.

Evgeny's avatar
13.2k
Evgeny
answered 2013-12-12 15:10:09 -0600
edit flag offensive 0 remove flag delete link

Comments

Hi, It is python error: Have a look at this "stackoverflow.com/questions/1950069/suspicious-operation-django".. I checked the file permissions and they are all ok.

Joey's avatar Joey (2013-12-12 15:15:07 -0600) edit

I have updated the question to include file permissions as well

Joey's avatar Joey (2013-12-12 15:30:44 -0600) edit

Does the file '/home/joey/mysite/askbot/skins/my_skin/media/bootstrap/css/bootstrap.min.css' actually exist?

Evgeny's avatar Evgeny (2013-12-12 15:32:58 -0600) edit

Oh and the file doesn't exists as well.. i.e it is not in /home/joeyl/my_site/askbot/skins/my_skin/media/js/output-words.html, it is in /home/joey/custom/my_skin/media/js

Joey's avatar Joey (2013-12-12 15:34:19 -0600) edit

The link that you've inserted should be helpful - try debugging just after the `except ValueError` statement - you will then see what the underlying exception is.

Evgeny's avatar Evgeny (2013-12-12 15:43:09 -0600) edit
add a comment see more comments