{"result":{"depiction_url":null,"edges":{"observes":{"objects":[{"created":"2026-09-09T13:47:45Z","object_id":{"id":1442,"is_a":["text","documentation","reference","notification"],"name":"doc_notification_request_context","title":"observe_request_context\/3","uri":"https:\/\/zotonic.com\/id\/1442"},"seq":1},{"created":"2026-09-09T13:47:45Z","object_id":{"id":1466,"is_a":["text","documentation","reference","notification"],"name":"doc_notification_admin_menu","title":"observe_admin_menu\/3","uri":"https:\/\/zotonic.com\/id\/1466"},"seq":2},{"created":"2026-09-09T13:47:45Z","object_id":{"id":1628,"is_a":["text","documentation","reference","notification"],"name":"doc_notification_filewatcher","title":"observe_filewatcher\/2","uri":"https:\/\/zotonic.com\/id\/1628"},"seq":3},{"created":"2026-09-09T13:47:45Z","object_id":{"id":2067,"is_a":["text","documentation","reference","notification"],"name":"doc_notification_debug","title":"observe_debug\/2","uri":"https:\/\/zotonic.com\/id\/2067"},"seq":4},{"created":"2026-09-09T13:47:45Z","object_id":{"id":2538,"is_a":["text","documentation","reference","notification"],"name":"doc_notification_development_reload","title":"observe_development_reload\/2","uri":"https:\/\/zotonic.com\/id\/2538"},"seq":5},{"created":"2026-09-09T13:47:45Z","object_id":{"id":2540,"is_a":["text","documentation","reference","notification"],"name":"doc_notification_development_make","title":"observe_development_make\/2","uri":"https:\/\/zotonic.com\/id\/2540"},"seq":6}],"predicate":{"id":2550,"is_a":["meta","predicate"],"name":"observes","title":{"_type":"trans","tr":{"en":"Observes"}},"uri":"https:\/\/zotonic.com\/id\/observes"}},"references":{"objects":[{"created":"2020-05-30T05:47:25Z","object_id":{"id":1372,"is_a":["text","documentation","reference","template_tag"],"name":"doc_template_tag_tag_lib","title":"lib","uri":"https:\/\/zotonic.com\/id\/1372"},"seq":1000000}],"predicate":{"id":332,"is_a":["meta","predicate"],"name":"references","title":{"_type":"trans","tr":{"en":"References"}},"uri":"https:\/\/zotonic.com\/id\/references"}},"refers":{"objects":[{"created":"2026-09-09T13:47:45Z","object_id":{"id":1372,"is_a":["text","documentation","reference","template_tag"],"name":"doc_template_tag_tag_lib","title":"lib","uri":"https:\/\/zotonic.com\/id\/1372"},"seq":1000000}],"predicate":{"id":2409,"is_a":["meta","predicate"],"name":"refers","title":{"_type":"trans","tr":{"en":"Refers"}},"uri":"https:\/\/zotonic.com\/id\/refers"}},"subject":{"objects":[{"created":"2026-09-09T13:47:45Z","object_id":{"id":2555,"is_a":["categorization","keyword","keyword_information_type"],"name":"zotonic_topic_reference","title":"Reference","uri":"https:\/\/zotonic.com\/id\/2555"},"seq":1},{"created":"2026-09-09T13:47:45Z","object_id":{"id":2564,"is_a":["categorization","keyword","keyword_audience"],"name":"zotonic_topic_backend_developer","title":"Backend developer","uri":"https:\/\/zotonic.com\/id\/2564"},"seq":2},{"created":"2026-09-09T13:47:45Z","object_id":{"id":2613,"is_a":["categorization","keyword","keyword_domain"],"name":"zotonic_topic_development_and_debugging","title":"Development and debugging","uri":"https:\/\/zotonic.com\/id\/2613"},"seq":3},{"created":"2026-09-09T13:47:45Z","object_id":{"id":2635,"is_a":["categorization","keyword","keyword_architecture"],"name":"zotonic_topic_module","title":"Module","uri":"https:\/\/zotonic.com\/id\/2635"},"seq":4},{"created":"2026-09-09T13:47:45Z","object_id":{"id":2636,"is_a":["categorization","keyword","keyword_task"],"name":"zotonic_topic_configure","title":"Configure","uri":"https:\/\/zotonic.com\/id\/2636"},"seq":5},{"created":"2026-09-09T13:47:45Z","object_id":{"id":2657,"is_a":["categorization","keyword","keyword_task"],"name":"zotonic_topic_monitor","title":"Monitor","uri":"https:\/\/zotonic.com\/id\/2657"},"seq":6}],"predicate":{"id":308,"is_a":["meta","predicate"],"name":"subject","title":{"_type":"trans","tr":{"en":"Keyword"}},"uri":"http:\/\/purl.org\/dc\/elements\/1.1\/subject"}}},"id":1457,"is_a":["text","documentation","reference","module"],"links":[{"rel":"self","target":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/1457"},{"rel":"hub","target":"https:\/\/zotonic.com\/.zotonic\/websub"}],"medium":null,"medium_url":null,"name":"doc_module_mod_development","page_url":{"en":"https:\/\/zotonic.com\/docs\/1457\/mod_development","x-default":"https:\/\/zotonic.com\/docs\/1457\/mod_development"},"preview_url":null,"resource":{"version":3987,"pivot_location_lat":null,"title":"mod_development","is_authoritative":true,"body":"<p>Presents various tools for development.<\/p>\n<h2>Admin page<\/h2>\n<p>After the development module is enabled a menu item Development is added to the System menu in the admin.<\/p>\n<p>On the development page it is possible to set debugging options, trace template compilation, and test dispatch rules.<\/p>\n<h3>Options<\/h3>\n<p>This can toggle various development options:<\/p>\n<p>Show paths to included template files in generated templates<\/p>\n<p>Checking this will add comments in the compiled templates. The comments will list the exact file included at that point.<\/p>\n<p>Show defined blocks in generated templates<\/p>\n<p>Checking this will add comments in the compiled templates. The comments will show the start and end of any template <code>{% block %} ... {% endblock %}<\/code>.<\/p>\n<p>Download css and javascript files as separate files (ie. don’t combine them in one url).<\/p>\n<p>Checking this will generate separate <code>&lt;link&gt;<\/code> and <code>&lt;script&gt;<\/code> tags for all files mentioned in a single <code>{% lib %}<\/code>\ntag. This makes debugging those files easier but makes loading pages slower as more requests will be done per page.<\/p>\n<p>Enable API to recompile &amp;amp; build Zotonic<\/p>\n<p>The api on <code>\/api\/model\/development\/get\/recompile<\/code> can be accessed to trigger a full compilation and cache flush of\nZotonic. This checkbox must be checked to enable this api.<\/p>\n<h3>Template debugging<\/h3>\n<p>The template selection mechanism is quite complicated. It takes into account all modules, their priority, the user-agent\nclass (desktop, tablet, phone or text) and optionally the category of a resource.<\/p>\n<p>With this debugging tool you can optionally select a category, and fill in the name of the template. Per user-agent\nclass the selected template will be shown.<\/p>\n<p>The second debug option is a page with a live display of all templates being compiled. With this it is possible to get\ngreater insight in the template selection and compilation.<\/p>\n<h3>Dispatch rule debugging<\/h3>\n<p>With this it is possible to see for a request path which dispatch rules are matched and\/or how it is rewritten.<\/p>\n<h3>Function call tracing<\/h3>\n<p>The function tracing tool allows you to trace calls to a specific function in a module. You can specify the module name,\nfunction name and the number of calls to trace. The output will be sent to the page that started the trace, via MQTT.<\/p>\n<p>Function tracing can be enabled or disabled in the zotonic.config file. Per default it is enabled for the\ndevelopment and test environments. You can enable it runtime using:<\/p>\n<pre><code>bin\/zotonic setconfig zotonic function_tracing_enabled true\n<\/code><\/pre>\n<p>Or disable it with:<\/p>\n<pre><code>bin\/zotonic setconfig zotonic function_tracing_enabled false\n<\/code><\/pre>\n<p>In dispatch rules it is possible to protect certain requests from being traced. This is done by adding the\ndispatch rule option <code>sensitive<\/code>. This option is set for the authentication requests. On development\nenvironments this dispatch option is ignored.<\/p>\n<h2>Automatic recompilation<\/h2>\n<div class=\"admonition note\"><p class=\"first admonition-title\">Note<\/p><p class=\"last\">The system can only scan for changed files if either <code>inotify-tools<\/code> or <code>fswatch<\/code> is installed.<\/p><\/div>\n<p>The core Zotonic system starts either <code>inotify-tools<\/code> or <code>fswatch<\/code>, depending on which one is available. You have to\ninstall one of these to enable auto-compile and auto-load of changed files.<\/p>\n<p>See below for platform-specific installation instructions.<\/p>\n<p>If a changed file is detected then Zotonic will:<\/p>\n<ul><li>If an .erl file changes then the file is recompiled.<\/li><li>If a .scss or .sass file changes then <code>sassc<\/code> is called to compile it to its .css equivalent. If the changed <code>.sass<\/code> file starts with a <code>_<\/code> then all <code>.sass<\/code> files without a <code>_<\/code> will be compiled.<\/li><li>If a .less file changes then <code>lessc<\/code> is called to compile it to its .css equivalent.<\/li><li>If a .coffee file changes then <code>coffee<\/code> is called to compile it to its .js equivalent.<\/li><li>If a lib file changes then the module indexer will be called so that any removed or added templates will be handled correctly.<\/li><li>If a template file changes then the module indexer will be called so that any removed or added template will be handled correctly.<\/li><li>If a dispatch file changes then all dispatch rules are reloaded.<\/li><li>If a beam file changes then the module will be loaded. If the beam file is a Zotonic module then it will be automatically restarted if either the function exports or the <code>mod_schema<\/code> changed.<\/li><li>If the .yrl definition of the template parser changes, then the .erl version of the parser is regenerated. (This will trigger a compile, which triggers a beam load).<\/li><\/ul>\n<h3>Linux installation<\/h3>\n<p>On Linux this feature depends on the inotifywait tool, which is part of the <code>inotify-tools<\/code> package. For displaying\nnotifications, it uses <code>notify-send<\/code>:<\/p>\n<pre class=\"notranslate\"><code class=\"notranslate language-erlang\">sudo apt-get install inotify-tools libnotify-bin\n<\/code><\/pre>\n<h3>Mac OS X installation<\/h3>\n<p>On Mac OS X (version 10.8 and higher), we use the external programs <code>fswatch<\/code> and <code>terminal-notifier<\/code>:<\/p>\n<pre class=\"notranslate\"><code class=\"notranslate language-erlang\">sudo brew install fswatch\nsudo brew install terminal-notifier\n<\/code><\/pre>\n<h2>Configuration options<\/h2>\n<p><code>mod_development.libsep<\/code><\/p>\n<p>Boolean value. If true, files requested with <a href=\"\/id\/doc_template_tag_tag_lib\" class=\"doc-reference doc-reference-tag\"><code>tag#lib<\/code><\/a> will be included separately instead\nof in one big concatenated file.<\/p>\n<h2>Accepted Events<\/h2>\n<p>This module handles the following notifier callbacks:<\/p>\n<ul><li><code>observe_admin_menu<\/code>: Add development\/debug entries to the admin menu.<\/li><li><code>observe_filewatcher<\/code>: Catch filewatcher file change events, reloads css or the open pages using <code>m_config:get_value<\/code>.<\/li><li><code>observe_request_context<\/code>: Copy the database trace flag to a new (fresh) request process using <code>z_development_dbtrace:copy_from_session<\/code>.<\/li><\/ul>\n<p>Delegate callbacks:<\/p>\n<ul><li><code>event\/2<\/code> with <code>postback<\/code> messages: <code>log_client_enable<\/code>, <code>template_debug_enable<\/code>, <code>template_graph<\/code>, <code>template_trace_fetch<\/code>, <code>template_trace_path<\/code>, <code>template_trace_start<\/code>, <code>template_trace_stop<\/code>, <code>template_view<\/code>, <code>template_xref_check<\/code>.<\/li><li><code>event\/2<\/code> with <code>submit<\/code> messages: <code>function_trace<\/code>.<\/li><\/ul>","slug":"mod_development","is_protected":false,"visible_for":0,"tz":"UTC","language":["en"],"doc_source_hash":"3c3da9491d5d150549598c525a69c9a593ff5fc08c74f098e5f856fdd69e3396","is_featured":false,"content_group_id":{"id":2551,"is_a":["meta","content_group"],"name":"content_group_imported_docs","title":"Imported documentation","uri":"https:\/\/zotonic.com\/id\/content_group_imported_docs"},"category_id":{"id":320,"is_a":["meta","category"],"name":"module","title":"Modules","uri":"https:\/\/test.zotonic.com\/id\/320"},"doc_source_path":"apps\/zotonic_mod_development\/src\/mod_development.erl","publication_start":"2023-06-24T08:18:02Z","github_url":"https:\/\/github.com\/zotonic\/zotonic\/blob\/master\/apps\/zotonic_mod_development\/src\/mod_development.erl","pivot_location_lng":null,"doc_source_kind":"module","name":"doc_module_mod_development","is_unfindable":false,"is_published":true,"pivot_geocode":null,"created":"2020-05-30T05:47:22Z","uri":null,"doc_status":"current","is_dependent":false,"erlang_app":"zotonic_mod_development","publication_end":"9999-06-01T00:00:00Z","modifier_id":{"id":1,"is_a":["person"],"name":"administrator","title":"Site Administrator","uri":"https:\/\/zotonic.com\/id\/1"},"privacy":0,"doc_source_commit":"66cb145eae7002b184e7d8c4c7bba5e53e8248e5\n","creator_id":{"id":336,"is_a":["person","robot"],"name":"gitbot","title":"Git","uri":"https:\/\/zotonic.com\/id\/336"},"modified":"2026-10-02T12:40:20Z","title_slug":"mod_development"},"uri":"https:\/\/zotonic.com\/id\/1457","uri_template":"https:\/\/zotonic.com\/id\/:id","websub":{"hub":"https:\/\/zotonic.com\/.zotonic\/websub","topic":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/1457"}},"status":"ok"}