ZeroNet allows you to publish static and dynamic sites.
In this tutorial we going to build a P2P, decentralized, server and backend-less chat site in less then 100 lines of code.
ZeroNet Debug mode
ZeroNet comes with a
--debug flag that will make site development easier.
To run ZeroNet in debug mode use:
python zeronet.py --debug
Debug mode features:
- Debug messages will appear in the console
- Auto reload of some source files (UiRequest, UiWebsocket, FileRequest) on modification to prevent restarting (Requires PyFilesystem on GNU/Linux)
http://127.0.0.1:43110/DebugTraceback and interactive Python console at the last error position (using the wonderful Werkzeug debugger - Requires Werkzeug)
http://127.0.0.1:43110/ConsoleSpawns an interactive Python console (Requires Werkzeug)
Extra features (works only for sites that you own)
- Merged CSS files: All CSS files inside the site folder will be merged into one file called
all.css. You can choose to include only this file to your site. If you want to keep the other CSS files to make the development easier, you can add them to the ignore key of your
content.json. This way, they won't be published with your site. (eg: add to your
"ignore": "(js|css)/(?!all.(js|css))"this will ignore all CSS and JS files except
- Merged JS files: All JS files inside the site folder will be merged into one file called
all.js. If a CoffeeScript compiler is present (bundled for Windows) it will convert
- Order in which files are merged into all.css/all.js: Files inside subdirectories of the css/js folder comes first; Files in the css/js folder will be merged according to file name ordering (01_a.css, 02_a.css, etc)