0

Receiving this error message ModuleNotFoundError: No module named 'trip_tracker_project' in the Google Cloud App Engine logs when trying to launch the application after deployment.

There may be an issue with the asgi daphne spin up (the app uses websockets and webRTC)... the initial local server spin up of daphne was tricky

There could also be some naming confusion.

The main root directory (where manage.py sits) is trip_tracker_project and is found here: Desktop/trip_tracker_project

However the “project” directory (where settings.py sits), is called trip_tracker, is a child of the trip_tracker_project directory, and sits here: Desktop/trip_tracker_project/trip_tracker

I've been going over the ASGI file and Settings.py, and wondering if the app.yaml file at line 3 entrypoint may have an issue:

runtime: python310
instance_class: F2
entrypoint: daphne -u /tmp/daphne.sock trip_tracker.asgi:application
automatic_scaling:
  target_cpu_utilization: 0.65
  min_instances: 1
  max_instances: 15
env_variables:
  DJANGO_SETTINGS_MODULE: "trip_tracker.settings"
  PYTHONPATH: "/app"

How can I figure out what is causing this error?

Previously I: —removed the google-cloud-sdk from the root directory —updated the app.yaml file to include:

PYTHONPATH: "/app"

changed line 7 in the asgi.py file:

import os
from django.core.asgi import get_asgi_application
from channels.routing import ProtocolTypeRouter, URLRouter
from channels.auth import AuthMiddlewareStack
import video_chat.routing

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'trip_tracker.settings')

application = ProtocolTypeRouter({
    "http": get_asgi_application(),
    "websocket": AuthMiddlewareStack(
        URLRouter(
            video_chat.routing.websocket_urlpatterns
        )
    ),
})

from 'trip_tracker.settings') to 'trip_tracker_project.settings')

and still getting the same timeout then error after the App Engine deploy gcloud app deploy

0 Answers0