502 Bad Gateway

I see 502 Bad Gateway errors when accessing my app.

.platform.app.yaml

name: "ll_project"
type: "python:3.8"

relationships:
    database: "db:postgresql"

web:
    upstream:
      socket_family: unix
    commands:
      start: "gunicorn -w 4 -b unix:$SOCKET ll_project.wsgi:application"
    locations:
      "/":
          passthru: true
      "/static":
          root: "static"
          expires: 1h
          allow: true
disk: 512
mounts:
    "logs":
        source: local
        source_path: logs
hooks:
    build: |
        pip install --upgrade pip
        pip install -r requirements.txt
        pip install -r requirements_remote.txt
      
        mkdir logs
        python manage.py collectstatic
        rm -rf logs
    deploy: |
        python manage.py migrate

routes.yaml

"https://{default}/":
    type: upstream
    upstream: "ll_project:http"

"https://www.{default}/":
    type: redirect
    to: "https://{default}/"

services.yaml

db:
    type: postgresql:12
    disk: 1024

0

Comments

2 comments
Date Votes
  • Official comment

    Hi, it appears that you do not have a “wsgi.py” file in a folder called “ll_project”. 

    Please try using this as a start command instead: 

    start: "gunicorn -w 4 -b unix:$SOCKET djangoProject.wsgi:application"
  • Oh, yes, you are right.  I appreciate your support very much.

    Thank you for sparing your precious time answering my questions.

    0

Please sign in to leave a comment.

 

Didn't find what you were looking for?

New post