diff --git a/README.md b/README.md index 476f5f6..335a65e 100644 --- a/README.md +++ b/README.md @@ -7,15 +7,15 @@ ```xml - ServerName vue-test - ServerAlias vue-test.local + ServerName lrc + ServerAlias lrc.local ServerAdmin kurze@kit.edu - ErrorLog "/var/log/httpd/vue-test.local-error_log" - CustomLog "/var/log/httpd/vue-test.local-access_log" common + ErrorLog "/var/log/httpd/lrc.local-error_log" + CustomLog "/var/log/httpd/lrc.local-access_log" common - DocumentRoot /srv/http/vue_test/ - WSGIScriptAlias / /srv/http/vue_test/app.wsgi - + DocumentRoot /srv/http/lrc/ + WSGIScriptAlias / /srv/http/lrc/app.wsgi + Allow from all diff --git a/activate_this.py b/activate_this.py new file mode 100644 index 0000000..f18193b --- /dev/null +++ b/activate_this.py @@ -0,0 +1,34 @@ +"""By using execfile(this_file, dict(__file__=this_file)) you will +activate this virtualenv environment. + +This can be used when you must use an existing Python interpreter, not +the virtualenv bin/python +""" + +try: + __file__ +except NameError: + raise AssertionError( + "You must run this like execfile('path/to/activate_this.py', dict(__file__='path/to/activate_this.py'))") +import sys +import os + +old_os_path = os.environ.get('PATH', '') +os.environ['PATH'] = os.path.dirname(os.path.abspath(__file__)) + os.pathsep + old_os_path +base = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +if sys.platform == 'win32': + site_packages = os.path.join(base, 'Lib', 'site-packages') +else: + site_packages = os.path.join(base, 'lib', 'python%s' % sys.version[:3], 'site-packages') +prev_sys_path = list(sys.path) +import site +site.addsitedir(site_packages) +sys.real_prefix = sys.prefix +sys.prefix = base +# Move the added items to the front of the path: +new_sys_path = [] +for item in list(sys.path): + if item not in prev_sys_path: + new_sys_path.append(item) + sys.path.remove(item) +sys.path[:0] = new_sys_path diff --git a/app.wsgi b/app.wsgi index 5a2d9e3..3c211ed 100644 --- a/app.wsgi +++ b/app.wsgi @@ -1,6 +1,6 @@ #!/usr/bin/python -activate_this = '/srv/http/vue_test/venv/bin/activate_this.py' +activate_this = '/srv/http/lrc/venv/bin/activate_this.py' with open(activate_this) as file_: exec(file_.read(), dict(__file__=activate_this)) @@ -8,7 +8,7 @@ import sys import logging logging.basicConfig(stream=sys.stderr) -sys.path.insert(0, "/srv/http/vue_test/") +sys.path.insert(0, "/srv/http/lrc/") from backend import app as application application.secret_key = 'Add your secret key'