Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django 403 Forbidden on AWS Elastic Beanstalk

I am following the tutorial for 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 don't have permission to access / on 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 it was auto generated.

like image 395
Andrew Avatar asked Oct 30 '22 08:10

Andrew


1 Answers

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

Please see this question for a solution.

like image 194
Vingtoft Avatar answered Nov 13 '22 16:11

Vingtoft