Merge pull request #1398 from emanuelschuetze/portable-install-script
Improved portable install script.
This commit is contained in:
commit
9b89e10cc7
@ -86,14 +86,14 @@ portable version you should observe the following install steps.*
|
|||||||
and Setuptools on your system.
|
and Setuptools on your system.
|
||||||
|
|
||||||
a. Download and run the `Python 32-bit MSI installer
|
a. Download and run the `Python 32-bit MSI installer
|
||||||
<http://www.python.org/ftp/python/2.7.6/python-2.7.6.msi>`_. Note
|
<http://www.python.org/ftp/python/2.7.9/python-2.7.9.msi>`_. Note
|
||||||
that the 32-bit MSI installer is required even on a 64-bit Windows
|
that the 32-bit MSI installer is required even on a 64-bit Windows
|
||||||
system. If you use the 64-bit MSI installer, step 3 of this
|
system. If you use the 64-bit MSI installer, step 3 of this
|
||||||
instruction will fail unless you installed the package reportlab
|
instruction will fail unless you installed the package reportlab
|
||||||
manually.
|
manually.
|
||||||
|
|
||||||
b. Add python directories to PATH (via Control Panel > System >
|
b. Add python directories to PATH (via Control Panel > System >
|
||||||
Advanced): ``";C:\\Python27;C:\\Python27\\Scripts"``. Note that the path
|
Advanced): ``";C:\Python27;C:\Python27\Scripts"``. Note that the path
|
||||||
can differ if you customized the install of Python in the first step.
|
can differ if you customized the install of Python in the first step.
|
||||||
|
|
||||||
c. Download and run (via double click) the last `install script
|
c. Download and run (via double click) the last `install script
|
||||||
@ -110,7 +110,7 @@ portable version you should observe the following install steps.*
|
|||||||
To install Virtual Python Environment builder, open command line (cmd)
|
To install Virtual Python Environment builder, open command line (cmd)
|
||||||
and run::
|
and run::
|
||||||
|
|
||||||
> easy_install https://pypi.python.org/packages/source/v/virtualenv/virtualenv-1.11.6.tar.gz
|
> easy_install https://pypi.python.org/packages/source/v/virtualenv/virtualenv-12.0.5.tar.gz
|
||||||
|
|
||||||
Create your OpenSlides directory, change to it, setup and activate the
|
Create your OpenSlides directory, change to it, setup and activate the
|
||||||
virtual environment::
|
virtual environment::
|
||||||
|
@ -5,34 +5,21 @@ How to create a new portable Windows distribution of OpenSlides:
|
|||||||
Follow the instructions in the README, section III (Windows installation), step 1.
|
Follow the instructions in the README, section III (Windows installation), step 1.
|
||||||
|
|
||||||
|
|
||||||
2. Install all required python packages (see requirements_production.txt):
|
2. Install all required python packages from requirements_production.txt:
|
||||||
|
(Note: You have to use 'easy_install -Z $PACKAGENAME')
|
||||||
|
|
||||||
easy_install -Z "django<1.7" ^
|
python install-requirements.py
|
||||||
backports.ssl_match_hostname ^
|
|
||||||
"beautifulsoup4<4.4" ^
|
|
||||||
"bleach<1.5" ^
|
|
||||||
"django-ckeditor-updated<4.3" ^
|
|
||||||
"django-haystack<2.2" ^
|
|
||||||
"django-mptt<0.7" ^
|
|
||||||
"jsonfield<0.10" ^
|
|
||||||
"natsort<3.3" ^
|
|
||||||
"reportlab<2.8" ^
|
|
||||||
"roman<2.1" ^
|
|
||||||
"sockjs_tornado<1.1" ^
|
|
||||||
"tornado<3.3" ^
|
|
||||||
"whoosh<2.6" ^
|
|
||||||
"setuptools<3.7"
|
|
||||||
|
|
||||||
|
|
||||||
3. Install pywin32 from binary installer:
|
3. Install pywin32 from binary installer:
|
||||||
http://sourceforge.net/projects/pywin32/files/pywin32/Build%20218/pywin32-218.win32-py2.7.exe/download
|
http://sourceforge.net/projects/pywin32/files/pywin32/Build%20219/pywin32-219.win32-py2.7.exe/download
|
||||||
|
|
||||||
Pywin32 is used to update the version resource of the prebuild openslides.exe.
|
Pywin32 is used to update the version resource of the prebuild openslides.exe.
|
||||||
It is not strictly required but at least for published releases it is highly advisable.
|
It is not strictly required but at least for published releases it is highly advisable.
|
||||||
|
|
||||||
|
|
||||||
4. Install wxPython from binary installer:
|
4. Install wxPython from binary installer:
|
||||||
http://downloads.sourceforge.net/wxpython/wxPython2.8-win32-unicode-2.8.12.1-py27.exe
|
http://sourceforge.net/projects/wxpython/files/wxPython/2.8.12.1/wxPython2.8-win32-unicode-2.8.12.1-py27.exe/download
|
||||||
|
|
||||||
WxPython is required to build the OpenSlides GUI frontend.
|
WxPython is required to build the OpenSlides GUI frontend.
|
||||||
|
|
||||||
|
12
extras/win32-portable/install-requirements.py
Normal file
12
extras/win32-portable/install-requirements.py
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import os
|
||||||
|
|
||||||
|
f = open("../../requirements_production.txt")
|
||||||
|
reqs = f.read().split("\n")
|
||||||
|
|
||||||
|
for req in reqs:
|
||||||
|
# ignore comments or pip options
|
||||||
|
if req.startswith('--') or req.startswith('#'):
|
||||||
|
continue
|
||||||
|
# ignore blank lines
|
||||||
|
if len(req) > 0:
|
||||||
|
os.system('easy_install -Z -U "%s"' % req)
|
@ -3,8 +3,9 @@
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.contrib.sessions.models import Session
|
|
||||||
from django.utils.html import urlize
|
from django.utils.html import urlize
|
||||||
|
from django.utils.importlib import import_module
|
||||||
|
|
||||||
from sockjs.tornado import SockJSConnection
|
from sockjs.tornado import SockJSConnection
|
||||||
|
|
||||||
|
|
||||||
@ -20,22 +21,25 @@ class ChatboxSocketHandler(SockJSConnection):
|
|||||||
"""
|
"""
|
||||||
from openslides.participant.models import User
|
from openslides.participant.models import User
|
||||||
|
|
||||||
# TODO: Use the django way to get the session to be compatible with
|
# get the session (compatible with other auth-backends)
|
||||||
# other auth-backends; see comment in pull request #1220:
|
engine = import_module(settings.SESSION_ENGINE)
|
||||||
# https://github.com/OpenSlides/OpenSlides/pull/1220#discussion_r11565705
|
|
||||||
session_key = info.get_cookie(settings.SESSION_COOKIE_NAME).value
|
|
||||||
session = Session.objects.get(session_key=session_key)
|
|
||||||
try:
|
try:
|
||||||
self.user = User.objects.get(pk=session.get_decoded().get('_auth_user_id'))
|
session_key = info.get_cookie(settings.SESSION_COOKIE_NAME).value
|
||||||
|
session = engine.SessionStore(session_key)
|
||||||
|
pk = session.get_decoded().get('_auth_user_id')
|
||||||
|
except AttributeError:
|
||||||
|
return False
|
||||||
|
|
||||||
|
try:
|
||||||
|
self.user = User.objects.get(pk)
|
||||||
except User.DoesNotExist:
|
except User.DoesNotExist:
|
||||||
return_value = False
|
return False
|
||||||
|
|
||||||
|
if self.user.has_perm('core.can_use_chat'):
|
||||||
|
self.clients.add(self)
|
||||||
|
return True
|
||||||
else:
|
else:
|
||||||
if self.user.has_perm('core.can_use_chat'):
|
return False
|
||||||
self.clients.add(self)
|
|
||||||
return_value = True
|
|
||||||
else:
|
|
||||||
return_value = False
|
|
||||||
return return_value
|
|
||||||
|
|
||||||
def on_message(self, message):
|
def on_message(self, message):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user