By Atul Varma
This is a simple Web application that, for any URL path, serves the
contents of an Etherpad with the same path with the MIME type
For example, if the application is served from htmlpad.org and the Etherpad backend it's configured to use is at etherpad.mozilla.org:9000, then visiting http://htmlpad.org/foo will deliver the contents of http://etherpad.mozilla.org:9000/foo as HTML.
This effectively allows people to easily collaborate on writing HTML, and it provides a very fast feedback loop between trying something out, seeing how it looks in the browser, and sharing it with others.
- Python 2.7
- pip and virtualenv
virtualenv venv # On Windows, replace the following line with 'venv\Scripts\activate'. source venv/bin/activate pip install -r requirements.txt python manage.py runserver
Then open your browser to http://localhost:8000. As you save changes to HTMLpad's source code, the server will automatically apply them, allowing you to iterate quickly.
Unlike traditional Django settings, we use environment variables for configuration to be compliant with twelve-factor apps.
Note: When an environment variable is described as representing a boolean value, if the variable exists with any value (even the empty string), the boolean is true; otherwise, it's false.
Note: When running
DEBUG is enabled.
DEBUGis a boolean value that indicates whether debugging is enabled (this should always be false in production).
AUTO_COLLECTSTATICis a boolean that determines whether to automatically run
manage.py collectstaticwhen the WSGI app is instantiated. Useful for certain production deployments, such as Heroku.
HTMLPAD_ROOTis the string prefix, including any trailing slash but no leading slash, of the HTMLpad instance on the Web server. For example, if a user browses to http://foo.com/mypad/ to access your HTMLpad's root, then the setting's value is
'mypad/'. Defaults to an empty string.
ETHERPAD_PROTOCOLis the protocol of the Etherpad instance that your HTMLpad delegates to. Defaults to 'https'.
ETHERPAD_HOSTis the Etherpad instance that your HTMLpad delegates to, formatted as a hostname:port string. Defaults to 'etherpad.mozilla.org'.
Because the HTMLpad simply delivers universally-writeable Etherpad content as raw HTML, an HTMLpad instance should probably be served on its own dedicated domain.