Skip to content

Commit

Permalink
Merge pull request #40 from OpenLXP/django-upgrade
Browse files Browse the repository at this point in the history
Django/djangorestframework upgrade
  • Loading branch information
sammy-sandhu authored Jul 31, 2024
2 parents b3d15bc + bdc5d4e commit f2687e3
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 40 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/cd-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- dev
pull_request:
branches:
- main
- dev
types: [opened, synchronize, reopened]

jobs:
Expand Down Expand Up @@ -48,18 +48,18 @@ jobs:
echo "Running coverage unit test"
docker-compose --env-file ./.env run app sh -c "python manage.py waitdb && coverage run manage.py test --tag=unit && flake8 && coverage report && coverage report --fail-under=80"
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# sonarcloud:
# name: SonarCloud
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# with:
# fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
# - name: SonarCloud Scan
# uses: SonarSource/sonarcloud-github-action@master
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

build:
# require dependency from step above
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Dockerfile

FROM python:3.7-buster
FROM python:3.9-buster

# install nginx
RUN apt-get update && apt-get install nginx vim libxml2-dev libxmlsec1-dev clamav-daemon clamav-freshclam clamav-unofficial-sigs -y --no-install-recommends
Expand Down
3 changes: 3 additions & 0 deletions app/openlxp_xss_project/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@
],
}

CSRF_COOKIE_DOMAIN = '.deloitteopenlxp.com'
CSRF_TRUSTED_ORIGINS = ['https://dev-ldss.deloitteopenlxp.com', ]

AUTHENTICATION_BACKENDS = (
'django.contrib.auth.backends.ModelBackend',
'openlxp_authentication.models.SAMLDBAuth',
Expand Down
13 changes: 6 additions & 7 deletions app/openlxp_xss_project/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.conf import settings
from django.conf.urls import url
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import include, path
from django.urls import include, re_path

urlpatterns = [
path('admin/doc/', include('django.contrib.admindocs.urls')),
url('', include('openlxp_authentication.urls')),
path('admin/', admin.site.urls),
path('api/', include('api.urls')),
path('api/auth/', include('users.urls')),
re_path('admin/doc/', include('django.contrib.admindocs.urls')),
# url('', include('openlxp_authentication.urls')),
re_path('admin/', admin.site.urls),
re_path('api/', include('api.urls')),
re_path('api/auth/', include('users.urls')),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
38 changes: 19 additions & 19 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
bleach~=6.0.0

mysql-connector-python >= 8.0.28, <=8.0.29

clamd==1.0.2

django-mysql>=3.10.0,<3.11.0
coverage>=5.5,<6.0

Django>=3.2,<4.0
ddt>=1.4.2,<1.5.0

djangorestframework>=3.12.2,<3.13.0
django-admin-interface>=0.28.3

docutils>=0.20.1
django-colorfield>=0.11.0

flake8>=3.9.0,<4.0.1
django-cors-headers>=3.7.0,<3.8.0

gunicorn>=20.0.4,<20.1.0
django-model-utils>=4.1.1,<4.2.0

coverage>=5.5,<6.0
django-mysql>=4.4.0,<5.0.0

django-cors-headers>=3.7.0,<3.8.0
Django>=4.2,<5.0

ddt>=1.4.2,<1.5.0
djangorestframework>=3.15.2,<3.16.0

django-model-utils>=4.1.1,<4.2.0
docutils>=0.20.1

isort>=5.11.0, <5.12.0
flake8>=3.9.0,<4.0.1

openlxp-authentication >=1.1.0, <1.2
gunicorn>=22.0.0,<22.1.0

python-magic >=0.4.27, <0.5
isort>=5.11.0, <5.12.0

requests>=2.25.1,<2.26.0
mysql-connector-python >= 8.0.28, <=8.0.29

django-admin-interface>=0.28.3
openlxp-authentication >=1.1.2, <1.2

django-colorfield>=0.11.0
python-magic >=0.4.27, <0.5

python-slugify>=8.0.1

text-unidecode>=1.3
requests~=2.32.2

text-unidecode>=1.3

0 comments on commit f2687e3

Please sign in to comment.