Преглед изворни кода

Added the virtualenv management for the webui main module

Roland Haroutiounian пре 8 година
родитељ
комит
dddeae9c9e
3 измењених фајлова са 12 додато и 3 уклоњено
  1. 3
    0
      plugins/webui/confspec.py
  2. 6
    2
      plugins/webui/main.py
  3. 3
    1
      plugins/webui/templates/documents/show.html

+ 3
- 0
plugins/webui/confspec.py Прегледај датотеку

@@ -8,6 +8,9 @@ CONFSPEC = {
8 8
                             SettingValidator('dummy')),
9 9
         'listen_port': (    '9090',
10 10
                             SettingValidator('int')),
11
+        'virtualenv': ('',
12
+                       SettingValidator('path')),
13
+        'uwsgicmd': ('uwsgi_python3', SettingValidator('dummy')),
11 14
     },
12 15
     'lodel2.webui.sessions': {
13 16
         'directory': (  '/tmp/lodel2_session',

+ 6
- 2
plugins/webui/main.py Прегледај датотеку

@@ -16,8 +16,12 @@ def root_url():
16 16
 @LodelHook('lodel2_loader_main')
17 17
 def uwsgi_fork(hook_name, caller, payload):
18 18
     if Settings.webui.standalone:
19
-        cmd='uwsgi_python3 --http-socket {addr}:{port} --module plugins.webui.run'
19
+        cmd='{uwsgi} --http-socket {addr}:{port} --module plugins.webui.run'
20 20
         cmd = cmd.format(
21 21
                     addr = Settings.webui.listen_address,
22
-                    port = Settings.webui.listen_port)
22
+                    port = Settings.webui.listen_port,
23
+                    uwsgi= Settings.webui.uwsgicmd)
24
+        if Settings.webui.virtualenv != '':
25
+            cmd += " --virtualenv %s" % Settings.webui.virtualenv
26
+
23 27
         exit(os.system(cmd))

+ 3
- 1
plugins/webui/templates/documents/show.html Прегледај датотеку

@@ -1,3 +1,5 @@
1 1
 {% extends "base_backend.html" %}
2 2
 {% block title %}Lodel 2 - Document {{ id }}{% endblock %}
3
-{% block content %}ADMIN{% endblock %}
3
+{% block content %}
4
+    {{ leapi.Section.get([('lodel_id','=',id)]) }}
5
+{% endblock %}

Loading…
Откажи
Сачувај