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

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Joey's avatar
31
Joey
asked 11 years ago, updated 11 years ago

Comments

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.

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Evgeny's avatar
13.2k
Evgeny
answered 11 years ago
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 (11 years ago)

I have updated the question to include file permissions as well

Joey's avatar Joey (11 years ago)

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

Evgeny's avatar Evgeny (11 years ago)

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 (11 years ago)

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 (11 years ago)
see more comments