-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#3 | Added hourly electricity usage.
- Loading branch information
1 parent
7b86d23
commit 08c046e
Showing
13 changed files
with
200 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,23 @@ | ||
import warnings | ||
|
||
from django.apps import AppConfig | ||
from django.db import connection | ||
from django.utils.translation import ugettext_lazy as _ | ||
|
||
|
||
class AppConfig(AppConfig): | ||
""" The backend app solely exists for triggering a backend signal. """ | ||
name = 'dsmr_backend' | ||
verbose_name = _('Backend') | ||
|
||
def ready(self): | ||
""" Performs an DB engine check, as we maintain some engine specific queries. """ | ||
if (connection.vendor not in ['postgresql', 'mysql']): | ||
# Temporary for backwards compatibility | ||
warnings.showwarning( | ||
_( | ||
'Unsupported database engine "{}" active, ' | ||
'some features might not work properly'.format(connection.vendor) | ||
), | ||
RuntimeWarning, __file__, 0 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,4 @@ | ||
from dsmrreader.config.base import * | ||
|
||
|
||
DATABASES = { | ||
'default': { | ||
'ENGINE': 'django.db.backends.postgresql_psycopg2', | ||
'NAME': 'dsmrreader', | ||
'USER': 'dsmrreader', | ||
'PASSWORD': 'dsmrreader', | ||
'HOST': '127.0.0.1', | ||
'PORT': '5432', | ||
'CONN_MAX_AGE': 300, | ||
} | ||
} | ||
|
||
CACHES['default']['TIMEOUT'] = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Oops, something went wrong.