Skip to content

Commit

Permalink
Fix PYDEV (#242)
Browse files Browse the repository at this point in the history
  • Loading branch information
tom-butler authored Apr 20, 2020
1 parent 51e2aa2 commit d33f0c2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ DB_USERNAME=opendatacube
DB_PASSWORD=opendatacubepassword
DB_DATABASE=opendatacube
OWS_CFG_FILE=./ows_test_cfg.py
AWS_NO_SIGN_REQUEST=yes
# If you want to use pydev for interactive debugging
PYDEV_DEBUG=
AWS_NO_SIGN_REQUEST=yes
# Will not work with pydev
FLASK_ENV=development
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ ENV PATH=${py_env_path}/bin:$PATH \
## Only install pydev requirements if arg PYDEV_DEBUG is set to 'yes'
ARG PYDEV_DEBUG="no"
RUN if [ "$PYDEV_DEBUG" = "yes" ]; then \
pip install pydevd-pycharm~=193.6911.25 \
pip install pydevd-pycharm~=201.6668.115 \
;fi

RUN chown 1000:100 /dev/shm
Expand Down
2 changes: 2 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ To start ows with db and gunicorn instead of flask (production) ::
The default environment variables (in .env file) can be overriden by setting local environment variables ::

# Enable pydev for pycharm (needs rebuild to install python libs)
# hot reload is not supported, so we need to set FLASK_DEV to production
export PYDEV_DEBUG=yes
export FLASK_DEV=production
docker-compose -f docker-compose.yaml -f docker-compose.db.yaml up --build

# Change location of default config file (good for testing config changes on a local db)
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ services:
AWS_NO_SIGN_REQUEST: "${AWS_NO_SIGN_REQUEST}"
# Dev flags
FLASK_APP: /code/datacube_ows/ogc.py
FLASK_ENV: development
FLASK_ENV: ${FLASK_ENV}
PYDEV_DEBUG: "${PYDEV_DEBUG}"
ports:
- "8000:8000"
Expand Down

0 comments on commit d33f0c2

Please sign in to comment.