[Django] Plugin assumes app is in current directory
See original GitHub issueI’m using serverless to deploy a Django (REST Framework) API as an AWS Lambda function, and I’m also going to be deploying other Lambda functions that are not WSGI apps. I have this all in one repo right now, with serverless.yml
alongside api
, where api
is the Django project directory.
Thus, I set custom.wsgi.app: api.api.wsgi.application
. This allows the WSGI handler to find my app just fine, but when the app runs, it appears that the working directory is still the root of my repo, rather than the root of the Django app, because I get an import error on api.settings
. I get the same error message when deploying the endpoint to AWS and testing there.
Sorry if this is misfiled; I’m not sure if this is a question about Django, serverless, or serverless-wsgi, as I’m new to all of them. 😃 Is there a way to make sure the function that runs my Django app from a working directory other than where serverless.yml
lives? Is that up to serverless or serverless-wsgi, or Django?
Issue Analytics
- State:
- Created 6 years ago
- Comments:16 (16 by maintainers)
Top GitHub Comments
Nope; same error.
I’ll take a moment to make a repro project.
I’m closing this and releasing 1.3.0 now