DreamHost-friendly server files for static hosting, scripted mounting, and transparent local testing, based on CherryPy/WSGI
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
public
tmp
.gitignore
LICENSE
README.rst
application_server.py
passenger_wsgi.py

README.rst

Dreamer

DreamHost-friendly server files for static hosting, scripted mounting, and transparent local testing, based on CherryPy/WSGI.

Assumptions

We assume you have:

Installation

Installation is straightforward:

  1. Locate your server domain folder (by default, this will have a public/ folder and a passenger_wsgi.py file).
  2. Replace contents of that folder with this repository (passenger_wsgi.py should overwrite passenger_wsgi.py, etc.)
  3. Modify passenger_wsgi.py to specify the path to your user-level Python 3 installation, if necessary.
  4. Use pip3 from your user-level Python to install cherrypy.
  5. Touch tmp/restart.txt when you need to reload the CherryPy server.

Features

  • Static files are served from the public/ folder. This includes require.js and the associated client-side application entry point main.js.
  • Dynamic resource paths can be implemented by adding methods to the Server object defined in application_server.py decorated with @cherrypy.expose. The test() method is included as an example.
  • If developing on your local computer before deploying, you can run application_server.py directly to mount and test an identical local version of the server.

Tips

  • Add SSL certs from Let's Encrypt, then utilize CherryPy session management to implement secure logins.
  • Clone this to a bare repository in your user folder, then pull directly into the server domain folder whenever there are any updates to avoid batch-replacing files.
  • Develop as much as possible in the client-side JavaScript application to minimize overhead on the WSGI interface (especially as your application scales); identify client-server data interfaces explicitly by exposing non-static methods in the Server object.