skip to Main Content

Im trying to get flask with virtual environment and wsgi configured to work but Apache keeps giving me this error:

[Tue Nov 13 13:23:55.179153 2018] [wsgi:error] [pid 11819] [x.x.x.x:xxxx] app.session_interface = self._get_interface(app)

[Tue Nov 13 13:23:55.179160 2018] [wsgi:error] [pid 11819] [x.x.x.x:xxxx] File “/var/www/html/project/python/lib/python3.6/site-packages/flask_session/init.py”,
line 93, in _get_interface

[Tue Nov 13 13:23:55.179163 2018] [wsgi:error] [pid 11819] [x.x.x.x:xxxx] config[‘SESSION_USE_SIGNER’], config[‘SESSION_PERMANENT’])

[Tue Nov 13 13:23:55.179169 2018] [wsgi:error] [pid 11819] [x.x.x.x:xxxx] File “/var/www/html/project/python/lib/python3.6/site-packages/flask_session/sessions.py”,
line 314, in init

[Tue Nov 13 13:23:55.179172 2018] [wsgi:error] [pid 11819] [x.x.x.x:xxxx] self.cache = FileSystemCache(cache_dir, threshold=threshold, mode=mode)

[Tue Nov 13 13:23:55.179177 2018] [wsgi:error] [pid 11819] [x.x.x.x:xxxx] File “/var/www/html/project/python/lib/python3.6/site-packages/werkzeug/contrib/cache.py”,
line 717, in init

[Tue Nov 13 13:23:55.179180 2018] [wsgi:error] [pid 11819] [x.x.x.x:xxxx] os.makedirs(self._path)

[Tue Nov 13 13:23:55.179185 2018] [wsgi:error] [pid 11819] [x.x.x.x:xxxx] File “/lib64/python3.6/os.py”, line 220, in makedirs

[Tue Nov 13 13:23:55.179188 2018] [wsgi:error] [pid 11819] [x.x.x.x:xxxx] mkdir(name, mode)

[Tue Nov 13 13:23:55.179215 2018] [wsgi:error] [pid 11819] [x.x.x.x:xxxx] PermissionError: [Errno 13] Permission denied: ‘/flask_session’

I tried giving the project different permissions but nothing worked

2

Answers


  1. The directory is failing to be created is on behalf of flask-session, which has a SESSION_FILE_DIR setting that’ll let you override its default. Point that to some place with the appropriate permissions, and you’ll likely be fine.

    Login or Signup to reply.
  2. You should specify which type of session interface to use.

    Try to set the SESSION-TYPE to "null".

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search