Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Django update to 5.0 #195

Merged
merged 8 commits into from
Jul 3, 2024
3 changes: 3 additions & 0 deletions envs/env
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ MEDCAT_CONFIG_FILE=/home/configs/base.txt
### Deployment Realm ###
ENV=non-prod

# Complete once this is deployed
CSRF_TRUSTED_ORIGINS=

### Django debug setting - to live-reload etc. ###
DEBUG=True

Expand Down
20 changes: 20 additions & 0 deletions webapp/api/api/migrations/0078_alter_project_polymorphic_ctype.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generated by Django 5.0.6 on 2024-06-07 11:18

import django.db.models.deletion
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('api', '0077_projectgroup_create_associated_projects'),
('contenttypes', '0002_remove_content_type_name'),
]

operations = [
migrations.AlterField(
model_name='project',
name='polymorphic_ctype',
field=models.ForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='polymorphic_%(app_label)s.%(class)s_set+', to='contenttypes.contenttype'),
),
]
14 changes: 14 additions & 0 deletions webapp/api/api/migrations/0079_merge_20240701_2259.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Generated by Django 2.2.28 on 2024-07-01 22:59

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('api', '0078_metacatmodel_modelpack'),
('api', '0078_alter_project_polymorphic_ctype'),
]

operations = [
]
8 changes: 6 additions & 2 deletions webapp/api/core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,16 @@

log = logging.getLogger(__name__)

DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

environ_origins = os.environ.get('CSRF_TRUSTED_ORIGINS', None)
trusted_origins = [] if environ_origins is None else environ_origins.split(',')
CSRF_TRUSTED_ORIGINS = ['https://127.0.0.1:8001', 'http://localhost:8001'] + trusted_origins

# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/
SECURE_CROSS_ORIGIN_OPENER_POLICY = None

# SECURITY WARNING: keep the secret key used in production secret!
realm = os.environ.get('ENV', 'non-prod')
Expand Down
15 changes: 0 additions & 15 deletions webapp/api/core/urls.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
"""MedCATtrainer URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.contrib.auth import views as pw_views
from django.urls import path, include, re_path
Expand Down
6 changes: 3 additions & 3 deletions webapp/frontend/src/components/common/ProjectList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,9 @@ export default {
components: {LoadingOverlay, Modal},
props: {
projectItems: Array,
isAdmin: Boolean
isAdmin: Boolean,
cdbSearchIndexStatus: Object,
cdbLoaded: Object,
},
data () {
return {
Expand Down Expand Up @@ -213,8 +215,6 @@ export default {
modelCacheLoadError: false,
metricsJobId: null,
saving: false,
cdbSearchIndexStatus: {},
cdbLoaded: {},
clearModelModal: false,
selectedProjects: [],
loadingProjects: false
Expand Down
8 changes: 6 additions & 2 deletions webapp/frontend/src/views/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@
<p>{{selectedProjectGroup.description}}</p>
</div>
<div slot="body">
<project-list :project-items="selectedProjectGroup.items" :is-admin="isAdmin"></project-list>
<project-list :project-items="selectedProjectGroup.items" :is-admin="isAdmin"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix that should have been in PR #190

:cdb-search-index-status="cdbSearchIndexStatus" :cdb-loaded="cdbLoaded"></project-list>
</div>
</modal>
</div>
<project-list v-if="!projectGroupView" :project-items="projects.items" :is-admin="isAdmin"></project-list>
<project-list v-if="!projectGroupView" :project-items="projects.items" :is-admin="isAdmin"
:cdb-search-index-status="cdbSearchIndexStatus" :cdb-loaded="cdbLoaded"></project-list>
</div>

</template>
Expand Down Expand Up @@ -69,6 +71,8 @@ export default {
loadingProjects: false,
isAdmin: false,
selectedProjectGroup: null,
cdbSearchIndexStatus: {},
cdbLoaded: {},
}
},
created () {
Expand Down
12 changes: 6 additions & 6 deletions webapp/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
--extra-index-url https://download.pytorch.org/whl/cpu/
uwsgi~=2.0
Django~=2.2
django-filter~=2.4
Django~=5.0
django-filter~=24.2
django-polymorphic~=3.0
djangorestframework~=3.10
django-background-tasks~=1.2
openpyxl~=3.0
medcat~=1.12
djangorestframework~=3.15
django-background-tasks-updated~=1.2
openpyxl~=3.1
medcat~=1.12