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

Upgrade django from 3.x to 4.1.x #229

Merged
merged 2 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions deploy/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ services:
resources:
limits:
cpus: '0.3'
memory: 128M
memory: 192M

crapi-workshop:
container_name: crapi-workshop
Expand Down Expand Up @@ -194,8 +194,8 @@ services:
deploy:
resources:
limits:
cpus: '0.3'
memory: 128M
cpus: '0.5'
memory: 256M

mongodb:
container_name: mongodb
Expand Down
4 changes: 2 additions & 2 deletions services/workshop/crapi/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Migration(migrations.Migration):
('jwt_token', models.CharField(max_length=500, null=True, unique=True)),
('number', models.CharField(max_length=255, null=True)),
('password', models.CharField(max_length=255)),
('role', models.IntegerField(choices=[(2, 1), (0, 0)], default=0)),
('role', models.IntegerField(choices=[(1, 'User'), (2, 'Mechanic'), (3, 'Admin')], default=1)),
],
options={
'db_table': 'user_login',
Expand Down Expand Up @@ -165,7 +165,7 @@ class Migration(migrations.Migration):
migrations.CreateModel(
name='Coupon',
fields=[
('coupon_code', models.CharField(primary_key=True, max_length=255)),
('coupon_code', models.CharField(max_length=255, primary_key=True, serialize=False)),
('amount', models.CharField(max_length=255)),
],
options={
Expand Down
4 changes: 2 additions & 2 deletions services/workshop/crapi/user/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from django.test import TestCase, Client
from django.utils import timezone
from utils import messages
from crapi.user.views import DEFAULT_LIMIT
from crapi_site import settings
from crapi.user.models import User, UserDetails

logger = logging.getLogger('UserTest')
Expand Down Expand Up @@ -105,7 +105,7 @@ def test_get_api_management_users_all(self):
response = self.client.get('/workshop/api/management/users/all', **self.auth_headers)
self.assertEqual(response.status_code, 200)
response_data = json.loads(response.content)
self.assertEqual(len(response_data['users']), DEFAULT_LIMIT)
self.assertEqual(len(response_data['users']), settings.DEFAULT_LIMIT)
response = self.client.get('/workshop/api/management/users/all?limit=10&offset=0', **self.auth_headers)
self.assertEqual(response.status_code, 200)
response_data = json.loads(response.content)
Expand Down
2 changes: 1 addition & 1 deletion services/workshop/crapi_site/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def get_env_value(env_variable):
'NAME': 'test_crapi',
'USER': get_env_value('DB_USER'),
},
'CONN_MAX_AGE': 60,
'CONN_MAX_AGE': 0,
},
'mongodb': {
'ENGINE': 'djongo',
Expand Down
11 changes: 6 additions & 5 deletions services/workshop/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
bcrypt==3.1.7
Django~=3.2.19
bcrypt==4.1.2
Django~=4.1.13
cryptography==40.0.2
django-cors-headers==4.0.0
django-db-cascade-2==0.3.5
django-environ==0.10.0
django-extended-choices==1.3.3
django-extensions==3.2.1
django-extensions==3.2.3
django-health-check==3.17.0
djangorestframework==3.14.0
django-sslserver==0.22
djongo==1.3.6
djongo==1.3.6 #max version for django 4.1.13
sqlparse==0.2.4 #djongo-dependency
psycopg2==2.9.9
PyJWT==2.7.0
pymongo==3.12.3
pymongo==3.13.0
pyOpenSSL==23.1.1
requests==2.30.0
Werkzeug==2.0.3
Expand Down
Loading