File tree Expand file tree Collapse file tree 4 files changed +29
-32
lines changed Expand file tree Collapse file tree 4 files changed +29
-32
lines changed Original file line number Diff line number Diff line change @@ -12,10 +12,6 @@ services:
12
12
published : 3000
13
13
protocol : tcp
14
14
mode : host
15
- - target : 8000
16
- published : 8000
17
- protocol : tcp
18
- mode : host
19
15
celeryworker :
20
16
volumes :
21
17
- ' .:/app:z'
Original file line number Diff line number Diff line change @@ -12,12 +12,10 @@ if [ ! -f ${TARGET_SETTINGS_FILE} ]; then
12
12
cp dojo/settings/settings.dist.py dojo/settings/settings.py
13
13
fi
14
14
15
- PORT=8000
16
- echo " Serving directly on port ${PORT} "
17
- python manage.py runserver 0.0.0.0:${PORT} --noreload --nothreading
18
-
19
- # exec uwsgi \
20
- # "--${DD_UWSGI_MODE}" "${DD_UWSGI_ENDPOINT}" \
21
- # --protocol uwsgi \
22
- # --wsgi dojo.wsgi:application \
23
- # --py-autoreload 1
15
+ exec uwsgi \
16
+ " --${DD_UWSGI_MODE} " " ${DD_UWSGI_ENDPOINT} " \
17
+ --protocol uwsgi \
18
+ --wsgi dojo.wsgi:application \
19
+ --py-autoreload 1 \
20
+ --enable-threads --lazy-apps --honour-stdin
21
+
Original file line number Diff line number Diff line change 14
14
15
15
"""
16
16
import os
17
+ import socket
18
+ from socket import error as socket_error
17
19
18
20
# We defer to a DJANGO_SETTINGS_MODULE already in the environment. This breaks
19
21
# if running multiple sites in the same mod_wsgi process. To fix this, use
31
33
# Apply WSGI middleware here.
32
34
# from helloworld.wsgi import HelloWorldApplication
33
35
# application = HelloWorldApplication(application)
36
+
37
+ def _check_ptvsd_port_not_in_use (port ):
38
+ try :
39
+ sock = socket .socket (socket .AF_INET , socket .SOCK_STREAM )
40
+ sock .bind (('127.0.0.1' , port ))
41
+ except socket_error as se :
42
+ return False
43
+
44
+ return True
45
+
46
+
47
+ ptvsd_port = 3000
48
+ if os .environ .get ("DD_DEBUG" ) == "on" and _check_ptvsd_port_not_in_use (ptvsd_port ):
49
+ try :
50
+ # enable remote debugging
51
+ import ptvsd
52
+ ptvsd .enable_attach (address = ('0.0.0.0' , ptvsd_port ))
53
+ print ("ptvsd listening on port " + ptvsd_port )
54
+ except Exception as e :
55
+ print ("Generic exception caught with DD_DEBUG on. Passing." )
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env python
2
2
import os
3
3
import sys
4
- import socket
5
- from socket import error as socket_error
6
4
7
5
8
6
if __name__ == "__main__" :
9
7
os .environ .setdefault ("DJANGO_SETTINGS_MODULE" , "dojo.settings.settings" )
10
8
11
9
from django .core .management import execute_from_command_line
12
10
13
- def _check_ptvsd_port_not_in_use (port ):
14
- try :
15
- sock = socket .socket (socket .AF_INET , socket .SOCK_STREAM )
16
- sock .bind (('127.0.0.1' , port ))
17
- except socket_error as se :
18
- return False
19
-
20
- return True
21
-
22
- ptvsd_port = 3000
23
- if os .environ .get ("DD_DEBUG" ) == "on" and _check_ptvsd_port_not_in_use (ptvsd_port ):
24
- try :
25
- # enable remote debugging
26
- import ptvsd
27
- ptvsd .enable_attach (address = ('0.0.0.0' , ptvsd_port ))
28
- except Exception as e :
29
- print ("Generic exception caught with DD_DEBUG on. Passing." )
30
11
execute_from_command_line (sys .argv )
You can’t perform that action at this time.
0 commit comments