Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions flat/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
__version__ = '1.1.3'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update version up to 1.2.0

default_app_config = 'flat.apps.FlatConfig'
13 changes: 13 additions & 0 deletions flat/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# -*- coding: utf-8 -*-
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need it here since there's no non-ascii characters in code


from django.apps import AppConfig


class FlatConfig(AppConfig):
name = 'flat'
verbose_name = 'Django flat theme'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use Title Case here


def ready(self):
from flat import settings

settings.check_installed_apps()
21 changes: 21 additions & 0 deletions flat/settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-

import django
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured


def check_installed_apps():
dj_version = django.VERSION
installed_apps = settings.INSTALLED_APPS

if dj_version < (1, 9):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see real use case for this. Obviously if someone installed 'flat' by pip and doesn't use it - we shouldn't warn user.

Let's use only if dj_version > (1, 9): case.

if 'flat' not in installed_apps:
raise ImproperlyConfigured(
'\'flat\' needed before django 1.9, '
'add it to settings.INSTALLED_APPS.')
else:
if 'flat' in installed_apps:
raise ImproperlyConfigured(
'\'flat\' not needed since django 1.9, '
'remove it from settings.INSTALLED_APPS.')