diff --git a/apimanager/apimanager/settings.py b/apimanager/apimanager/settings.py index d3c90b7..14fd4c7 100644 --- a/apimanager/apimanager/settings.py +++ b/apimanager/apimanager/settings.py @@ -51,47 +51,22 @@ INSTALLED_APPS = [ 'obp', 'consumers', 'users', - 'branches', - 'atms', 'entitlementrequests', 'customers', 'metrics', 'config', - 'webui', - 'methodrouting', - 'dynamicendpoints', - 'apicollections' ] MIDDLEWARE = [ - # 'django.middleware.cache.UpdateCacheMiddleware', 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', - 'django.middleware.locale.LocaleMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', - # 'django.middleware.cache.FetchFromCacheMiddleware', ] -#cache the view page, we set 60s = 1m, -# CACHE_MIDDLEWARE_SECONDS = 60 - -# TIMEOUT is 31104000 seconds = 60*60*24*30*12 (1 year) -# MAX_ENTRIES is 1000000 entities -CACHES = { - 'default': { - 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache', - 'LOCATION': 'unique-snowflake', - 'TIMEOUT': 31104000, - 'OPTIONS': { - 'MAX_ENTRIES': 10000000 - } - } -} - ROOT_URLCONF = 'apimanager.urls' TEMPLATES = [ @@ -109,9 +84,6 @@ TEMPLATES = [ 'base.context_processors.api_username', 'base.context_processors.api_user_id', 'base.context_processors.api_tester_url', - 'base.context_processors.portal_page', - 'base.context_processors.logo_url', - 'base.context_processors.override_css_url' ], }, }, @@ -153,8 +125,7 @@ AUTH_PASSWORD_VALIDATORS = [ # Internationalization # https://docs.djangoproject.com/en/1.10/topics/i18n/ -#LANGUAGE_CODE = 'en-gb' -LANGUAGE_CODE = 'fr' +LANGUAGE_CODE = 'en-gb' TIME_ZONE = 'Europe/Berlin' @@ -170,17 +141,6 @@ USE_TZ = True STATIC_URL = '/static/' -from django.utils.translation import gettext_lazy as _ - -#LANGUAGES = ( -# ("en", _("English")), -# ("fr", _("French")), -#) - -LOCALE_PATHS = ( - os.path.join(BASE_DIR, "locale/"), -) - # Set this to your local directory for static files STATIC_ROOT = os.path.join(BASE_DIR, '..', '..', 'static-collected') @@ -232,20 +192,15 @@ LOGGING = { LOGIN_URL = reverse_lazy('home') -#Map Java: yyyy-MM-dd'T'HH:mm'Z' -API_DATETIMEFORMAT = '%Y-%m-%dT%H:%M:%SZ' -#Map Java: yyyy-MM-dd'T'HH:mm:ss.SSS'Z' -API_DATEFORMAT = '%Y-%m-%dT%H:%M:%S.%fZ' -# the API_Manager the web form date format, eg: 2020-10-11 -API_MANAGER_DATE_FORMAT= '%Y-%m-%d' +API_DATETIMEFORMAT = '%Y-%m-%dT%H:%M:%SZ' +#API_DATEFORMAT = '%Y-%m-%d' +API_DATEFORMAT = '%Y-%m-%dT%H:%M:%S' API_HOST = 'http://127.0.0.1:8080' -# Only override this if you have a separate portal instance -API_PORTAL = API_HOST API_BASE_PATH = '/obp/v' -API_VERSION = '4.0.0' +API_VERSION = '3.1.0' # URL to API Tester if it is running on API_HOST API_TESTER_URL = '' @@ -268,40 +223,30 @@ DIRECTLOGIN_PATH = '/my/logins/direct' # Set to true if the API is connected to a core banking system GATEWAYLOGIN_HAS_CBS = False - -# Use BOOTSTRAP3 if you are using Bootstrap 3 -BOOTSTRAP4 = { - 'include_jquery': True, -} - -# Apps to exclude when request to OBP-API's api -EXCLUDE_APPS = [] -# Functions to exclude when request to OBP-API's api -EXCLUDE_FUNCTIONS = [] -# Url Patterns to exclude when reqeust to OBP-API's api -EXCLUDE_URL_PATTERN = [] -# App Name to aggregate metrics -API_EXPLORER_APP_NAME = 'API Explorer' - -LOGO_URL = 'https://static.openbankproject.com/images/OBP/favicon.png' -OVERRIDE_CSS_URL = None - -VERIFY = True - # Local settings can override anything in here try: - from apimanager.local_settings import * # noqa + from apimanager.local_settings import * # noqa except ImportError: pass -# EVERYTHING BELOW HERE WILL NOT BE OVERWRITTEN BY LOCALSETTINGS! -# DO NOT TRY TO DO SO YOU WILL BE IGNORED! + +if not OAUTH_CONSUMER_KEY: + raise ImproperlyConfigured('Missing settings for OAUTH_CONSUMER_KEY') +if not OAUTH_CONSUMER_SECRET: + raise ImproperlyConfigured('Missing settings for OAUTH_CONSUMER_SECRET') # Settings here might use parts overwritten in local settings API_ROOT = API_HOST + API_BASE_PATH + API_VERSION # For some reason, swagger is not available at the latest API version API_URL_SWAGGER = API_HOST + '/obp/v1.4.0/resource-docs/v' + API_VERSION + '/swagger' # noqa -if not OAUTH_CONSUMER_KEY: - raise ImproperlyConfigured('Missing settings for OAUTH_CONSUMER_KEY') -if not OAUTH_CONSUMER_SECRET: - raise ImproperlyConfigured('Missing settings for OAUTH_CONSUMER_SECRET') +CACHES = { + 'default': { + 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache', + 'LOCATION': 'unix:/tmp/memcached.sock', + } +} + +# Use BOOTSTRAP3 if you are using Bootstrap 3 +BOOTSTRAP4 = { + 'include_jquery': True, +} diff --git a/apimanager/metrics/templates/metrics/custom_summary.html b/apimanager/metrics/templates/metrics/custom_summary.html index 757eac7..ade4143 100644 --- a/apimanager/metrics/templates/metrics/custom_summary.html +++ b/apimanager/metrics/templates/metrics/custom_summary.html @@ -90,7 +90,7 @@ - Calls per day (last 30 days): + Calls per day: somealt diff --git a/apimanager/metrics/views.py b/apimanager/metrics/views.py index 7c88465..e2ef34c 100644 --- a/apimanager/metrics/views.py +++ b/apimanager/metrics/views.py @@ -656,8 +656,10 @@ class MonthlyMetricsSummaryView(LoginRequiredMixin, TemplateView): for api in top_apis: api['Implemented_by_partial_function'] = api['Implemented_by_partial_function'] + '(' + api['implemented_in_version'] + ')' top_apis = top_apis[:10] + # for api in top_apis: + # #print("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TOP APIS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%") + # print(str(top_apis.index(api) + 1) + "," + api['Implemented_by_partial_function'] + "," + str(api['count'])) top_apis = reversed(top_apis) - return top_apis def get_top_consumers(self, cleaned_data, from_date, to_date): diff --git a/requirements.txt b/requirements.txt index a19f063..2c879a2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,13 +1,10 @@ #Django==1.11.7 -Django==2.2.13 -oauthlib==3.2.0 -requests==2.27.1 -requests-oauthlib==1.3.1 +Django==2.0.7 +oauthlib==2.0.0 +requests==2.11.1 +requests-oauthlib==0.6.2 PyJWT==1.5.3 gunicorn==19.6.0 matplotlib -django-bootstrap-datepicker-plus==3.0.5 django-mathfilters -django-bootstrap3 -#uncomment below if you cannot / want not install psycopg2 from source or distribution package -#psycopg2-binary==2.8.6 +django-bootstrap3 \ No newline at end of file