Skip to content

Commit

Permalink
Merge pull request #68 from jonasvp/django1.7
Browse files Browse the repository at this point in the history
Use app framework for initializing in Django 1.7, refs #64
  • Loading branch information
jezdez committed May 23, 2014
2 parents 72fb154 + 26742d0 commit 0b05471
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
7 changes: 6 additions & 1 deletion constance/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
from constance.config import Config

config = Config()
try:
from django.apps import AppConfig
except ImportError:
config = Config()
else:
default_app_config = 'constance.apps.ConstanceConfig'
10 changes: 10 additions & 0 deletions constance/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from django.apps import AppConfig
from constance.config import Config


class ConstanceConfig(AppConfig):
name = 'constance'
verbose_name = 'Constance'

def ready(self):
self.module.config = Config()

0 comments on commit 0b05471

Please sign in to comment.