diff --git a/.gitignore b/.gitignore index 9337005..7ab14a6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ cd06/config.py cd06/Makefile.config +minimal-django/app.log diff --git a/minimal-django/app.log b/minimal-django/app.log new file mode 100644 index 0000000..26766ab --- /dev/null +++ b/minimal-django/app.log @@ -0,0 +1,56 @@ +*** Starting uWSGI 2.0.18-debian (64bit) on [Fri Apr 10 23:25:15 2020] *** +compiled with version: 9.3.0 on 23 March 2020 14:44:29 +os: Linux-5.2.0-2-amd64 #1 SMP Debian 5.2.9-2 (2019-08-21) +nodename: revestel +machine: x86_64 +clock source: unix +pcre jit disabled +detected number of CPU cores: 4 +current working directory: /home/bdauvergne/wd/eo/misc-bdauvergne/minimal-django +detected binary path: /usr/bin/uwsgi-core +*** WARNING: you are running uWSGI without its master process manager *** +your processes number limit is 29871 +your memory page size is 4096 bytes +detected max file descriptor number: 1024 +lock engine: pthread robust mutexes +thunder lock: disabled (you can enable it with --thunder-lock) +uwsgi socket 0 bound to TCP address :3001 fd 3 +Python version: 3.8.2 (default, Apr 1 2020, 15:52:55) [GCC 9.3.0] +*** Python threads support is disabled. You can enable it with --enable-threads *** +Python main interpreter initialized at 0x56427be0dc50 +your server socket listen backlog is limited to 100 connections +your mercy for graceful operations on workers is 60 seconds +mapped 72920 bytes (71 KB) for 1 cores +*** Operational MODE: single process *** +WSGI app 0 (mountpoint='') ready in 1 seconds on interpreter 0x56427be0dc50 pid: 12899 (default app) +*** uWSGI is running in multiple interpreter mode *** +spawned uWSGI worker 1 (and the only) (pid: 12899, cores: 1) +*** Starting uWSGI 2.0.18-debian (64bit) on [Fri Apr 10 23:25:27 2020] *** +compiled with version: 9.3.0 on 23 March 2020 14:44:29 +os: Linux-5.2.0-2-amd64 #1 SMP Debian 5.2.9-2 (2019-08-21) +nodename: revestel +machine: x86_64 +clock source: unix +pcre jit disabled +detected number of CPU cores: 4 +current working directory: /home/bdauvergne/wd/eo/misc-bdauvergne/minimal-django +detected binary path: /usr/bin/uwsgi-core +*** WARNING: you are running uWSGI without its master process manager *** +your processes number limit is 29871 +your memory page size is 4096 bytes +detected max file descriptor number: 1024 +lock engine: pthread robust mutexes +thunder lock: disabled (you can enable it with --thunder-lock) +uwsgi socket 0 bound to TCP address :3001 fd 3 +Python version: 3.8.2 (default, Apr 1 2020, 15:52:55) [GCC 9.3.0] +*** Python threads support is disabled. You can enable it with --enable-threads *** +Python main interpreter initialized at 0x56045df19c50 +your server socket listen backlog is limited to 100 connections +your mercy for graceful operations on workers is 60 seconds +mapped 72920 bytes (71 KB) for 1 cores +*** Operational MODE: single process *** +WSGI app 0 (mountpoint='') ready in 1 seconds on interpreter 0x56045df19c50 pid: 12998 (default app) +*** uWSGI is running in multiple interpreter mode *** +spawned uWSGI worker 1 (and the only) (pid: 12998, cores: 1) +coucou +[pid: 12998|app: 0|req: 1/1] 127.0.0.1 () {38 vars in 766 bytes} [Fri Apr 10 16:25:30 2020] GET / => generated 7 bytes in 84 msecs (HTTP/1.1 200) 1 headers in 59 bytes (1 switches on core 0) diff --git a/minimal-django/app.py b/minimal-django/app.py new file mode 100644 index 0000000..686cd81 --- /dev/null +++ b/minimal-django/app.py @@ -0,0 +1,19 @@ +# minimal django application + +from django.urls import path +from django.http import HttpResponse +from django.core.wsgi import get_wsgi_application + +SECRET_KEY = 'a' +ROOT_URLCONF = 'app' + + +def home(request): + print('coucou') + return HttpResponse('Yoohoo!') + +urlpatterns = [ + path('', home), +] + +application = get_wsgi_application() diff --git a/minimal-django/install-uwsgi.sh b/minimal-django/install-uwsgi.sh new file mode 100755 index 0000000..7281460 --- /dev/null +++ b/minimal-django/install-uwsgi.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +dpkg -s uwsgi-core >/dev/null 2>&1 || sudo apt install uwsgi-core diff --git a/minimal-django/tox.ini b/minimal-django/tox.ini new file mode 100644 index 0000000..1036b1d --- /dev/null +++ b/minimal-django/tox.ini @@ -0,0 +1,14 @@ +[tox] +toxworkdir = {env:TMPDIR:/tmp}/tox-{env:USER}/minimal-django/ +skipsdist = True + +[testenv] +setenv = + DJANGO_SETTINGS_MODULE=app +whitelist_externals = + uwsgi-core +deps = + django +commands = + ./install-uwsgi.sh + uwsgi-core --plugin python3 --http-socket :{env:PORT:3001} --wsgi-file app.py --logto app.log