Skip to content
Snippets Groups Projects
Commit f2b75f66 authored by Sven Mäder's avatar Sven Mäder :speech_balloon:
Browse files

Update wsgi, add venv

parent 4580176a
No related branches found
No related tags found
No related merge requests found
......@@ -2,16 +2,47 @@
Please first read our documentation about [[/web/webshares]].
We allow to host Python 3 web applications using [WSGI](https://en.wikipedia.org/wiki/Web_Server_Gateway_Interface), which is enabled on demand only (please [[contact us|services/contact]]).
We allow to host Python 3 web applications using [WSGI](https://en.wikipedia.org/wiki/Web_Server_Gateway_Interface),
which is enabled on demand only (please [[contact us|services/contact]]).
- The WSGI app lives at: `/home/wwwshare/public`
- The WSGI entry point is usually at: `/home/wwwshare/public/wwwshare.wsgi`
## Basic usage
If you make changes to the source code, you have to tell the webserver to restart the WSGI app by modifying the file time stamp on the WSGI entry point:
- WSGI app directory: `/home/wwwshare/public`
- WSGI entry point: `/home/wwwshare/public/wwwshare.wsgi`
All new WSGI webshares will come with a dummy app in `wwwshare.wsgi`.
Edit this file to load your application.
If you make changes to the source code, you have to tell the webserver to
restart the WSGI app by modifying the file time stamp on the WSGI entry point:
```bash
touch /home/wwwshare/public/wwwshare.wsgi
```
Our WSGI uses a [virtual environment](https://compenv.phys.ethz.ch/python/ecosystem_1/30_virtual_environments/) at `.venv/`, which contains any custom python modules.
Some python modules may be installed system wide if they are used on multiple websites (like for example Django).
## Static content
If your app hosts static content, please inform us about the relative path(s)
to the location(s) in `/home/wwwshare/public`, that contains static content.
## Virtual environment
Our WSGI uses a [virtual environment](https://compenv.phys.ethz.ch/python/ecosystem_1/30_virtual_environments/) (venv),
which contains any custom python modules and is activated by our webserver configuration.
- Location: `/home/wwwshare/private/venv`
- Requirements: `/home/wwwshare/private/requirements.txt`
- Freeze: `/home/wwwshare/private/freeze.txt`
If your app needs custom python modules, please specify them in the
[requirements file](https://pip.pypa.io/en/stable/reference/requirements-file-format/).
We will have to generate a new venv should there be any changes,
so please [[contact us|services/contact]] in that case.
In the future we might provide a way for you to re-generate the venv yourself.
But this should not be needed often, since development should happen on your local machine
and your app should only be deployed to our server once it is stable.
The freeze file will be automatically generated and contains all installed modules and versions
in the venv. It is needed to reproducibly re-generate the exact current state of the venv later,
please do not modify this file.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment