[Python-modules-commits] [django-uwsgi] 01/10: Import django-uwsgi_0.2.1.orig.tar.gz
Michael Fladischer
fladi at moszumanska.debian.org
Mon Jul 17 07:45:26 UTC 2017
This is an automated email from the git hooks/post-receive script.
fladi pushed a commit to branch master
in repository django-uwsgi.
commit 9939cc91144a5e9b54214d6e52e6b548c9ccb4d7
Author: Michael Fladischer <FladischerMichael at fladi.at>
Date: Mon Jul 17 09:13:01 2017 +0200
Import django-uwsgi_0.2.1.orig.tar.gz
---
CONTRIBUTORS | 3 +
MANIFEST.in | 2 +-
PKG-INFO | 13 +-
README.rst | 8 ++
django_uwsgi.egg-info/PKG-INFO | 13 +-
django_uwsgi.egg-info/SOURCES.txt | 11 +-
django_uwsgi/.DS_Store | Bin 8196 -> 0 bytes
django_uwsgi/__init__.py | 4 +-
django_uwsgi/emperor/admin.py | 19 ++-
django_uwsgi/emperor/wagtail_hooks.py | 15 +++
django_uwsgi/mail.py | 2 +-
django_uwsgi/management/.DS_Store | Bin 6148 -> 0 bytes
django_uwsgi/management/commands/runuwsgi.py | 62 ++++-----
django_uwsgi/panels.py | 7 +-
django_uwsgi/stats.py | 13 +-
django_uwsgi/{task.py => tasks.py} | 1 +
django_uwsgi/templates/.DS_Store | Bin 6148 -> 0 bytes
django_uwsgi/templates/uwsgi/panel.html | 149 ++++++++++++++-------
django_uwsgi/templates/uwsgi/wagtail_uwsgi.html | 170 +++++++++++++++++-------
django_uwsgi/urls.py | 14 +-
django_uwsgi/views.py | 59 ++++++--
docs/cache.rst | 15 ++-
docs/conf.py | 2 +-
docs/configuration.rst | 4 +-
docs/email.rst | 2 +-
docs/emperor.rst | 13 +-
docs/features.rst | 2 +
docs/installation.rst | 5 +-
docs/integrations.rst | 5 +-
docs/screenshots.rst | 11 +-
docs/screenshots/screenshot1.png | Bin 130092 -> 100713 bytes
docs/screenshots/screenshot2.png | Bin 77379 -> 61452 bytes
docs/screenshots/screenshot3.png | Bin 51354 -> 75813 bytes
docs/screenshots/screenshot4.png | Bin 0 -> 74709 bytes
docs/screenshots/screenshot5.png | Bin 0 -> 56162 bytes
docs/todo.rst | 3 -
setup.cfg | 3 +
setup.py | 3 +
38 files changed, 454 insertions(+), 179 deletions(-)
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index 5cc5e32..31d54cf 100755
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -2,3 +2,6 @@ Roberto De Ioris, Unbit, <roberto at unbit.it>
Eugene MechanisM, MechanisM, <eugene at mechanism.name>
Ionel Cristian Mărieș, <contact at ionelmc.ro>
Jayson Reis, jaysonsantos, <santosdosreis at gmail.com>
+Alan Justino da Silva, alanjds, <alan.justino at yahoo.com.br>
+Michael Fladischer, fladi, <michael at fladi.at>
+Paul Bailey, pizzapanther
diff --git a/MANIFEST.in b/MANIFEST.in
index 711cc50..f32f97a 100755
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,5 +1,5 @@
include CONTRIBUTORS LICENSE *.rst
-recursive-include django_uwsgi *
+recursive-include django_uwsgi *.html
recursive-include docs Makefile conf.py requirements-docs.txt *.rst *.png
recursive-exclude * __pycache__
recursive-exclude * *.py[cod]
diff --git a/PKG-INFO b/PKG-INFO
index 5847f72..437e119 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: django-uwsgi
-Version: 0.1.6
+Version: 0.2.1
Summary: uWSGI stuff for Django projects
Home-page: http://github.com/unbit/django-uwsgi
Author: Eugene MechanisM
@@ -26,6 +26,14 @@ Description: django-uwsgi
.. image:: https://github.com/unbit/django-uwsgi/raw/master/docs/screenshots/screenshot3.png
+ Emperor's Vassal Admin Panel
+
+ .. image:: https://github.com/unbit/django-uwsgi/raw/master/docs/screenshots/screenshot4.png
+
+ `django.contrib.admin <https://docs.djangoproject.com/en/1.10/ref/contrib/admin/>`_ interface
+
+ .. image:: https://github.com/unbit/django-uwsgi/raw/master/docs/screenshots/screenshot5.png
+
Documentation
~~~~~~~~~~~~~
@@ -52,6 +60,9 @@ Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3.5
+Classifier: Framework :: Django
+Classifier: Framework :: Django :: 1.9
+Classifier: Framework :: Django :: 1.10
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Internet :: WWW/HTTP :: WSGI
Classifier: Topic :: Internet :: WWW/HTTP :: WSGI :: Application
diff --git a/README.rst b/README.rst
index 7234d46..7b3800e 100755
--- a/README.rst
+++ b/README.rst
@@ -18,6 +18,14 @@ Screenshots
.. image:: https://github.com/unbit/django-uwsgi/raw/master/docs/screenshots/screenshot3.png
+Emperor's Vassal Admin Panel
+
+.. image:: https://github.com/unbit/django-uwsgi/raw/master/docs/screenshots/screenshot4.png
+
+`django.contrib.admin <https://docs.djangoproject.com/en/1.10/ref/contrib/admin/>`_ interface
+
+.. image:: https://github.com/unbit/django-uwsgi/raw/master/docs/screenshots/screenshot5.png
+
Documentation
~~~~~~~~~~~~~
diff --git a/django_uwsgi.egg-info/PKG-INFO b/django_uwsgi.egg-info/PKG-INFO
index 5847f72..437e119 100644
--- a/django_uwsgi.egg-info/PKG-INFO
+++ b/django_uwsgi.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: django-uwsgi
-Version: 0.1.6
+Version: 0.2.1
Summary: uWSGI stuff for Django projects
Home-page: http://github.com/unbit/django-uwsgi
Author: Eugene MechanisM
@@ -26,6 +26,14 @@ Description: django-uwsgi
.. image:: https://github.com/unbit/django-uwsgi/raw/master/docs/screenshots/screenshot3.png
+ Emperor's Vassal Admin Panel
+
+ .. image:: https://github.com/unbit/django-uwsgi/raw/master/docs/screenshots/screenshot4.png
+
+ `django.contrib.admin <https://docs.djangoproject.com/en/1.10/ref/contrib/admin/>`_ interface
+
+ .. image:: https://github.com/unbit/django-uwsgi/raw/master/docs/screenshots/screenshot5.png
+
Documentation
~~~~~~~~~~~~~
@@ -52,6 +60,9 @@ Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3.5
+Classifier: Framework :: Django
+Classifier: Framework :: Django :: 1.9
+Classifier: Framework :: Django :: 1.10
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Internet :: WWW/HTTP :: WSGI
Classifier: Topic :: Internet :: WWW/HTTP :: WSGI :: Application
diff --git a/django_uwsgi.egg-info/SOURCES.txt b/django_uwsgi.egg-info/SOURCES.txt
index 12ce79b..a5942f5 100644
--- a/django_uwsgi.egg-info/SOURCES.txt
+++ b/django_uwsgi.egg-info/SOURCES.txt
@@ -2,8 +2,8 @@ CONTRIBUTORS
LICENSE
MANIFEST.in
README.rst
+setup.cfg
setup.py
-django_uwsgi/.DS_Store
django_uwsgi/__init__.py
django_uwsgi/apps.py
django_uwsgi/cache.py
@@ -11,7 +11,7 @@ django_uwsgi/decorators.py
django_uwsgi/mail.py
django_uwsgi/panels.py
django_uwsgi/stats.py
-django_uwsgi/task.py
+django_uwsgi/tasks.py
django_uwsgi/template.py
django_uwsgi/urls.py
django_uwsgi/views.py
@@ -26,13 +26,12 @@ django_uwsgi/emperor/__init__.py
django_uwsgi/emperor/admin.py
django_uwsgi/emperor/apps.py
django_uwsgi/emperor/models.py
+django_uwsgi/emperor/wagtail_hooks.py
django_uwsgi/emperor/migrations/0001_initial.py
django_uwsgi/emperor/migrations/__init__.py
-django_uwsgi/management/.DS_Store
django_uwsgi/management/__init__.py
django_uwsgi/management/commands/__init__.py
django_uwsgi/management/commands/runuwsgi.py
-django_uwsgi/templates/.DS_Store
django_uwsgi/templates/uwsgi/panel.html
django_uwsgi/templates/uwsgi/uwsgi.html
django_uwsgi/templates/uwsgi/wagtail_dashboard_item.html
@@ -56,4 +55,6 @@ docs/screenshots.rst
docs/todo.rst
docs/screenshots/screenshot1.png
docs/screenshots/screenshot2.png
-docs/screenshots/screenshot3.png
\ No newline at end of file
+docs/screenshots/screenshot3.png
+docs/screenshots/screenshot4.png
+docs/screenshots/screenshot5.png
\ No newline at end of file
diff --git a/django_uwsgi/.DS_Store b/django_uwsgi/.DS_Store
deleted file mode 100644
index ee4949b..0000000
Binary files a/django_uwsgi/.DS_Store and /dev/null differ
diff --git a/django_uwsgi/__init__.py b/django_uwsgi/__init__.py
index 5120a41..06637e0 100755
--- a/django_uwsgi/__init__.py
+++ b/django_uwsgi/__init__.py
@@ -1,4 +1,4 @@
-__version__ = '0.1.6'
+__version__ = '0.2.1'
try:
@@ -7,7 +7,7 @@ except ImportError:
uwsgi = None
try:
- import cPickle as pickle
+ from six.moves import cPickle as pickle
except ImportError:
import pickle
diff --git a/django_uwsgi/emperor/admin.py b/django_uwsgi/emperor/admin.py
index f414e42..c2f0391 100755
--- a/django_uwsgi/emperor/admin.py
+++ b/django_uwsgi/emperor/admin.py
@@ -1,10 +1,25 @@
from django.contrib import admin
+from django.utils.translation import ugettext_lazy as _
from .models import Vassal
-class VassalAdmin(admin.ModelAdmin):
- list_display = ['title', 'extension', 'updated', 'created', 'enabled', 'ts']
+def enabled(modeladmin, request, queryset):
+ queryset.update(enabled='1')
+enabled.short_description = _("Enable selected Emperor's Vassals")
+
+
+def disabled(modeladmin, request, queryset):
+ queryset.update(enabled='0')
+disabled.short_description = _("Disable selected Emperor's Vassals")
+
+
+class VassalFields(object):
+ list_display = ('title', 'extension', 'updated', 'created', 'enabled', 'ts')
search_fields = ['title']
list_filter = ('enabled', 'created', 'extension')
+
+class VassalAdmin(VassalFields, admin.ModelAdmin):
+ actions = [enabled, disabled]
+
admin.site.register(Vassal, VassalAdmin)
diff --git a/django_uwsgi/emperor/wagtail_hooks.py b/django_uwsgi/emperor/wagtail_hooks.py
new file mode 100644
index 0000000..88d8369
--- /dev/null
+++ b/django_uwsgi/emperor/wagtail_hooks.py
@@ -0,0 +1,15 @@
+from wagtail.contrib.modeladmin.options import (
+ ModelAdmin,
+ modeladmin_register
+)
+from .models import Vassal
+from .admin import VassalFields
+
+
+class VassalModelAdmin(VassalFields, ModelAdmin):
+ model = Vassal
+ menu_icon = 'cogs'
+ menu_order = 800
+ add_to_settings_menu = True
+
+modeladmin_register(VassalModelAdmin)
\ No newline at end of file
diff --git a/django_uwsgi/mail.py b/django_uwsgi/mail.py
index 506d0c0..b7a05b7 100755
--- a/django_uwsgi/mail.py
+++ b/django_uwsgi/mail.py
@@ -13,6 +13,6 @@ class EmailBackend(BaseEmailBackend):
return num_sent
def _send(self, email_message):
- from .task import send_mail
+ from .tasks import send_mail
send_mail.spool(body=pickle.dumps(email_message, 2))
return True
\ No newline at end of file
diff --git a/django_uwsgi/management/.DS_Store b/django_uwsgi/management/.DS_Store
deleted file mode 100644
index e686aaf..0000000
Binary files a/django_uwsgi/management/.DS_Store and /dev/null differ
diff --git a/django_uwsgi/management/commands/runuwsgi.py b/django_uwsgi/management/commands/runuwsgi.py
index 0a72a8a..1f6bf6d 100755
--- a/django_uwsgi/management/commands/runuwsgi.py
+++ b/django_uwsgi/management/commands/runuwsgi.py
@@ -26,72 +26,72 @@ class Command(BaseCommand):
self.socket_addr = v
# load the Django WSGI handler
- os.environ['UWSGI_MODULE'] = '%s.wsgi' % django_project
+ os.environ.setdefault('UWSGI_MODULE', '%s.wsgi' % django_project)
# DJANGO settings
if options['settings']:
os.environ['DJANGO_SETTINGS_MODULE'] = options['settings']
else:
- os.environ['DJANGO_SETTINGS_MODULE'] = '%s.settings' % django_project
+ os.environ.setdefault('DJANGO_SETTINGS_MODULE', '%s.settings' % django_project)
# set protocol as uwsgi
- os.environ['UWSGI_PROTOCOL'] = 'uwsgi'
+ os.environ.setdefault('UWSGI_PROTOCOL', 'uwsgi')
# bind the http server to the default port
if self.http_port:
os.environ['UWSGI_HTTP_SOCKET'] = ':%s' % self.http_port
elif self.socket_addr:
os.environ['UWSGI_UWSGI_SOCKET'] = self.socket_addr
- os.environ['UWSGI_CHMOD_SOCKET'] = '664'
+ os.environ.setdefault('UWSGI_CHMOD_SOCKET', '664')
# set process names
- os.environ['UWSGI_AUTO_PROCNAME'] = 'true'
- os.environ['UWSGI_PROCNAME_PREFIX_SPACED'] = '[uWSGI %s]' % django_project
+ os.environ.setdefault('UWSGI_AUTO_PROCNAME', 'true')
+ os.environ.setdefault('UWSGI_PROCNAME_PREFIX_SPACED', '[uWSGI %s]' % django_project)
# remove sockets/pidfile at exit
- os.environ['UWSGI_VACUUM'] = 'true'
+ os.environ.setdefault('UWSGI_VACUUM', 'true')
# retrieve/set the PythonHome
- os.environ['UWSGI_VIRTUALENV'] = sys.prefix
+ os.environ.setdefault('UWSGI_VIRTUALENV', sys.prefix)
# add project to python path
- os.environ['UWSGI_PP'] = root
+ os.environ.setdefault('UWSGI_PP', root)
- os.environ['UWSGI_POST_BUFFERING'] = '1048576'
- os.environ['UWSGI_RELOAD_ON_RSS'] = '300'
+ os.environ.setdefault('UWSGI_POST_BUFFERING', '1048576')
+ os.environ.setdefault('UWSGI_RELOAD_ON_RSS', '300')
# increase buffer size a bit
- os.environ['UWSGI_BUFFER_SIZE'] = '65535'
+ os.environ.setdefault('UWSGI_BUFFER_SIZE', '65535')
# some additions required by newrelic
- os.environ['UWSGI_ENABLE_THREADS'] = 'true'
- os.environ['UWSGI_LAZY_APPS'] = 'true'
- os.environ['UWSGI_SINGLE_INTERPRETER'] = 'true'
- os.environ['UWSGI_AUTOLOAD'] = 'true'
+ os.environ.setdefault('UWSGI_ENABLE_THREADS', 'true')
+ os.environ.setdefault('UWSGI_LAZY_APPS', 'true')
+ os.environ.setdefault('UWSGI_SINGLE_INTERPRETER', 'true')
+ os.environ.setdefault('UWSGI_AUTOLOAD', 'true')
# set 12 workers and cheaper to number of cpus
- os.environ['UWSGI_WORKERS'] = '12'
- os.environ['UWSGI_CHEAPER'] = str(multiprocessing.cpu_count())
+ os.environ.setdefault('UWSGI_WORKERS', '12')
+ os.environ.setdefault('UWSGI_CHEAPER', str(multiprocessing.cpu_count()))
# enable the master process
- os.environ['UWSGI_MASTER'] = 'true'
+ os.environ.setdefault('UWSGI_MASTER', 'true')
- os.environ['UWSGI_NO_ORPHANS'] = 'true'
- os.environ['UWSGI_MEMORY_REPORT'] = 'true'
- os.environ['UWSGI_DISABLE_LOGGING'] = 'true'
+ os.environ.setdefault('UWSGI_NO_ORPHANS', 'true')
+ os.environ.setdefault('UWSGI_MEMORY_REPORT', 'true')
+ os.environ.setdefault('UWSGI_DISABLE_LOGGING', 'true')
# set harakiri
- os.environ['UWSGI_HARAKIRI'] = '60'
- os.environ['UWSGI_HARAKIRI_VERBOSE'] = 'true'
+ os.environ.setdefault('UWSGI_HARAKIRI', '60')
+ os.environ.setdefault('UWSGI_HARAKIRI_VERBOSE', 'true')
# set uid and gid
- os.environ['UWSGI_UID'] = str(os.getuid())
- os.environ['UWSGI_GID'] = str(os.getgid())
+ os.environ.setdefault('UWSGI_UID', str(os.getuid()))
+ os.environ.setdefault('UWSGI_GID', str(os.getgid()))
# TODO: Figure out cache
- os.environ['UWSGI_CACHE2'] = 'name=%s,items=20000,keysize=128,blocksize=4096' % django_project
+ os.environ.setdefault('UWSGI_CACHE2', 'name=%s,items=20000,keysize=128,blocksize=4096' % django_project)
if settings.DEBUG:
if apps.is_installed('configurations'):
os.environ.setdefault('DJANGO_CONFIGURATION', 'Development')
import configurations
configurations.setup()
# map and serve static files
- os.environ['UWSGI_STATIC_MAP'] = '%s=%s' % (settings.STATIC_URL, settings.STATIC_ROOT)
- os.environ['UWSGI_PY_AUTORELOAD'] = '2'
+ os.environ.setdefault('UWSGI_STATIC_MAP', '%s=%s' % (settings.STATIC_URL, settings.STATIC_ROOT))
+ os.environ.setdefault('UWSGI_PY_AUTORELOAD', '2')
# run spooler for mail task
if 'django_uwsgi' in settings.EMAIL_BACKEND:
- os.environ['UWSGI_SPOOLER'] = '/tmp'
- os.environ['UWSGI_SPOOLER_IMPORT'] = 'django_uwsgi.task'
+ os.environ.setdefault('UWSGI_SPOOLER', '/tmp')
+ os.environ.setdefault('UWSGI_SPOOLER_IMPORT', 'django_uwsgi.tasks')
# exec the uwsgi binary
if apps.ready:
os.execvp('uwsgi', ('uwsgi',))
diff --git a/django_uwsgi/panels.py b/django_uwsgi/panels.py
old mode 100755
new mode 100644
index 5a1085b..e7fdd9f
--- a/django_uwsgi/panels.py
+++ b/django_uwsgi/panels.py
@@ -4,8 +4,9 @@ from . import uwsgi
class UwsgiPanel(Panel):
- """uWSGI Debug Toolbar Panel"""
-
+ '''
+ uWSGI Debug Toolbar Panel
+ '''
title = _('uWSGI Status')
nav_title = _('uWSGI Status')
template = 'uwsgi/panel.html'
@@ -14,7 +15,7 @@ class UwsgiPanel(Panel):
def nav_subtitle(self):
if uwsgi is not None:
status = _('Version %s, %d Workers') % (
- uwsgi.version, uwsgi.numproc)
+ str(uwsgi.version.decode()), int(uwsgi.numproc))
else:
status = _('uWSGI is missing =(')
return status
diff --git a/django_uwsgi/stats.py b/django_uwsgi/stats.py
index a7c4083..ad1e19a 100755
--- a/django_uwsgi/stats.py
+++ b/django_uwsgi/stats.py
@@ -11,20 +11,16 @@ def get_uwsgi_stats():
total_load = time.time() - uwsgi.started_on
for w in workers:
w['running_time'] = w['running_time'] / 1000
+ w['avg_rt'] = w['avg_rt'] / 1000
w['load'] = w['running_time'] / total_load / 10 / len(workers)
w['last_spawn'] = datetime.fromtimestamp(w['last_spawn'])
jobs = []
if uwsgi.opt.get('spooler'):
spooler_jobs = uwsgi.spooler_jobs()
for j in spooler_jobs:
- jobs.append({'file': j, 'env': uwsgi.parsefile(j)})
-
+ jobs.append({'file': j, 'env': uwsgi.parsefile(str(j))})
uwsgi_stats.update({
- 'version': uwsgi.version,
- 'hostname': uwsgi.hostname,
- 'magic': uwsgi.magic_table,
- 'os': os.uname(),
- 'masterpid': uwsgi.masterpid(),
+ 'uwsgi': uwsgi,
'stats': [
('loop', uwsgi.loop),
('masterpid', str(uwsgi.masterpid())),
@@ -40,8 +36,7 @@ def get_uwsgi_stats():
('spooler_pid', uwsgi.spooler_pid() if uwsgi.opt.get('spooler') else _('disabled')),
('threads', _('enabled') if uwsgi.has_threads else _('disabled'))
],
- 'options': uwsgi.opt.items(),
'workers': workers,
- 'jobs': jobs,
+ 'jobs': jobs
})
return uwsgi_stats
diff --git a/django_uwsgi/task.py b/django_uwsgi/tasks.py
similarity index 90%
rename from django_uwsgi/task.py
rename to django_uwsgi/tasks.py
index bbfc7fa..a93e4b4 100755
--- a/django_uwsgi/task.py
+++ b/django_uwsgi/tasks.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
from django.core.mail import get_connection
from django.conf import settings
diff --git a/django_uwsgi/templates/.DS_Store b/django_uwsgi/templates/.DS_Store
deleted file mode 100644
index cd0cb03..0000000
Binary files a/django_uwsgi/templates/.DS_Store and /dev/null differ
diff --git a/django_uwsgi/templates/uwsgi/panel.html b/django_uwsgi/templates/uwsgi/panel.html
index 20417bd..45f20a6 100755
--- a/django_uwsgi/templates/uwsgi/panel.html
+++ b/django_uwsgi/templates/uwsgi/panel.html
@@ -2,23 +2,22 @@
{% if unavailable %}
<h4>{% trans 'ERROR: uWSGI is not available!' %}</h4>
{% else %}
-
-
<style>
body.app-django_uwsgi .submit-row a.button {
- display: inline-block;
+ display: inline-block
}
-
#djDebug .submit-row {
padding-top: 5px;
- padding-bottom: 5px;
+ padding-bottom: 5px
}
</style>
<div id="content-main" class="inline-related tabular">
<div class="module">
- <h4>{% trans 'Status' %}</h4>
<table>
+ <caption>
+ <h4>{% trans 'Status' %}</h4>
+ </caption>
<thead>
<tr>
<th>{% trans "Option" %}</th>
@@ -36,8 +35,10 @@
</table>
</div>
<div class="module">
- <h4>{% trans 'Options' %}</h4>
<table>
+ <caption>
+ <h4>{% trans 'Options' %} (<a href="http://uwsgi-docs.readthedocs.org/en/latest/Options.html">read docs</a>)</h4>
+ </caption>
<thead>
<tr>
<th>{% trans "Option" %}</th>
@@ -45,7 +46,7 @@
</tr>
</thead>
<tbody>
- {% for key, value in options %}
+ {% for key, value in uwsgi.opt.items %}
<tr class="{% cycle 'djDebugOdd' 'djDebugEven' %}">
<td><a href="http://uwsgi-docs.readthedocs.org/en/latest/Options.html#{{ key }}">{{ key }}</a></td>
{# uWSGI allows to use options without values if value = true #}
@@ -55,10 +56,32 @@
</tbody>
</table>
</div>
-
+ <div class="module">
+ <table>
+ <caption>
+ <h4>{% trans 'Magic table' %} (<a href="http://uwsgi-docs.readthedocs.io/en/latest/Configuration.html#magic-variables">read docs</a>)</h4>
+ </caption>
+ <thead>
+ <tr>
+ <th>{% trans "Option" %}</th>
+ <th>{% trans "Value" %}</th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for key, value in uwsgi.magic_table.items %}
+ <tr class="{% cycle 'djDebugOdd' 'djDebugEven' %}">
+ <td>{{ key }}</td>
+ <td>{{ value }}</td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ </div>
<div class="module balanced">
- <h4>{% trans 'Workers' %}</h4>
<table>
+ <caption>
+ <h4>{% trans 'Workers' %}</h4>
+ </caption>
<thead>
<tr>
<th>{% trans "id" %}</th>
@@ -98,67 +121,101 @@
</table>
</div>
<div class="module balanced">
- <h4>{% trans 'Applications' %}</h4>
<table>
+ <caption>
+ <h4>{% trans 'Applications' %}</h4>
+ </caption>
<thead>
- <tr>
- <th>{% trans "#" %}</th>
- <th>{% trans "modifier1" %}</th>
- <th>{% trans "mountpoint" %}</th>
- <th>{% trans "interpreter" %}</th>
- <th>{% trans "callable" %}</th>
- <th>{% trans "chdir" %}</th>
- <th>{% trans "requests" %}</th>
- <th>{% trans "exceptions" %}</th>
- </tr>
+ <tr>
+ <th>{% trans "#" %}</th>
+ <th>{% trans "modifier1" %}</th>
+ <th>{% trans "mountpoint" %}</th>
+ <th>{% trans "interpreter" %}</th>
+ <th>{% trans "callable" %}</th>
+ <th>{% trans "chdir" %}</th>
+ <th>{% trans "requests" %}</th>
+ <th>{% trans "exceptions" %}</th>
+ </tr>
</thead>
<tbody>
{% for w in workers %}
{% for app in w.apps %}
- <tr class="{% cycle 'djDebugOdd' 'djDebugEven' %}">
- <td>{{ app.id }}</td>
- <td>{{ app.modifier1 }}</td>
- <td>{{ app.mountpoint }}</td>
- <td>{{ app.interpreter }}</td>
- <td>{{ app.callable }}</td>
- <td>{{ app.chdir }}</td>
- <td>{{ app.requests }}</td>
- <td>{{ app.exceptions }}</td>
- </tr>
+ <tr class="{% cycle 'djDebugOdd' 'djDebugEven' %}">
+ <td>{{ app.id }}</td>
+ <td>{{ app.modifier1 }}</td>
+ <td>{{ app.mountpoint }}</td>
+ <td>{{ app.interpreter }}</td>
+ <td>{{ app.callable }}</td>
+ <td>{{ app.chdir }}</td>
+ <td>{{ app.requests }}</td>
+ <td>{{ app.exceptions }}</td>
+ </tr>
{% endfor %}
{% endfor %}
</tbody>
</table>
</div>
+ {% if uwsgi.spooler_jobs %}
<div class="module balanced">
- <h4>{% trans 'Spooler jobs' %}</h4>
<table>
-
+ <caption>
+ <h4>{% trans 'Spooler' %}</h4>
+ </caption>
<thead>
<tr>
- <th>job filename</th>
- <th>environment</th>
+ <th>{% trans "job filename" %}</th>
+ <th>{% trans "environment" %}</th>
</tr>
</thead>
<tbody>
- {% for j in jobs %}
- <tr>
- <td align="left">{{ j.file }}</td>
- <td align="left">{{ j.env }}</td>
- </tr>
- {% endfor %}
+ {% for job in jobs %}
+ <tr class="{% cycle 'djDebugOdd' 'djDebugEven' %}">
+ <td align="left">{{ job.file }}</td>
+ <td align="left">{{ job.env }}</td>
+ </tr>
+ {% endfor %}
</tbody>
</table>
</div>
-
- {% if masterpid %}
+ {% endif %}
+ <div class="module balanced">
+ <table>
+ <caption>
+ <h4>{% trans 'Actions' %}</h4>
+ </caption>
+ <thead>
+ <tr>
+ <th>{% trans 'Send uWSGI Signal' %}</th>
+ <th>{% trans 'Send uWSGI Log message' %}</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr class="djDebugOdd">
+ <td align="left">
+ <form action="{% url 'uwsgi_signal' %}" method="post">
+ {% csrf_token %}
+ <label for="signal_number">{% trans 'Signal number' %}</label>
+ <input id="signal_number" type="text" size="3" name="signal_number" required>
+ <input type="submit" class="button" value="{% trans 'Send' %}">
+ </form>
+ </td>
+ <td align="left">
+ <form action="{% url 'uwsgi_log' %}" method="post">
+ {% csrf_token %}
+ <label for="log_message">{% trans 'Log message' %}</label>
+ <input id="log_message" type="text" size="72" name="log_message" required>
+ <input type="submit" class="button" value="{% trans 'Send' %}">
+ </form>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ {% if uwsgi.masterpid %}
<div class="submit-row">
<a href="{% url 'uwsgi_reload' %}" class="button">{% trans 'Gracefully reload uWSGI' %}</a>
<a href="{% url 'uwsgi_cache_clear' %}" class="button">{% trans 'Clear uWSGI cache' %}</a>
</div>
{% endif %}
-
</div>
-
-
{% endif %}
diff --git a/django_uwsgi/templates/uwsgi/wagtail_uwsgi.html b/django_uwsgi/templates/uwsgi/wagtail_uwsgi.html
index d6d9fa2..ea2a51c 100755
--- a/django_uwsgi/templates/uwsgi/wagtail_uwsgi.html
+++ b/django_uwsgi/templates/uwsgi/wagtail_uwsgi.html
@@ -22,15 +22,18 @@
<ul class="tab-nav merged">
- <li class="active"><a href="#stats" class="active">{% trans "Information" %}</a></li>
- <li><a href="#options">{% trans "Options" %}</a></li>
- <li><a href="#workers">{% trans "Workers" %}</a></li>
- <li><a href="#applications">{% trans "Applications" %}</a></li>
- <li><a href="#spooler">{% trans "Spooler" %}</a></li>
+ <li class="active"><a href="#stats" class="active">{% trans "Information" %}</a></li>
+ <li><a href="#options">{% trans "Options" %}</a></li>
+ <li><a href="#magic">{% trans "Magic Table" %}</a></li>
+ <li><a href="#workers" class="errors" data-count="{{ uwsgi.numproc }}">{% trans "Workers" %}</a></li>
+ <li><a href="#applications">{% trans "Applications" %}</a></li>
+ {% if uwsgi.spooler_jobs %}
+ <li><a href="#spooler">{% trans "Spooler" %}</a></li>
+ {% endif %}
+ <li><a href="#actions">{% trans "Actions" %}</a></li>
</ul>
-
-<div class="tab-content">
- <section id="stats" class="active">
+<div class="tab-content nice-padding">
+ <section id="stats" class="active">
<header class="nice-padding"><h2>{% trans 'Information' %}</h2></header>
<table class="listing chooser">
<thead>
@@ -42,17 +45,18 @@
<tbody>
{% for key, value in stats %}
<tr>
- <td class="title" scope="row"><h2>{{ key }}</h2></td>
+ <td class="title" scope="row">{{ key }}</td>
<td>{{ value }}</td>
</tr>
{% endfor %}
</tbody>
</table>
- </section>
-
- <section id="options">
- <header class="nice-padding"><h2>{% trans 'Options' %}</h2></header>
- <table class="listing chooser">
+ </section>
+ <section id="options">
+ <header class="nice-padding">
+ <h2>{% trans 'Options' %} (<a href="http://uwsgi-docs.readthedocs.org/en/latest/Options.html">read docs</a>)</h2>
+ </header>
+ <table class="listing chooser">
<thead>
<tr>
<th>{% trans "Option" %}</th>
@@ -60,7 +64,7 @@
</tr>
</thead>
<tbody>
- {% for key, value in options %}
+ {% for key, value in uwsgi.opt.items %}
<tr>
<td class="title" scope="row">
<h2>
@@ -73,13 +77,37 @@
{% endfor %}
</tbody>
</table>
- <header class="nice-padding"><h2>{% trans 'Magic table' %}</h2></header>
- {{ magic }}
- </section>
-
- <section id="workers">
- <header class="nice-padding"><h2>{% trans 'Workers' %}</h2></header>
- <table class="listing chooser">
+ </section>
+ <section id="magic">
+ <header class="nice-padding">
+ <h2>{% trans 'Magic table' %} (<a href="http://uwsgi-docs.readthedocs.io/en/latest/Configuration.html#magic-variables">read docs</a>)</h2>
+ </header>
+ <table class="listing chooser">
+ <thead>
+ <tr>
+ <th>{% trans "Option" %}</th>
+ <th>{% trans "Value" %}</th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for key, value in uwsgi.magic_table.items %}
+ <tr>
+ <td class="title" scope="row">
+ <h2>
+ {{ key }}
+ </h2>
+ </td>
+ <td>{{ value }}</td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ </section>
+ <section id="workers">
+ <header class="nice-padding">
+ <h2>{% trans 'Workers' %}</h2>
+ </header>
+ <table class="listing chooser">
<thead>
<tr>
<th>{% trans "id" %}</th>
@@ -93,8 +121,10 @@
<th>{% trans "load" %}</th>
<th>{% trans "last spawn" %}</th>
<th>{% trans "respawn count" %}</th>
+ {% if 'memory-report' in uwsgi.opt %}
<th>{% trans "address space (vsz)" %}</th>
<th>{% trans "resident memory (rss)" %}</th>
+ {% endif %}
</tr>
</thead>
<tbody>
@@ -111,17 +141,20 @@
<td>{{ w.load|floatformat:2 }} %</td>
<td>{{ w.last_spawn }}</td>
<td>{{ w.respawn_count }}</td>
+ {% if 'memory-report' in uwsgi.opt %}
<td>{{ w.vsz|filesizeformat }}</td>
<td>{{ w.rss|filesizeformat }}</td>
+ {% endif %}
</tr>
{% endfor %}
</tbody>
</table>
- </section>
-
- <section id="applications">
- <header class="nice-padding"><h2>{% trans 'Applications' %}</h2></header>
- <table class="listing chooser">
+ </section>
+ <section id="applications">
+ <header class="nice-padding">
+ <h2>{% trans 'Applications' %}</h2>
+ </header>
+ <table class="listing chooser">
<thead>
<tr>
<th>{% trans "#" %}</th>
@@ -135,7 +168,7 @@
</tr>
</thead>
<tbody>
- {% for w in workers %}
+ {% for w in uwsgi.workers %}
{% for app in w.apps %}
<tr>
<td>{{ app.id }}</td>
@@ -151,10 +184,13 @@
{% endfor %}
</tbody>
</table>
- </section>
- <section id="spooler">
- <header class="nice-padding"><h2>{% trans 'Spooler' %}</h2></header>
- <table class="listing chooser">
+ </section>
+ {% if uwsgi.spooler_jobs %}
+ <section id="spooler">
+ <header class="nice-padding">
+ <h2>{% trans 'Spooler' %}</h2>
+ </header>
+ <table class="listing chooser">
<thead>
<tr>
<th>{% trans "job filename" %}</th>
@@ -162,35 +198,75 @@
</tr>
</thead>
<tbody>
- {% for j in jobs %}
- <tr>
- <td align="left">{{ j.file }}</td>
- <td align="left">{{ j.env }}</td>
- </tr>
- {% endfor %}
+ {% for job in jobs %}
+ <tr>
+ <td align="left">{{ job.file }}</td>
+ <td align="left">{{ job.env }}</td>
+ </tr>
+ {% endfor %}
</tbody>
</table>
- </section>
+ </section>
+ {% endif %}
+ <section id="actions">
+ <header class="nice-padding"><h2>{% trans 'Actions' %}</h2></header>
+ <form action="{% url 'uwsgi_signal' %}" method="post">
+ {% csrf_token %}
+ <ul class="fields">
+ <li class="required">
+ <div class="field char_field text_input">
+ <label for="signal_number">{% trans 'Signal number' %}</label>
+ <div class="field-content">
+ <div class="input">
+ <input id="signal_number" type="text" size="3" name="signal_number" required>
+ <span></span>
+ </div>
+ <p class="help">{% trans 'Signal number' %}</p>
+ </div>
+ </div>
+ </li>
+ <li>
+ <input type="submit" class="button" value="{% trans 'Send' %}">
+ </li>
+ </ul>
+ </form>
+ <form action="{% url 'uwsgi_log' %}" method="post">
+ {% csrf_token %}
+ <ul class="fields">
+ <li class="required">
+ <div class="field char_field text_input">
+ <label for="log_message">{% trans 'Log message' %}</label>
+ <div class="field-content">
+ <div class="input">
+ <input id="log_message" type="text" size="72" name="log_message" required>
+ <span></span>
+ </div>
+ <p class="help">{% trans 'Log message' %}</p>
+ </div>
+ </div>
+ </li>
+ <li>
+ <input type="submit" class="button" value="{% trans 'Send' %}">
+ </li>
+ </ul>
+ </form>
+ </section>
</div>
-
-
-
<footer>
<ul>
- {% if masterpid %}
+ {% if uwsgi.masterpid %}
<li class="actions">
<a class="button no bicolor icon icon-repeat" href="{% url 'uwsgi_reload' %}">{% trans 'Gracefully reload uWSGI' %}</a>
</li>
- <li class="actions">
+ <li class="actions preview">
<a class="button bicolor icon icon-bin" href="{% url 'uwsgi_cache_clear' %}">{% trans 'Clear uWSGI cache' %}</a>
</li>
{% endif %}
<li class="meta">
- <p class="modified"><a target="_blank" href="https://github.com/unbit/uwsgi">{% trans "uWSGI version" %} {{ version }}</a> running @ {{ hostname }}</p>
+ <p class="modified">
+ <a target="_blank" href="https://github.com/unbit/uwsgi" class="underlined">{% trans "uWSGI version" %} {{ uwsgi.version }}</a> running @ {{ uwsgi.hostname }}</p>
</li>
</ul>
</footer>
-
{% endif %}
-
{% endblock %}
\ No newline at end of file
diff --git a/django_uwsgi/urls.py b/django_uwsgi/urls.py
old mode 100755
new mode 100644
index dd3eab8..31e3e74
--- a/django_uwsgi/urls.py
+++ b/django_uwsgi/urls.py
@@ -1,8 +1,16 @@
from django.conf.urls import url
+from django.contrib import admin
from . import views
urlpatterns = [
- url(r'^$', views.UwsgiStatus.as_view(), name='uwsgi_index'),
- url(r'^reload/$', views.UwsgiReload.as_view(), name='uwsgi_reload'),
- url(r'^clear_cache/$', views.UwsgiCacheClear.as_view(), name='uwsgi_cache_clear'),
... 353 lines suppressed ...
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/django-uwsgi.git
More information about the Python-modules-commits
mailing list