What is the best way to include a Mercurial changeet id (or revision) in a Django template?

I am developing a Django site and using hg for version control. I would like to insert the changeet identifier in the footer of a site, such as Stackoverflow and Bitbucket, in the footer. What is the best way to do this?

Do i need to use Mercurial api? Is there a way to get hg from the CLI to output only the revision identifier, so that I can capture this in the deployment scripts and just include plain text output in the template?

The methods you used will be appreciated. Thanks

+3
source share
1 answer

See: KeywordPlan

hg id, Mercurial. , Django.

, script/, , :

hg id >templates/id.html

Django ( ) :

Revision:  {{ include "templates/id.html" }}

(: / , Django).

+5

Source: https://habr.com/ru/post/1795370/


All Articles