diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..40613d57 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,13 @@ + +version: 2 +updates: + + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/workflows/build_container_image.yml b/.github/workflows/build_container_image.yml index ba31a4cc..fab29e82 100644 --- a/.github/workflows/build_container_image.yml +++ b/.github/workflows/build_container_image.yml @@ -1,6 +1,9 @@ -name: build and publish container +name: build and publish container develop branch -on: [push] +on: + push: + branches: + - develop env: DOCKER_HUB_ORGANIZATION: ${{ vars.DOCKER_HUB_ORGANIZATION }} DOCKER_HUB_REPOSITORY_NGINX: apimanager-nginx @@ -17,20 +20,20 @@ jobs: run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >>$GITHUB_OUTPUT id: extract_branch - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Build the Docker image run: | echo "${{ secrets.DOCKER_HUB_TOKEN }}" | docker login -u "${{ secrets.DOCKER_HUB_USERNAME }}" --password-stdin docker.io - docker build . --file .github/Dockerfile_nginx_OC --tag docker.io/${{ env.DOCKER_HUB_ORGANIZATION }}/${{ env.DOCKER_HUB_REPOSITORY_NGINX }}:$GITHUB_SHA --tag docker.io/${{ env.DOCKER_HUB_ORGANIZATION }}/${{ env.DOCKER_HUB_REPOSITORY_NGINX }}:${{ steps.extract_branch.outputs.branch }}-OC + docker build . --file .github/Dockerfile_nginx_OC --tag docker.io/${{ env.DOCKER_HUB_ORGANIZATION }}/${{ env.DOCKER_HUB_REPOSITORY_NGINX }}:$GITHUB_SHA --tag docker.io/${{ env.DOCKER_HUB_ORGANIZATION }}/${{ env.DOCKER_HUB_REPOSITORY_NGINX }}:${{ steps.extract_branch.outputs.branch }}-OC --tag docker.io/${{ env.DOCKER_HUB_ORGANIZATION }}/${{ env.DOCKER_HUB_REPOSITORY_NGINX }}:latest-OC docker push docker.io/${{ env.DOCKER_HUB_ORGANIZATION }}/${{ env.DOCKER_HUB_REPOSITORY_NGINX }} --all-tags echo docker apimanager-nginx-OC done - docker build . --file .github/Dockerfile_OC --tag docker.io/${{ env.DOCKER_HUB_ORGANIZATION }}/${{ env.DOCKER_HUB_REPOSITORY }}:$GITHUB_SHA --tag docker.io/${{ env.DOCKER_HUB_ORGANIZATION }}/${{ env.DOCKER_HUB_REPOSITORY }}:${{ steps.extract_branch.outputs.branch }}-OC + docker build . --file .github/Dockerfile_OC --tag docker.io/${{ env.DOCKER_HUB_ORGANIZATION }}/${{ env.DOCKER_HUB_REPOSITORY }}:$GITHUB_SHA --tag docker.io/${{ env.DOCKER_HUB_ORGANIZATION }}/${{ env.DOCKER_HUB_REPOSITORY }}:${{ steps.extract_branch.outputs.branch }}-OC --tag docker.io/${{ env.DOCKER_HUB_ORGANIZATION }}/${{ env.DOCKER_HUB_REPOSITORY }}:latest-OC docker push docker.io/${{ env.DOCKER_HUB_ORGANIZATION }}/${{ env.DOCKER_HUB_REPOSITORY }} --all-tags echo docker api-manager-OC done - docker build . --file Dockerfile_nginx --tag docker.io/${{ env.DOCKER_HUB_ORGANIZATION }}/${{ env.DOCKER_HUB_REPOSITORY_NGINX }}:$GITHUB_SHA --tag docker.io/${{ env.DOCKER_HUB_ORGANIZATION }}/${{ env.DOCKER_HUB_REPOSITORY_NGINX }}:${{ steps.extract_branch.outputs.branch }} + docker build . --file Dockerfile_nginx --tag docker.io/${{ env.DOCKER_HUB_ORGANIZATION }}/${{ env.DOCKER_HUB_REPOSITORY_NGINX }}:$GITHUB_SHA --tag docker.io/${{ env.DOCKER_HUB_ORGANIZATION }}/${{ env.DOCKER_HUB_REPOSITORY_NGINX }}:${{ steps.extract_branch.outputs.branch }} --tag docker.io/${{ env.DOCKER_HUB_ORGANIZATION }}/${{ env.DOCKER_HUB_REPOSITORY_NGINX }}:latest docker push docker.io/${{ env.DOCKER_HUB_ORGANIZATION }}/${{ env.DOCKER_HUB_REPOSITORY_NGINX }} --all-tags echo docker apimanager-nginx done - docker build . --file Dockerfile --tag docker.io/${{ env.DOCKER_HUB_ORGANIZATION }}/${{ env.DOCKER_HUB_REPOSITORY }}:$GITHUB_SHA --tag docker.io/${{ env.DOCKER_HUB_ORGANIZATION }}/${{ env.DOCKER_HUB_REPOSITORY }}:${{ steps.extract_branch.outputs.branch }} + docker build . --file Dockerfile --tag docker.io/${{ env.DOCKER_HUB_ORGANIZATION }}/${{ env.DOCKER_HUB_REPOSITORY }}:$GITHUB_SHA --tag docker.io/${{ env.DOCKER_HUB_ORGANIZATION }}/${{ env.DOCKER_HUB_REPOSITORY }}:${{ steps.extract_branch.outputs.branch }} --tag docker.io/${{ env.DOCKER_HUB_ORGANIZATION }}/${{ env.DOCKER_HUB_REPOSITORY }}:latest docker push docker.io/${{ env.DOCKER_HUB_ORGANIZATION }}/${{ env.DOCKER_HUB_REPOSITORY }} --all-tags echo docker api-manager done - uses: sigstore/cosign-installer@main diff --git a/.github/workflows/build_container_image_non_develop_branches.yml b/.github/workflows/build_container_image_non_develop_branches.yml new file mode 100644 index 00000000..d882893e --- /dev/null +++ b/.github/workflows/build_container_image_non_develop_branches.yml @@ -0,0 +1,69 @@ +name: build and publish container non develop branches + +on: + push: + branches: + - '*' + - '!develop' +env: + DOCKER_HUB_ORGANIZATION: ${{ vars.DOCKER_HUB_ORGANIZATION }} + DOCKER_HUB_REPOSITORY_NGINX: apimanager-nginx + DOCKER_HUB_REPOSITORY: api-manager + + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Extract branch name + shell: bash + run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >>$GITHUB_OUTPUT + id: extract_branch + + - uses: actions/checkout@v4 + - name: Build the Docker image + run: | + echo "${{ secrets.DOCKER_HUB_TOKEN }}" | docker login -u "${{ secrets.DOCKER_HUB_USERNAME }}" --password-stdin docker.io + docker build . --file .github/Dockerfile_nginx_OC --tag docker.io/${{ env.DOCKER_HUB_ORGANIZATION }}/${{ env.DOCKER_HUB_REPOSITORY_NGINX }}:$GITHUB_SHA --tag docker.io/${{ env.DOCKER_HUB_ORGANIZATION }}/${{ env.DOCKER_HUB_REPOSITORY_NGINX }}:${{ steps.extract_branch.outputs.branch }}-OC + docker push docker.io/${{ env.DOCKER_HUB_ORGANIZATION }}/${{ env.DOCKER_HUB_REPOSITORY_NGINX }} --all-tags + echo docker apimanager-nginx-OC done + docker build . --file .github/Dockerfile_OC --tag docker.io/${{ env.DOCKER_HUB_ORGANIZATION }}/${{ env.DOCKER_HUB_REPOSITORY }}:$GITHUB_SHA --tag docker.io/${{ env.DOCKER_HUB_ORGANIZATION }}/${{ env.DOCKER_HUB_REPOSITORY }}:${{ steps.extract_branch.outputs.branch }}-OC + docker push docker.io/${{ env.DOCKER_HUB_ORGANIZATION }}/${{ env.DOCKER_HUB_REPOSITORY }} --all-tags + echo docker api-manager-OC done + docker build . --file Dockerfile_nginx --tag docker.io/${{ env.DOCKER_HUB_ORGANIZATION }}/${{ env.DOCKER_HUB_REPOSITORY_NGINX }}:$GITHUB_SHA --tag docker.io/${{ env.DOCKER_HUB_ORGANIZATION }}/${{ env.DOCKER_HUB_REPOSITORY_NGINX }}:${{ steps.extract_branch.outputs.branch }} + docker push docker.io/${{ env.DOCKER_HUB_ORGANIZATION }}/${{ env.DOCKER_HUB_REPOSITORY_NGINX }} --all-tags + echo docker apimanager-nginx done + docker build . --file Dockerfile --tag docker.io/${{ env.DOCKER_HUB_ORGANIZATION }}/${{ env.DOCKER_HUB_REPOSITORY }}:$GITHUB_SHA --tag docker.io/${{ env.DOCKER_HUB_ORGANIZATION }}/${{ env.DOCKER_HUB_REPOSITORY }}:${{ steps.extract_branch.outputs.branch }} + docker push docker.io/${{ env.DOCKER_HUB_ORGANIZATION }}/${{ env.DOCKER_HUB_REPOSITORY }} --all-tags + echo docker api-manager done + - uses: sigstore/cosign-installer@main + - name: Write signing key to disk (only needed for `cosign sign --key`) + run: echo "${{ secrets.COSIGN_PRIVATE_KEY }}" > cosign.key + - name: Sign container image with annotations from our environment + env: + COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }} + run: | + cosign sign -y --key cosign.key \ + -a "repo=${{ github.repository }}" \ + -a "workflow=${{ github.workflow }}" \ + -a "ref=${{ github.sha }}" \ + docker.io/${{ env.DOCKER_HUB_ORGANIZATION }}/${{ env.DOCKER_HUB_REPOSITORY }}:${{ steps.extract_branch.outputs.branch }}-OC + cosign sign -y --key cosign.key \ + -a "repo=${{ github.repository }}" \ + -a "workflow=${{ github.workflow }}" \ + -a "ref=${{ github.sha }}-nginx" \ + docker.io/${{ env.DOCKER_HUB_ORGANIZATION }}/${{ env.DOCKER_HUB_REPOSITORY_NGINX }}:${{ steps.extract_branch.outputs.branch }}-OC + cosign sign -y --key cosign.key \ + -a "repo=${{ github.repository }}" \ + -a "workflow=${{ github.workflow }}" \ + -a "ref=${{ github.sha }}" \ + docker.io/${{ env.DOCKER_HUB_ORGANIZATION }}/${{ env.DOCKER_HUB_REPOSITORY }}:${{ steps.extract_branch.outputs.branch }} + cosign sign -y --key cosign.key \ + -a "repo=${{ github.repository }}" \ + -a "workflow=${{ github.workflow }}" \ + -a "ref=${{ github.sha }}-nginx" \ + docker.io/${{ env.DOCKER_HUB_ORGANIZATION }}/${{ env.DOCKER_HUB_REPOSITORY_NGINX }}:${{ steps.extract_branch.outputs.branch }} + + + diff --git a/.github/workflows/run_trivy.yml b/.github/workflows/run_trivy.yml index d9a0a70c..f6109fc1 100644 --- a/.github/workflows/run_trivy.yml +++ b/.github/workflows/run_trivy.yml @@ -2,9 +2,8 @@ name: scan container image on: workflow_run: - workflows: [build and publish container] - types: - - completed + workflows: [build and publish container develop branch, build and publish container non develop branches] + types: [completed] env: ## Sets environment variable DOCKER_HUB_ORGANIZATION: ${{ vars.DOCKER_HUB_ORGANIZATION }} @@ -40,7 +39,6 @@ jobs: format: 'template' template: '@/contrib/sarif.tpl' output: 'trivy-results.sarif' - security-checks: 'vuln' severity: 'CRITICAL,HIGH' timeout: '30m' cache-dir: .trivy diff --git a/apimanager/accountlist/apps.py b/apimanager/accountlist/apps.py index 50a7695e..640746f0 100644 --- a/apimanager/accountlist/apps.py +++ b/apimanager/accountlist/apps.py @@ -2,4 +2,4 @@ class AccountConfig(AppConfig): - name = 'account-list' + name = 'accountlist' diff --git a/apimanager/accountlist/urls.py b/apimanager/accountlist/urls.py index 66d4b9ab..b4769c80 100644 --- a/apimanager/accountlist/urls.py +++ b/apimanager/accountlist/urls.py @@ -3,14 +3,14 @@ URLs for Account list app """ -from django.conf.urls import url +from django.urls import re_path from .views import AccountListView, ExportCsvView urlpatterns = [ - url(r'^$', + re_path(r'^$', AccountListView.as_view(), name='account-list'), - url(r'^export_csv$', + re_path(r'^export_csv$', ExportCsvView.as_view(), name='export-csv-account') ] diff --git a/apimanager/accounts/forms.py b/apimanager/accounts/forms.py index 1cf7abe7..3f7a1dcb 100644 --- a/apimanager/accounts/forms.py +++ b/apimanager/accounts/forms.py @@ -3,7 +3,7 @@ """ from django import forms -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ import random diff --git a/apimanager/accounts/urls.py b/apimanager/accounts/urls.py index 1b499473..a56ac755 100644 --- a/apimanager/accounts/urls.py +++ b/apimanager/accounts/urls.py @@ -3,11 +3,11 @@ URLs for Account app """ -from django.conf.urls import url +from django.urls import re_path from .views import IndexAccountsView urlpatterns = [ - url(r'^create', + re_path(r'^create', IndexAccountsView.as_view(), name='accounts-create'), diff --git a/apimanager/accounts/views.py b/apimanager/accounts/views.py index b79ebcc5..44055dce 100644 --- a/apimanager/accounts/views.py +++ b/apimanager/accounts/views.py @@ -13,7 +13,7 @@ from django.views.generic import FormView from obp.api import API, APIError from .forms import CreateAccountForm -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ class IndexAccountsView(LoginRequiredMixin, FormView): diff --git a/apimanager/apicollectionlist/apps.py b/apimanager/apicollectionlist/apps.py index 3ebc4d0e..3e2972d4 100644 --- a/apimanager/apicollectionlist/apps.py +++ b/apimanager/apicollectionlist/apps.py @@ -1,5 +1,5 @@ from django.apps import AppConfig -class CustomersConfig(AppConfig): - name = 'customers_list' +class ApiCollectionListConfig(AppConfig): + name = 'apicollectionlist' diff --git a/apimanager/apicollectionlist/urls.py b/apimanager/apicollectionlist/urls.py index 2b0e83c6..e7943faf 100644 --- a/apimanager/apicollectionlist/urls.py +++ b/apimanager/apicollectionlist/urls.py @@ -3,14 +3,14 @@ URLs for Api Collection list app """ -from django.conf.urls import url +from django.urls import re_path from .views import ApiCollectionListView, ExportCsvView urlpatterns = [ - url(r'^$', + re_path(r'^$', ApiCollectionListView.as_view(), name='apicollection-list'), - url(r'^export_csv$', + re_path(r'^export_csv$', ExportCsvView.as_view(), name='export-csv-apicollection') ] diff --git a/apimanager/apicollections/urls.py b/apimanager/apicollections/urls.py index b3b68517..12c595b5 100644 --- a/apimanager/apicollections/urls.py +++ b/apimanager/apicollections/urls.py @@ -3,28 +3,25 @@ URLs for config app """ -from django.conf.urls import url +from django.urls import re_path from apicollections.views import IndexView, apicollections_save, \ apicollections_delete, DetailView, DeleteCollectionEndpointView, apicollections_update urlpatterns = [ - url(r'^$', + re_path(r'^$', IndexView.as_view(), name='apicollections-index'), - url(r'save/apicollection', apicollections_save, + re_path(r'save/apicollection', apicollections_save, name='apicollection-save'), - url(r'update/apicollection', apicollections_update, + re_path(r'update/apicollection', apicollections_update, name='apicollection-update'), - url(r'delete/apicollection', apicollections_delete, + re_path(r'delete/apicollection', apicollections_delete, name='apicollection-delete'), - url(r'^my-api-collection-ids/(?P[\w\@\.\+-]+)$', + re_path(r'^my-api-collection-ids/(?P[\w\@\.\+-]+)$', DetailView.as_view(), name='my-api-collection-detail'), - url(r'^delete/api-collections/(?P[\w-]+)/api-collection-endpoint/(?P[\w\@\.\+-]+)$', + re_path(r'^delete/api-collections/(?P[\w-]+)/api-collection-endpoint/(?P[\w\@\.\+-]+)$', DeleteCollectionEndpointView.as_view(), name='delete-api-collection-endpoint'), - # url(r'^add/api-collections/(?P[\w-]+)/api-collection-endpoints/(?P[\w\@\.\+-]+)$', - # AddCollectionEndpointView.as_view(), - # name='add-api-collection-endpoint'), ] diff --git a/apimanager/apimanager/settings.py b/apimanager/apimanager/settings.py index 4b735c8e..e60f02ca 100644 --- a/apimanager/apimanager/settings.py +++ b/apimanager/apimanager/settings.py @@ -44,7 +44,7 @@ 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', - 'bootstrap3', + 'bootstrap', 'bootstrap_datepicker_plus', 'mathfilters', 'base', diff --git a/apimanager/apimanager/urls.py b/apimanager/apimanager/urls.py index 4dfef6cf..f3f1fe08 100644 --- a/apimanager/apimanager/urls.py +++ b/apimanager/apimanager/urls.py @@ -3,7 +3,7 @@ URLs for apimanager """ -from django.conf.urls import url, include +from django.urls import re_path, include from django.conf.urls.i18n import i18n_patterns from base.views import HomeView @@ -16,46 +16,46 @@ urlpatterns = [ #These pages URLs have no GUI - url(r'^oauth/initiate$', + re_path(r'^oauth/initiate$', OAuthInitiateView.as_view(), name='oauth-initiate'), - url(r'^oauth/authorize$', + re_path(r'^oauth/authorize$', OAuthAuthorizeView.as_view(), name='oauth-authorize'), - url(r'^directlogin$', + re_path(r'^directlogin$', DirectLoginView.as_view(), name='directlogin'), - url(r'^gatewaylogin$', + re_path(r'^gatewaylogin$', GatewayLoginView.as_view(), name='gatewaylogin'), # Defining authentication URLs here and not including oauth.urls for # backward compatibility ] urlpatterns += i18n_patterns( #urlpatterns = ( - url(r'^$', HomeView.as_view(), name="home"), - url(r'^single-sign-on', + re_path(r'^$', HomeView.as_view(), name="home"), + re_path(r'^single-sign-on', OAuthInitiateView.as_view(), name='single-sign-on'), - url(r'^logout$', LogoutView.as_view(), name='oauth-logout'), - url(r'^systemviews/', include('systemviews.urls')), - url(r'^accounts/', include('accounts.urls')), - url(r'^account/list', include('accountlist.urls')), - url(r'^consumers/', include('consumers.urls')), - url(r'^entitlementrequests/', include('entitlementrequests.urls')), - url(r'^users/', include('users.urls')), - url(r'^branches/', include('branches.urls')), - url(r'^atms/', include('atms.urls')), - url(r'^atms/list', include('atmlist.urls')), - url(r'^banks/', include('banks.urls')), - url(r'^banks/list', include('banklist.urls')), - url(r'^products/', include('products.urls')), - url(r'^products/list', include('productlist.urls')), - url(r'^customers/', include('customers.urls')), - url(r'^customer/list', include('customerlist.urls')), - url(r'^metrics/', include('metrics.urls')), - url(r'^config/', include('config.urls')), - url(r'^webui/', include('webui.urls')), - url(r'^methodrouting/', include('methodrouting.urls')), - url(r'^connectormethod/', include('connectormethod.urls')), - url(r'^dynamicendpoints/', include('dynamicendpoints.urls')), - url(r'^apicollections/', include('apicollections.urls')), - url(r'^apicollections-list', include('apicollectionlist.urls')), + re_path(r'^logout$', LogoutView.as_view(), name='oauth-logout'), + re_path(r'^systemviews/', include('systemviews.urls')), + re_path(r'^accounts/', include('accounts.urls')), + re_path(r'^account/list', include('accountlist.urls')), + re_path(r'^consumers/', include('consumers.urls')), + re_path(r'^entitlementrequests/', include('entitlementrequests.urls')), + re_path(r'^users/', include('users.urls')), + re_path(r'^branches/', include('branches.urls')), + re_path(r'^atms/', include('atms.urls')), + re_path(r'^atms/list', include('atmlist.urls')), + re_path(r'^banks/', include('banks.urls')), + re_path(r'^banks/list', include('banklist.urls')), + re_path(r'^products/', include('products.urls')), + re_path(r'^products/list', include('productlist.urls')), + re_path(r'^customers/', include('customers.urls')), + re_path(r'^customer/list', include('customerlist.urls')), + re_path(r'^metrics/', include('metrics.urls')), + re_path(r'^config/', include('config.urls')), + re_path(r'^webui/', include('webui.urls')), + re_path(r'^methodrouting/', include('methodrouting.urls')), + re_path(r'^connectormethod/', include('connectormethod.urls')), + re_path(r'^dynamicendpoints/', include('dynamicendpoints.urls')), + re_path(r'^apicollections/', include('apicollections.urls')), + re_path(r'^apicollections-list', include('apicollectionlist.urls')), ) #prefix_default_language=False, #)+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) \ No newline at end of file diff --git a/apimanager/atmlist/apps.py b/apimanager/atmlist/apps.py index 5a0728f6..0bd3ca56 100644 --- a/apimanager/atmlist/apps.py +++ b/apimanager/atmlist/apps.py @@ -2,4 +2,4 @@ class AtmsConfig(AppConfig): - name = 'atms_list' + name = 'atmlist' diff --git a/apimanager/atmlist/urls.py b/apimanager/atmlist/urls.py index b41d66d6..ed943820 100644 --- a/apimanager/atmlist/urls.py +++ b/apimanager/atmlist/urls.py @@ -3,14 +3,14 @@ URLs for ATM list app """ -from django.conf.urls import url +from django.urls import re_path from .views import AtmListView, ExportCsvView urlpatterns = [ - url(r'^$', + re_path(r'^$', AtmListView.as_view(), name='atm-list'), - url(r'^export_csv$', + re_path(r'^export_csv$', ExportCsvView.as_view(), name='export-csv') ] diff --git a/apimanager/atms/forms.py b/apimanager/atms/forms.py index 4750332a..16b8620b 100644 --- a/apimanager/atms/forms.py +++ b/apimanager/atms/forms.py @@ -3,7 +3,7 @@ """ from django import forms -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ import random diff --git a/apimanager/atms/urls.py b/apimanager/atms/urls.py index f67b2d7e..95e16ed9 100644 --- a/apimanager/atms/urls.py +++ b/apimanager/atms/urls.py @@ -3,20 +3,20 @@ URLs for metrics app """ -from django.conf.urls import url +from django.urls import re_path from atms.views import IndexAtmsView, UpdateAtmsView, atm_attribute_save, atm_attribute_delete, atm_attribute_update urlpatterns = [ - url(r'^create', + re_path(r'^create', IndexAtmsView.as_view(), name='atms_create'), - url(r'^update/(?P[ 0-9\w|\W\@\.\+-]+)/bank/(?P[0-9\w\@\.\+-]+)/$', + re_path(r'^update/(?P[ 0-9\w|\W\@\.\+-]+)/bank/(?P[0-9\w\@\.\+-]+)/$', UpdateAtmsView.as_view(), name='atms_update'), - url(r'save/attribute', atm_attribute_save, + re_path(r'save/attribute', atm_attribute_save, name='atm_attribute_save'), - url(r'delete/attribute', atm_attribute_delete, + re_path(r'delete/attribute', atm_attribute_delete, name='atm_attribute_delete'), - url(r'updateattribute/attribute', atm_attribute_update, + re_path(r'updateattribute/attribute', atm_attribute_update, name='atm_attribute_update'), ] diff --git a/apimanager/atms/views.py b/apimanager/atms/views.py index 8e2f0e56..18c4f8e7 100644 --- a/apimanager/atms/views.py +++ b/apimanager/atms/views.py @@ -13,7 +13,7 @@ from django.views.generic import FormView from obp.api import API, APIError from .forms import CreateAtmForm -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from django.views.decorators.csrf import csrf_exempt from django.urls import reverse, reverse_lazy from base.utils import exception_handle, error_once_only diff --git a/apimanager/banklist/apps.py b/apimanager/banklist/apps.py index 26b574f7..e7848c60 100644 --- a/apimanager/banklist/apps.py +++ b/apimanager/banklist/apps.py @@ -2,4 +2,4 @@ class BanksConfig(AppConfig): - name = 'banks_list' + name = 'banklist' diff --git a/apimanager/banklist/urls.py b/apimanager/banklist/urls.py index 2bafd124..8c6dcd46 100644 --- a/apimanager/banklist/urls.py +++ b/apimanager/banklist/urls.py @@ -3,11 +3,11 @@ URLs for Bank list app """ -from django.conf.urls import url +from django.urls import re_path from .views import BankListView #, ExportCsvView urlpatterns = [ - url(r'^$', + re_path(r'^$', BankListView.as_view(), name='bank-list'), diff --git a/apimanager/banks/forms.py b/apimanager/banks/forms.py index 327c853d..42d2ad06 100644 --- a/apimanager/banks/forms.py +++ b/apimanager/banks/forms.py @@ -3,7 +3,7 @@ """ from django import forms -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ import random diff --git a/apimanager/banks/urls.py b/apimanager/banks/urls.py index 12c72504..11b5a8ec 100644 --- a/apimanager/banks/urls.py +++ b/apimanager/banks/urls.py @@ -3,20 +3,20 @@ URLs for Bank app """ -from django.conf.urls import url +from django.urls import re_path from banks.views import IndexBanksView, UpdateBanksView, bank_attribute_save, bank_attribute_update, bank_attribute_delete urlpatterns = [ - url(r'^create', + re_path(r'^create', IndexBanksView.as_view(), name='banks_create'), - url(r'^update/bank/(?P[0-9\w\@\.\+-]+)/$', + re_path(r'^update/bank/(?P[0-9\w\@\.\+-]+)/$', UpdateBanksView.as_view(), name='banks_update'), - url(r'save/attribute', bank_attribute_save, + re_path(r'save/attribute', bank_attribute_save, name='bank_attribute_save'), - url(r'updateattribute/attribute', bank_attribute_update, + re_path(r'updateattribute/attribute', bank_attribute_update, name='bank_attribute_update'), - url(r'delete/attribute', bank_attribute_delete, + re_path(r'delete/attribute', bank_attribute_delete, name='bank_attribute_delete'), ] \ No newline at end of file diff --git a/apimanager/banks/views.py b/apimanager/banks/views.py index e8f98381..04095c7c 100644 --- a/apimanager/banks/views.py +++ b/apimanager/banks/views.py @@ -13,7 +13,7 @@ from django.views.generic import FormView from obp.api import API, APIError from .forms import CreateBankForm -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from apimanager.settings import DEBUG from django.views.decorators.csrf import csrf_exempt from base.utils import exception_handle, error_once_only diff --git a/apimanager/base/templates/base.html b/apimanager/base/templates/base.html index c5d7602a..bc771bcd 100644 --- a/apimanager/base/templates/base.html +++ b/apimanager/base/templates/base.html @@ -43,9 +43,9 @@ {% url "api-metrics" as api_metrics_url %} {% url "connector-metrics" as connector_metrics_url %} {% url "weekly-summary" as metrics_summary_url %} @@ -123,7 +123,7 @@ {% if messages %}
{% for message in messages %} -