Repository navigation
Expand file tree
/
Copy pathsettings.py
More file actions
99 lines (81 loc) · 3.51 KB
/
Copy pathsettings.py
File metadata and controls
99 lines (81 loc) · 3.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# Copyright 2017 Workonline Communications (Pty) Ltd. All rights reserved.
#
# The contents of this file are licensed under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
"""Configuration settings for djangolg."""
from __future__ import unicode_literals
from django.conf import settings
# Network display name
NETNAME = getattr(settings, 'DJANGOLG_NETNAME', "Example Network")
# General contact email
GENERAL_EMAIL = getattr(settings, 'DJANGOLG_GENERAL_EMAIL',
"contact@example.com")
SUPPORT_EMAIL = getattr(settings, 'DJANGOLG_SUPPORT_EMAIL', None)
NOC_EMAIL = getattr(settings, 'DJANGOLG_NOC_EMAIL', None)
PEERING_EMAIL = getattr(settings, 'DJANGOLG_PEERING_EMAIL', None)
# Router name display function
ROUTER_LABEL = getattr(
settings, 'DJANGOLG_ROUTER_LABEL',
lambda router:
router.location.name if router.location else str(router)
)
# Lifetime of session authorisation key in seconds
# Set to 0 for unlimited
LIFETIME = getattr(settings, 'DJANGOLG_LIFETIME', 300)
# Maximum number of requests with the same key
# Set to 0 for unlimited
MAX_REQUESTS = getattr(settings, 'DJANGOLG_MAX_REQUESTS', 20)
# Link to Acceptable Use Policy
AUP_LINK = getattr(settings, 'DJANGOLG_AUP_LINK', None)
# Google reCapture settings
RECAPTCHA_ON = getattr(settings, 'DJANGOLG_RECAPTCHA_ON', False)
RECAPTCHA_URL = getattr(settings, 'DJANGOLG_RECAPTCHA_URL',
'https://www.google.com/recaptcha/api/siteverify')
RECAPTCHA_SITE_KEY = getattr(settings, 'DJANGOLG_RECAPTCHA_SITE_KEY', None)
RECAPTCHA_SECRET_KEY = getattr(settings, 'DJANGOLG_RECAPTCHA_SECRET_KEY', None)
# Base template
BASE_TEMPLATE = getattr(settings, 'DJANGOLG_BASE_TEMPLATE',
'djangolg/base.html')
# Logo Image
LOGO = getattr(settings, 'DJANGOLG_LOGO', 'djangolg/img/logo.jpg')
# Small Logo Image
SMALL_LOGO = getattr(settings, 'DJANGOLG_SMALL_LOGO',
'djangolg/img/small_logo.jpg')
# Favicon
FAVICON = getattr(settings, 'DJANGOLG_FAVICON', 'djangolg/img/favicon.ico')
# Navbar Image
NAV_IMG = getattr(settings, 'DJANGOLG_NAV_IMG', None)
# Output formatting
FORMATTED_OUTPUT = getattr(settings, 'DJANGOLG_FORMATTED_OUTPUT', False)
# Enable debugging
# this will re-raise exceptions in the view, so that stack traces
# can be inspected
DEBUG = getattr(settings, 'DJANGOLG_DEBUG', False)
# DEBUG = True
# Paths to method classes
_DEFAULT_METHODS = [
'djangolg.methods.bgp_prefix.BGPPrefixMethod',
'djangolg.methods.bgp_as_path.BGPASPathMethod',
'djangolg.methods.bgp_community.BGPCommunityMethod',
'djangolg.methods.ping.PingMethod',
'djangolg.methods.traceroute.TracerouteMethod',
]
CUSTOM_METHODS = getattr(settings, 'DJANGOLG_CUSTOM_METHODS', [])
METHODS = getattr(settings, 'DJANGOLG_METHODS',
_DEFAULT_METHODS + CUSTOM_METHODS)
# Paths to dialect classes
_DEFAULT_DIALECTS = [
'djangolg.dialects.cisco_ios.CiscoIOSDialect',
]
CUSTOM_DIALECTS = getattr(settings, 'DJANGOLG_CUSTOM_DIALECTS', [])
DIALECTS = getattr(settings, 'DJANGOLG_DIALECTS',
_DEFAULT_DIALECTS + CUSTOM_DIALECTS)