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

Enable remote debugging with ptvsd #3419

Merged
merged 13 commits into from
Feb 12, 2019
2 changes: 1 addition & 1 deletion bin/docker-entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ case "$1" in
;;
dev_server)
export FLASK_DEBUG=1
exec /app/manage.py runserver --debugger --reload -h 0.0.0.0
exec /app/manage.py runserver --no-debugger --no-reload -h 0.0.0.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why --no-reload?

;;
shell)
exec /app/manage.py shell
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ services:
- postgres
- redis
ports:
- "5678:5678"
- "5000:5000"
volumes:
- ".:/app"
Expand Down
8 changes: 7 additions & 1 deletion redash/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import urlparse
import urllib

import redis
import redis
from flask import Flask, current_app
from flask_sslify import SSLify
from werkzeug.contrib.fixers import ProxyFix
Expand All @@ -22,6 +22,12 @@
__version__ = '6.0.0'


import os
if os.environ.get("FLASK_DEBUG"):
import ptvsd
ptvsd.enable_attach(address=('0.0.0.0', 5678))


def setup_logging():
handler = logging.StreamHandler(sys.stdout if settings.LOG_STDOUT else sys.stderr)
formatter = logging.Formatter(settings.LOG_FORMAT)
Expand Down
1 change: 1 addition & 0 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ mock==2.0.0
pymongo[tls,srv]==3.6.1
botocore==1.12.85
PyAthena>=1.0.0
ptvsd==4.2.3