mybuddy/babybuddy/apps.py

19 lines
439 B
Python
Raw Normal View History

2017-12-26 13:53:38 +00:00
# -*- coding: utf-8 -*-
import os
from django.apps import AppConfig
from babybuddy import VERSION
class BabyBuddyConfig(AppConfig):
name = 'babybuddy'
verbose_name = 'Baby Buddy'
version = VERSION
version_string = VERSION
def ready(self):
if os.path.isfile('.git/refs/heads/master'):
commit = open('.git/refs/heads/master').read()
self.version_string += ' ({})'.format(commit[0:7])