-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
3 changed files
with
13 additions
and
3 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
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,11 +1,19 @@ | ||
from django.apps import AppConfig | ||
from django.conf import settings | ||
from openwisp_utils.api.apps import ApiAppConfig | ||
from openwisp_utils.utils import default_or_test | ||
|
||
from .compat import patch_ipaddress_lib | ||
|
||
|
||
class OpenWispIpamConfig(AppConfig): | ||
class OpenWispIpamConfig(ApiAppConfig): | ||
name = 'openwisp_ipam' | ||
verbose_name = 'IPAM' | ||
|
||
def ready(self): | ||
API_ENABLED = getattr(settings, 'OPENWISP_IPAM_API', True) | ||
REST_FRAMEWORK_SETTINGS = { | ||
'DEFAULT_THROTTLE_RATES': {'ipam': default_or_test('400/hour', None)}, | ||
} | ||
|
||
def ready(self, *args, **kwargs): | ||
super().ready(*args, **kwargs) | ||
patch_ipaddress_lib() |
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