Django 403 Forbidden on AWS Elastic Beanstalk

I follow the tutorial on deploying a Django application on AWS. Source I am using http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python-django.html

I get the following error:

[Tue Feb 23 21:05:22.883666 2016] [core:error] [pid 3394] (13)Permission denied: [client 172.31.46.155:37871] AH00035: access to / denied (filesystem path '/opt/python/current/app/mysite/wsgi.py') because search permissions are missing on a component of the path 

My web page shows:

Forbidden

You do not have permission to access this server.

Here is my file path:

 virtualenvFolder - requirements.txt mysite -db.sqlite3.db -manage.py mysite -__init__.py -__init__.pyc -settings.py -settings.pyc -urls.py -urls.pyc -wsgi.py -wsgi.pyc .ebextensions -django.config .elasticbeanstalk -config.yml 

requirements.txt:

 Django==1.9.2 MySQL-python==1.2.5 

django.config:

 option_settings: aws:elasticbeanstalk:container:python: WSGIPath: mysite/wsgi.py 

config.yml:

 branch-defaults: default: environment: django-env group_suffix: null global: application_name: mysite default_ec2_keyname: my-keypair default_platform: python2.7 default_region: us-west-2 profile: eb-cli sc: null 

Note. I did not write or change config.yml, which was automatically generated.

+5
source share
1 answer

This has nothing to do with Django and everything related to Apache and file permissions. It looks like you are storing a Django application in a directory in which the Apache process does not have access to access.

Please see this question for a solution.

+2
source

Source: https://habr.com/ru/post/1243708/


All Articles