Reputation: 1
I'm trying to deploy my Django backend to AppRunner.
My apprunner.yml is this;
version: 1.0
runtime: python311
build:
commands:
build:
- pip3 install pipenv
- pipenv install
post-build:
- python3 manage.py test
env:
- name: DEBUG
value: "on"
- name: SECRET_KEY
value: "django-insecure-a=0f%a$+p$cyb)xobnaa42@gypz3q&f-!n&03&_t$t#_bn2+h4"
- name: ALLOWED_HOSTS
value: "*"
run:
runtime-version: 3.11
pre-run:
- pip3 install pipenv
- pipenv install
command: pipenv run gunicorn django_apprunner.wsgi --log-file -
network:
port: 8000
env: 8000
env:
- name: DEBUG
value: "on"
- name: SECRET_KEY
value: "django-insecure-a=0f%a$+p$cyb)xobnaa42@gypz3q&f-!n&03&_t$t#_bn2+h4"
- name: ALLOWED_HOSTS
value: "*"
In the Application Log File this error comes;
raise ImportError( ImportError: Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment?
I tried to deploy my Django Backend via AppRunner but I got this error.
Upvotes: 0
Views: 102