Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated APP_MODULE env variable #50

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ Let's go through these lines one-by-one:
6. *Optional:* If you need to run any build-time tasks, such as collecting static assets, now's the time to do that.
7. We set the container command (`CMD`) to a list of arguments that will be passed to `gunicorn`. We need to provide Gunicorn with the [`APP_MODULE`](http://docs.gunicorn.org/en/stable/run.html?highlight=app_module#gunicorn), so that it knows which WSGI app to run.*

> Note that previously the way to do point 5 was to set the `APP_MODULE` environment variable. That still works, but is no longer the recommended way and is deprecated.
> Note that previously the way to do point 5 was to set the `APP_MODULE` environment variable. This functionality has been removed.

By default, the [`django-entrypoint.sh`](django-entrypoint.sh) script is run when the container is started. This script runs a once-off `django-admin migrate` to update the database schemas and then launches `nginx` and `gunicorn` to run the application.

Expand Down
11 changes: 2 additions & 9 deletions django-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#!/usr/bin/env sh
set -e

# No args or looks like options or the APP_MODULE for Gunicorn
if [ "$#" = 0 ] || \
[ "${1#-}" != "$1" ] || \
# Looks like options or the APP_MODULE for Gunicorn
if [ "${1#-}" != "$1" ] || \
echo "$1" | grep -Eq '^([_A-Za-z]\w*\.)*[_A-Za-z]\w*:[_A-Za-z]\w*$'; then
set -- gunicorn "$@"
fi
Expand Down Expand Up @@ -57,12 +56,6 @@ if not User.objects.filter(username='admin').exists():
celery-entrypoint.sh beat --pidfile beat.pid &
fi

if [ -n "$APP_MODULE" ]; then
echo 'DEPRECATED: Providing APP_MODULE via an environment variable is deprecated.
Please provide it using the container command rather.' 1>&2
set -- "$@" "$APP_MODULE"
fi

# Set some sensible Gunicorn options, needed for things to work with Nginx

# umask working files (worker tmp files & unix socket) as 0o117 (i.e. chmod as
Expand Down