{"result":{"depiction_url":null,"edges":{"in_module":{"objects":[{"created":"2026-09-09T13:48:12Z","object_id":{"id":335,"is_a":["text","documentation","reference","module"],"name":"doc_core","title":"Zotonic Core","uri":"https:\/\/zotonic.com\/id\/335"},"seq":1}],"predicate":{"id":333,"is_a":["meta","predicate"],"name":"in_module","title":{"_type":"trans","tr":{"en":"In module"}},"uri":"https:\/\/zotonic.com\/id\/in_module"}},"references":{"objects":[{"created":"2020-05-30T05:47:35Z","object_id":{"id":1728,"is_a":["text","documentation","reference"],"name":"doc_developerguide_configuration_site_configuration","title":"Site configuration","uri":"https:\/\/zotonic.com\/id\/1728"},"seq":1000000},{"created":"2020-05-30T05:47:35Z","object_id":{"id":1729,"is_a":["text","documentation","reference","model"],"name":"doc_model_model_config","title":"config","uri":"https:\/\/zotonic.com\/id\/1729"},"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:48:12Z","object_id":{"id":1729,"is_a":["text","documentation","reference","model"],"name":"doc_model_model_config","title":"config","uri":"https:\/\/zotonic.com\/id\/1729"},"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:48:12Z","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:48:12Z","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:48:12Z","object_id":{"id":2603,"is_a":["categorization","keyword","keyword_domain"],"name":"zotonic_topic_configuration","title":"Configuration","uri":"https:\/\/zotonic.com\/id\/2603"},"seq":3},{"created":"2026-09-09T13:48:12Z","object_id":{"id":2605,"is_a":["categorization","keyword","keyword_domain"],"name":"zotonic_topic_site_management","title":"Site management","uri":"https:\/\/zotonic.com\/id\/2605"},"seq":4},{"created":"2026-09-09T13:48:12Z","object_id":{"id":2625,"is_a":["categorization","keyword","keyword_architecture"],"name":"zotonic_topic_model","title":"Model","uri":"https:\/\/zotonic.com\/id\/2625"},"seq":5},{"created":"2026-09-09T13:48:12Z","object_id":{"id":2634,"is_a":["categorization","keyword","keyword_architecture"],"name":"zotonic_topic_site","title":"Site","uri":"https:\/\/zotonic.com\/id\/2634"},"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":1768,"is_a":["text","documentation","reference","model"],"links":[{"rel":"self","target":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/1768"},{"rel":"hub","target":"https:\/\/zotonic.com\/.zotonic\/websub"}],"medium":null,"medium_url":null,"name":"doc_model_model_site","page_url":{"en":"https:\/\/zotonic.com\/docs\/1768\/site","x-default":"https:\/\/zotonic.com\/docs\/1768\/site"},"preview_url":null,"resource":{"version":3329,"pivot_location_lat":null,"title":"site","is_authoritative":true,"body":"<p>Retrieve information that is stored in the <a href=\"\/id\/doc_developerguide_configuration_site_configuration#ref-site-configuration\">site\nconfiguration<\/a>. If you want to query\nvalues from the config table instead, you should use <a href=\"\/id\/doc_model_model_config\" class=\"doc-reference doc-reference-model\"><code>model#config<\/code><\/a>.<\/p>\n<div class=\"admonition note\"><p class=\"first admonition-title\">Note<\/p><p class=\"last\">In general the site configurarion is only accessible via the <code>m.site<\/code> template model for users with administrator\nrights. Exceptions are keys starting with <code>public<\/code> or <code>{{ m.site.title }}<\/code>, hostname configurations and the <em>paglen<\/em>.<\/p><\/div>\n<h2>Fetch a site configuration key<\/h2>\n<p>Example, fetching the site configuration key &quot;hostname&quot;:<\/p>\n<pre class=\"notranslate\"><code class=\"notranslate language-django\">{{ m.site.hostname }}\n<\/code><\/pre>\n<h2>Fetching all configurations<\/h2>\n<p>It is easy to loop over all site configurations:<\/p>\n<pre class=\"notranslate\"><code class=\"notranslate language-django\">{% for key, value in m.site %}\n  {{ key }} -- {{ value }} &lt;br&gt;\n{% endfor %}\n<\/code><\/pre>\n<h2>Overriding config values<\/h2>\n<p>Zotonic has two places where a site&#39;s configuration is kept. One is in the site&#39;s config files, the other in the\nconfig table. The config table (accessible through <a href=\"\/id\/doc_model_model_config\" class=\"doc-reference doc-reference-model\"><code>model#config<\/code><\/a>) overrules any module\nsettings from the config file, for rows where the module key of the config value is set to site.<\/p>\n<p>Within the site configuration, you can override module-specific configuration: Module configurations are defined with a\nproperty key equal to the module name, with a property list as value. For example:<\/p>\n<pre class=\"notranslate\"><code class=\"notranslate language-erlang\">{mod_foo, [ {hostname, &quot;localhost&quot;} ]}\n<\/code><\/pre>\n<p>will put the default &quot;hostname&quot; setting of the imaginary <code>mod_foo<\/code> module to <code>localhost<\/code>.<\/p>\n<h2>Default config values<\/h2>\n<p>Sites have the following default config settings:<\/p>\n<table class=\"table\"><thead><tr><th>Property<\/th><th>Description<\/th><th>Example value<\/th><\/tr><\/thead><tbody><tr><td>environment<\/td><td>Set the DTAP status of the site. Can be one of production, development, test, acceptance, education or backup. Default: production<\/td><td><code>development<\/code><\/td><\/tr><tr><td>hostname<\/td><td>The hostname of the site<\/td><td><code>example.com<\/code><\/td><\/tr><tr><td>title<\/td><td>The title of the site.<\/td><td><code>&quot;My Awesome Blog&quot;<\/code><\/td><\/tr><tr><td>protocol<\/td><td>The main protocol of the site. Used to construct urls. Default &quot;http&quot;.<\/td><td><code>&quot;https&quot;<\/code><\/td><\/tr><tr><td>document_domain<\/td><td>The document domain used for cross domain iframe javascripts. Default is the same as the cookie_domain.<\/td><td><code>www.example.com<\/code><\/td><\/tr><tr><td>cookie_domain<\/td><td>The domain to use on cookies. This defaults to undefined, which will equal the domain of the current request.<\/td><td><code>.example.com<\/code><\/td><\/tr><tr><td>session_expire_inactive<\/td><td>User inactivity timeout after seeing that the user has not been active. Default: 14400 (4 hours)<\/td><td><code>3600 (1 hour)<\/code><\/td><\/tr><tr><td>autologon_expire<\/td><td>Auto logon cookie timeout setting. Default: 15552000 (3 months)<\/td><td><code>31536000 (365 days)<\/code><\/td><\/tr><tr><td>site<\/td><td>The name of the site, an atom.<\/td><td><code>wwwzotonic.<\/code><\/td><\/tr><tr><td>hsts<\/td><td>Indicate if the site should use Strict Transport Security. When set, the browser will no longer use insecure http to access the site. Warning: Be sure your site is accessible via https before enabeling this feature. Default: false<\/td><td><code>true<\/code><\/td><\/tr><tr><td>hsts_maxage<\/td><td>The time, in seconds which browsers are allowed to remember the HSTS setting of the site. Default: 17280000 (200 days)<\/td><td><\/td><\/tr><tr><td>hsts_include_subdomains<\/td><td>When set, the browser also does not use http for subdomains. Default: false<\/td><td><\/td><\/tr><tr><td>hsts_preload<\/td><td>When set, the site&#39;s HSTS setting will be stored by the browser vender. This means that browsers only use https. Use with care, because it is hard to revert wrong settings. Default: false<\/td><td><\/td><\/tr><\/tbody><\/table>\n<h2>Available Model API Paths<\/h2>\n<table class=\"table\"><thead><tr><th>Method<\/th><th>Path pattern<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><code>get<\/code><\/td><td><code>\/site\/...<\/code><\/td><td>Return the current site name (atom) from the request context.<\/td><\/tr><tr><td><code>get<\/code><\/td><td><code>\/environment\/...<\/code><\/td><td>Return the resolved DTAP environment (<code>development<\/code>, <code>test<\/code>, <code>acceptance<\/code>, <code>production<\/code>, <code>education<\/code>, or <code>backup<\/code>).<\/td><\/tr><tr><td><code>get<\/code><\/td><td><code>\/hostname\/...<\/code><\/td><td>Return the configured hostname for the current site\/request.<\/td><\/tr><tr><td><code>get<\/code><\/td><td><code>\/hostname_port\/...<\/code><\/td><td>Return hostname including configured HTTP port.<\/td><\/tr><tr><td><code>get<\/code><\/td><td><code>\/hostname_ssl_port\/...<\/code><\/td><td>Return hostname including configured HTTPS port.<\/td><\/tr><tr><td><code>get<\/code><\/td><td><code>\/hostalias\/...<\/code><\/td><td>Return the configured <code>hostalias<\/code> site setting.<\/td><\/tr><tr><td><code>get<\/code><\/td><td><code>\/protocol\/...<\/code><\/td><td>Return the site protocol used for URL construction (typically <code>http<\/code> or <code>https<\/code>).<\/td><\/tr><tr><td><code>get<\/code><\/td><td><code>\/is_ssl\/...<\/code><\/td><td>Return whether the site is currently considered SSL-enabled.<\/td><\/tr><tr><td><code>get<\/code><\/td><td><code>\/title\/...<\/code><\/td><td>Return the configured site title as binary text.<\/td><\/tr><tr><td><code>get<\/code><\/td><td><code>\/subtitle\/...<\/code><\/td><td>Return the configured site subtitle as binary text (empty binary when unset).<\/td><\/tr><tr><td><code>get<\/code><\/td><td><code>\/email_from\/...<\/code><\/td><td>Return the effective sender address used for outgoing email.<\/td><\/tr><tr><td><code>get<\/code><\/td><td><code>\/pagelen\/...<\/code><\/td><td>Return default search page length (configured value or fallback default).<\/td><\/tr><tr><td><code>get<\/code><\/td><td><code>\/language\/...<\/code><\/td><td>Return the current request language.<\/td><\/tr><tr><td><code>get<\/code><\/td><td><code>\/default_language\/...<\/code><\/td><td>Return the site default language.<\/td><\/tr><tr><td><code>get<\/code><\/td><td><code>\/security\/...<\/code><\/td><td>Return generated <code>security.txt<\/code> data (<code>contact<\/code>, optional <code>policy<\/code>\/<code>hiring<\/code>, and <code>expires<\/code>).<\/td><\/tr><tr><td><code>get<\/code><\/td><td><code>\/+key\/...<\/code><\/td><td>Return site config value for <code>+key<\/code> when the key is public or caller is admin; otherwise <code>undefined<\/code>.<\/td><\/tr><tr><td><code>get<\/code><\/td><td><code>\/<\/code><\/td><td>Return all site configuration key\/value pairs for admins, otherwise an empty list. No further lookups.<\/td><\/tr><\/tbody><\/table>\n<p><code>\/+name<\/code> marks a variable path segment. A trailing <code>\/...<\/code> means extra path segments are accepted for further lookups.<\/p>","slug":"site","is_protected":false,"visible_for":0,"tz":"UTC","language":["en"],"doc_source_hash":"46408e834d777fa031d1c3f30d13a22035c4c8158469cd214a3f8dd04c61b944","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":322,"is_a":["meta","category"],"name":"model","title":"Models","uri":"https:\/\/test.zotonic.com\/id\/322"},"doc_source_path":"apps\/zotonic_core\/src\/models\/m_site.erl","publication_start":"2023-01-30T19:23:54Z","github_url":"https:\/\/github.com\/zotonic\/zotonic\/blob\/master\/apps\/zotonic_core\/src\/models\/m_site.erl","pivot_location_lng":null,"doc_source_kind":"model","name":"doc_model_model_site","is_unfindable":false,"is_published":true,"pivot_geocode":null,"created":"2020-05-30T05:47:34Z","uri":null,"doc_status":"current","is_dependent":false,"erlang_app":"zotonic_core","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","erlang_module":"m_site","creator_id":{"id":336,"is_a":["person","robot"],"name":"gitbot","title":"Git","uri":"https:\/\/zotonic.com\/id\/336"},"modified":"2026-10-02T12:40:36Z","title_slug":"site"},"uri":"https:\/\/zotonic.com\/id\/1768","uri_template":"https:\/\/zotonic.com\/id\/:id","websub":{"hub":"https:\/\/zotonic.com\/.zotonic\/websub","topic":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/1768"}},"status":"ok"}