Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Inertia Link not redirecting on click (this.resolveComponent is not a function)
I'm trying to get Django, Inertia and Vue running. I followed this doc (including the referred ones inside that): https://pypi.org/project/inertia-django/ While it works basically (the Vue pages/components render, pages load), I can't use the <Link> component. It renders and shows the correct destination on hovering, but when you click on it, the console shows Uncaught (in promise) TypeError: this.resolveComponent is not a function and it's not redirecting. Although it's changing the page, I can see the corresponding get request in the django server console. The router.visit() function works fine. main.html {% load django_vite %} <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> {% vite_hmr_client %} {% vite_asset 'js/main.js' %} <title>Django-mysite</title> <script src="https://cdn.tailwindcss.com"></script> </head> <body> {% block inertia %}{% endblock %} </body> </html> main.js import 'vite/modulepreload-polyfill' import {createApp, h} from 'vue'; import {createInertiaApp } from '@inertiajs/vue3'; const pages = import.meta.glob('./pages/**/*.vue'); createInertiaApp({ resolve: async name => { return (await pages[`./pages/${name}.vue`]()).default }, setup({el, App, props, plugin}) { const app = createApp({render: () => h(App, props)}) app.use(plugin) app.mount(el) }, }) vite.config.js const { resolve } = require('path'); import vue from '@vitejs/plugin-vue'; module.exports = { plugins: [vue()], root: resolve('./static/src'), base: '/static/', server: { host: 'localhost', port: 3000, open: false, … -
Django: Internal error popped in the first page of list view but normal in other pages
My project has an Order model and a corresponding ListView integrated with a Paginator. I run the code successfully in local development. There is no problem rendering the first and other pages of orders. Also, even after I deployed my project on Heroku, it rendered perfectly. However, the ListView now popped out internal error when I was viewing the first page but no problem at all in case of other pages (e.g page 2, 3 etc). Having checked all the codes in the template, view and model, I still couldn't find the problem. Any insights on this please? What other part am I missing? Thank you. -
Django duplicate column name after dropping and re-creating table
I'm new to Django and am working on my first project. I have multiple tables in the project (I'm using the default sqlite3). One of the tables 'C' is empty. All of the other tables have already been populated with data. Among them table 'M' has a foreign key that is linking it to C's id field (c_id). At some point I changed the max_length of C's id field (c_id) from 5 to 4. I run migrations after that and got an error: django.db.utils.IntegrityError: The row in table 'myapp_M' with primary key '00001' has an invalid foreign key: myapp_M.c_id contains a value '' that does not have a corresponding value in myapp_C.c_id. the field 'c' in 'M' table that is a foreign key has blank=True. I tried adding null=True and running migrations again but it did not help. I decided that maybe dropping the C table, since it's still empty, and creating it again might solve the problem. I have dropped it manually using SQL DROP TABLE, and then used this tutorial to re-create it: https://techstream.org/Bits/Recover-dropped-table-in-Django When I'm running the migrations I am getting the error: django.db.utils.OperationalError: duplicate column name: c_id (which is the first column defined in my model) … -
How to have vscode syntax highlight for django template tag in js
Is there a way to have a proper django syntax highlight in vscode when using django template tag in a tag in templates ? -
How to run a bokeh server app without 'bokeh server --show' command in Django project?
I have a Django project in which I need to add graphs with python callbacks implemented in Bokeh. How to run a bokeh server app from django view without 'bokeh server --show my_app.py' command? I found realization with commandline, but I don't know how i should retun it as HTTPResponse from the Django view. -
Test email does not arrive in mail.outbox when sent by Django-RQ worker
I've set up a test within Django that sends an email, in the background, using Django-RQ. I call the code that enqueues the send_email task, then, I get the django-rq worker, and call .work(), with burst=True. In my console, I can see the django-rq worker picking up the job, and confirming that it's been processed successfully. However, the email never arrives in Django's test mail.outbox. Here is the test code: def test_reset_password(self): c = Client() page = reverse_lazy("accounts:password_reset") response = c.post(page, {'email': 'joe@test.co.uk'}) self.assertRedirects(response, reverse_lazy("accounts:login"), 302, 200) django_rq.get_worker(settings.RQ_QUEUE).work(burst=True) self.assertEqual(len(mail.outbox), 1) self.assertEqual(mail.outbox[0].subject, 'Password reset instructions') And here's the output from the console when the test is run: Found 2 test(s). Creating test database for alias 'default'... System check identified no issues (0 silenced). .Worker rq:worker:0e599ef7e7e34e30a1b753678777b831: started, version 1.12.0 Subscribing to channel rq:pubsub:0e599ef7e7e34e30a1b753678777b831 *** Listening on default... Cleaning registries for queue: default default: send() (214c3a65-c642-49f2-a832-cb40750fad2a) default: Job OK (214c3a65-c642-49f2-a832-cb40750fad2a) Result is kept for 500 seconds Worker rq:worker:0e599ef7e7e34e30a1b753678777b831: done, quitting Unsubscribing from channel rq:pubsub:0e599ef7e7e34e30a1b753678777b831 F ====================================================================== FAIL: test_reset_password (accounts.tests.AccountsTest.test_reset_password) ---------------------------------------------------------------------- Traceback (most recent call last): File "/workspace/accounts/tests.py", line 30, in test_reset_password self.assertEqual(len(mail.outbox), 1) AssertionError: 0 != 1 ---------------------------------------------------------------------- Ran 2 tests in 1.686s FAILED (failures=1) Is it possible the email is going to … -
Django Channels Data Compression
Is there a way to compress stream data sent via Django-Channels consumer? Couldnt find any information in Documentation. Is it not recommended to compress stream data? -
How to create models in django for index and data that already exists in elasticsearch. And also paginate the data fetched
My data is stored in elasticsearch database.I want to fetch this data using django ,paginate and display in the front end I have tried search function of elasticsearch dsl and django paginator.But on click of next page querying the whole set again makes it inefficient.Hence want to convert similar to django queryset. There will be no write operation to Elastic search -
How to call an api in django signals
Can someone share a code about how to call an api in django signals.Here is some code that i have done: @receiver(pre_delete, sender=Product) def pre_delete_profile(sender, **kwargs): print("You are about to delete something!") -
combine serializer choicefield and serializermethodfield
I have class Person with qualification field. class QUALIFICATION_CHIOCES = [('mt', 'Matriculation'), ('pr', 'pre_university'), ('gd', 'graduate'), ('pg', 'post_graduate'), ('ot', 'other')] class Person(models.Model): name = models.CharField(max_length=255) qualification = models.CharField(choices=QUALIFICATION_CHIOCES, max_length=2) serializer class PersonSerializer(serializers.ModelSerializer): qualification = serializers.SerializerMethodField('get_qual') class Meta: model = Person def get_qual(self, obj): return obj.qual Now i want to want add below line in the above code not able to figure it out as i am using custom field name qual which doesn't exist. qualification = serializers.ChoiceField(choices=QUALIFICATION_CHIOCES) if i simply add the above line i get the error like the field is required. now how can i accept the input with custom_variable meanwhile check with the choices. -
Django shipping method
I have a question about shipping in django. I would like to automate shipping so that automatically when the courier delivers the package the status in the database changes to delivered, etc.... Someone could direct me to some reading on how to do this. Or is it a good standard to just make the shipments in django-oscar and give an admin-panel that will quite transparently change them non-automatically? Or is it standard to capture emails and pull the data you need from them and based on that make a django-celery-task that will do that? -
Django+ DRF + Celery: Schedule the same task for different objects in database in different time for each object
I am working on an HR application, where a company has a branch and each branch has its working days policy in which the branch decides the hours of start and end of work day and the hour when the day is absence for employee if they didn't checked in and the weekend days, class WorkingDaysPolicy(TimeStampedModel): WeekendDays = ( (5, "Saturday"), (6, "Sunday"), (0, "Monday"), (1, "Tuesday"), (2, "Wednesday"), (3, "Thursday"), (4, "Friday"), ) id = models.UUIDField(primary_key=True, editable=False, default=uuid.uuid4) branch = models.ForeignKey( Branch, on_delete=models.CASCADE, blank=True, null=True, related_name="branch_working_days", ) number_of_daily_working_hrs = models.PositiveSmallIntegerField( _("Number of daily working hours") ) weekend_days = MultiSelectField( _("Weekend days"), choices=WeekendDays, null=True, blank=True ) normal_overtime_hourly_rate = models.FloatField( _("normal overtime hourly rate"), null=True, blank=True ) day_starts_at = models.TimeField(_("Working day starts at"), blank=True, null=True) day_ends_at = models.TimeField(_("Working day ends at"), blank=True, null=True) absence_Starts_at = models.TimeField(_("Absence Starts at"), blank=True, null=True) now I have a background task that must work exactly at the absence_Starts_at time and only on the working days. I tried to import the WorkingDaysPolicy model on celery.py to loop over its objects and assign a task for each branch but the app crashed on starting the dev server and raised raise AppRegistryNotReady("Apps aren't loaded yet.") How can I run … -
Gunicorn can't start wsgi for my django application
everyone! I want to deploy my Django app on ubuntu 20 The scheme, as I understand it, is like this: Nginx -> Gunicorn -> WSGI -> Django pip list Package Version \------------------ ------- asgiref 3.6.0 backports.zoneinfo 0.2.1 bcrypt 4.0.1 cffi 1.15.1 cryptography 39.0.1 Django 4.1.7 future 0.18.3 gunicorn 20.1.0 paramiko 3.0.0 pip 20.0.2 pkg-resources 0.0.0 psycopg2-binary 2.9.5 pycparser 2.21 PyNaCl 1.5.0 setuptools 44.0.0 six 1.16.0 sqlparse 0.4.3 textfsm 1.1.3 wheel 0.38.4 I have installed the necessary packages for Nginx, Gunicorn and my project is located at: /opt/Iron Here is the Gunicorn setup file: sudo nano /etc/systemd/system/gunicorn.service \[Unit\] Description=gunicorn daemon After=network.target \[Service\] User=n.fomichev Group=www-data WorkingDirectory=/opt/Iron ExecStart=/opt/Iron/venv/bin/gunicorn --workers 3 --bind unix:/opt/Iron/Iron.sock Iron.wsgi:application \[Install\] WantedBy=multi-user.target Next I run Gunicorn under a virtual environment: systemctl daemon-reload systemctl start gunicorn systemctl enable gunicorn And I look at the status of the service: (venv) root@iron:/opt/Iron# sudo systemctl status gunicorn * gunicorn.service - gunicorn daemon Loaded: loaded (/etc/systemd/system/gunicorn.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Mon 2023-02-20 11:21:48 UTC; 26s ago Main PID: 20257 (code=exited, status=3) Feb 20 11:21:48 iron gunicorn[20260]: File "<frozen importlib._bootstrap>", line 1014, in _gcd_import Feb 20 11:21:48 iron gunicorn[20260]: File "<frozen importlib._bootstrap>", line 991, in _find_and_load Feb 20 11:21:48 iron gunicorn[20260]: … -
Django rest framework TypeError: 'NoneType' object is not callable
/models.py class Like(models.Model): user = models.ForeignKey(settings.AUTH_USER_MODEL, related_name='likes', on_delete=models.CASCADE) content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE) object_id = models.PositiveIntegerField() content_object = GenericForeignKey('content_type', 'object_id') class Content(models.Model): """Контент (фильмы, сериалы, и т.д.)""" title_ru = models.CharField('Название', max_length=200, blank=True) title_en = models.CharField('Название на английском', max_length=200, blank=True) rating = models.FloatField('Оценка', validators=[ MaxValueValidator(10.0), MinValueValidator(0.0), ], default=0.0) year = models.PositiveSmallIntegerField('Дата выхода', default=date.today().year, null=True) kinopoisk_id = models.IntegerField('Кинопоиск id') is_banned = models.BooleanField('Бан', default=False) def __str__(self): return f'{self.title_ru} / {self.title_en}' class Meta: ordering = ['-year'] verbose_name = 'Контент' verbose_name_plural = 'Контент' /services.py from django.contrib.auth import get_user_model from django.contrib.contenttypes.models import ContentType User = get_user_model() def add_like(obj, user): """Лайк пользователя""" obj_type = ContentType.objects.get_for_model(obj) like, is_created = Like.objects.get_or_create( content_type=obj_type, object_id=obj.id, user=user) return like def remove_like(obj, user): """Лайкает `obj`.""" obj_type = ContentType.objects.get_for_model(obj) Like.objects.filter( content_type=obj_type, object_id=obj.id, user=user ).delete() def is_fan(obj, user) -> bool: """Удаляет лайк с `obj`.""" if not user.is_authenticated: return False obj_type = ContentType.objects.get_for_model(obj) likes = Like.objects.filter( content_type=obj_type, object_id=obj.id, user=user) return likes.exists() def get_fans(obj): """Получает всех пользователей, которые лайкнули `obj`.""" obj_type = ContentType.objects.get_for_model(obj) return User.objects.filter( likes__content_type=obj_type, likes__object_id=obj.id) /serializers.py from django.contrib.auth import get_user_model from rest_framework import serializers from .services import is_fan User = get_user_model() class FanSerializer(serializers.ModelSerializer): class Meta: model = User fields = ( 'username', ) class ContentListSerializer(serializers.ModelSerializer): """Список контента""" class Meta: model = Content fields = ('title_ru', 'title_en', … -
Return Custom Response on Django Rest Framework Generics Retrieve API View
Excuse me devs, i want to ask about how to return custom response on Class Based Views for django rest framework generics retrieveapiview. I have tried to make class based views and function for return custom response but error "Object of Type is not JSON serializable" I just want to return custom response like {"msg": "success", "data": queryset data} # My Views class GetClientDetails(generics.RetrieveAPIView): queryset = TablePVUser.objects.all() serializer_class = GetClientDetails lookup_field = 'pv_owner' def get(self, request, pv_owner): queryset = self.get_queryset().filter(pv_owner=pv_owner, user__is_active=True) return Response({'Message': 'Users active loaded successfully', 'data': queryset}, status=status.HTTP_201_CREATED) -
how to save edits of object and view it as pdf file with django
hello everyone I'm new in django, I finished my app but I want to add some features, in my medical city I need to save all edits that done, like if the filling done on tooth 11 on 20/10/2022, but in 20/12/2022 we extract the same tooth, I want to save the filling and extraction in the details with date of patient like this "20-10-2022" "20-12-2022" click it and go to the form and see what we have done at that date, in my app now I just edit the fields like the tooth number and I can't see the old tooth numer, the second feature is print the fields in pdf form that we used in the medical city that contains patient details and graph of teeth and small box to describe the tooth, like Decay, Filling and Missing, like this "11 M (for missing)" like this picture, is it posiable? -
Populating an HTML table from Django views.py
I have an HTML table that I want to be populated from views.py. Here is my code: index.html {% for pizza in pizza %} <tr id="{{pizza.name}}"> {% for item in pizza.pizza.all %} <td>{{item.status}}</td> <td>{{item.name}}</td> {% endfor %} </tr> {% endfor %} views.py def barangay_canvass_report(request): pizza_data = [{'name': 'Pepperoni Pizza', 'status': 'Ready'}] return render(request, "index.html", {'pizza': pizza_data}) The table doesn't get populated and I don't see any error code. Is it the format in pizza_data? The reason why pizza_data is hardcoded is because that is a JSON file that I need to figure out how to insert but for now I want to see if the {% for %} loop can populate but it is not. -
Implement email verification during sign-up process
I need to validate user's email before allowing them to proceed with account creation. What will be the best way of doing so in Django ? I was thinking of sending cookies with UUID which will be used during registration. email_validation_DB: UUID | Email | Confirmation Code | is_verified Then, when user will click on register. UUID will be used to get the verified email address from email_validation_DB and proceed with account creation. -
get (1045, "Access denied for user 'tony'@'localhost' when use environment variables
i'm in ubuntu 22.04 i connect my project to mysql whit environment variables: DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': env('NAME'), 'USER': env("USER"), 'PASSWORD': env("PASSWORD"), 'HOST': env("HOST"), 'PORT': '', } } and my .env file: NAME=mysql USER=root PASSWORD=411481:011 HOST=localhost return this error: (1045, "Access denied for user 'tony'@'localhost' but when didn't use environment variables that work DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'mysql', 'USER': 'root', 'PASSWORD': '411481:011', 'HOST': 'localhost', 'PORT': '', } } -
Upon Table row click, go to a new html page! How does that work for element-ui?
Currently working on a website using Django and I encountered a problem. Upon row-clicking on the table row, I want it to open a new page called "doctor_qr.html" for that particular row. Does anyone know how does that work? Also, upon doing row-click, the records for the corresponding row should be POSTED to the function "medicineRequestSelect" in view_doctor.py. However, it is unable to extract that row of values and only returns me None values shown in Image 1. I would greatly appreciate any help or advice. Thank you! <doctor_emr.html> {% verbatim %} <div id="app2" class="container"> <div class="emr-table"> <el-table ref="multipleTable" :data="list" stripe style="width: 50%" @row-click="handle" @selection-change="handleSelectionChange"> <el-table-column prop="id" label="Index"> </el-table-column> <el-table-column prop="order_id" label="Order ID"> </el-table-column> <el-table-column prop="ward_number" label="Ward No."> </el-table-column> <el-table-column prop="prop" label="Scan QR" width="width"> </el-table-column> </el-table> </div> </div> {% endverbatim %} <script> new Vue({ el: '#app2', data() { return { list: [] } }, mounted() { this.getemrList() }, methods: { getemrList() { // Obtain EMR list axios.post(ToDJ('emrList'), new URLSearchParams()).then(res => { if (res.data.code === 0) { console.log(res.data.data) this.list = res.data.data } else { this.NotifyFail(res.data.data) } }) }, // Purpose: For the row click handle(row, event, column) { console.log(row, event, column) axios.post(ToDJ('medicineRequestSelect'), new URLSearchParams()).then(res => { if (res.data.code === 0) { … -
Multiple django apps vs multiple projects
So I have an architectural question for setting up a new application. Currently, I have a Django application (App 1) that receives data from a mobile phone (through api endpoints) and stores it in db. Then a separate celery application (App 2) runs some computation over this data and sends the results to a third Django application (App 3). This third app basically supports a reactjs site that I have for viewing the computed data. I want a new application that will serve as a 'public' API. So, instead of having App 1 as internal endpoints that only my mobile application has access to, I want to make it available to other developers to integrate themselves. So they can now interact with these endpoints to send me data from a phone, and then run some computation over it and view the raw and computed data afterwards (not on a frontend, just a csv endpoint from App 1 will be fine, no need for another app to store this data, like I have in my original setup). The question that I have is: is it better to setup a brand new Django project for this? Or, can I just create a … -
No data posts by my Kotlin appliaction to Django Rest Framework
I made a Authorizing system with SMS which gets number of an application then makes account and with verify code it let user to login. the problem is that when I send data by Retrofit in Kotlin as POST ,it sends no data (None) to server and Django logs show that no data sent for it. I know my Django API is working truly because of that POSTMAN works with it but my Kotlin application doesn't. Here I used APIService "Kotlin Intrface" class like this you see as below: @FormUrlEncoded @POST("v1/register/") suspend fun RegisterRequest( @Field("mobile") mobile: String ):Response<Reply> I expected to see in logs that data sends for server but it doesnt work. Also maybe you say that it needs Header but no ,cuz of I tried to set header for it also its Register and doesn't need token or anything like this and there's no persmission for it in server side. -
Django 'exclude' query did not return expected results
I am relatively new to Django and this is my first post in the forum. Below are the models(simplified) that are used in the app. The app is about reserving a set of resources for a given period. from django.db import models class Resource(models.Model): id = models.AutoField(primary_key=True) serialno = models.CharField(max_length=30, null=False, unique=True) name = models.CharField(max_length=40, null=False) def __str__(self): return f"{self.name}/{self.serialno}" class Reservations(models.Model): id = models.AutoField(primary_key=True) active = models.BooleanField(default=True) name = models.CharField(max_length=30, null=False) startdate = models.DateField(null=False) enddate = models.DateField(null=False) resource = models.ManyToManyField("myapp.Resource", db_table="myapp_resource_reservations", related_name="reservations") def __str__(self): return f"{self.name}/{self.startdate}/{self.enddate}" For example, below are the data present in the models Resource(format: name/serialno) >>> Resource.objects.all() <QuerySet [<Resource: Resource1/RES1>, <Resource: Resource2/RES2>, <Resource: Resource3/RES3>, <Resource: Resource4/RES4>]> >>> Reservations(format: name/startdate/enddate/active) All reservations are made for Resource1 >>> Reservations.objects.all() <QuerySet [<Reservations: Booking1/2023-03-01/2023-03-07/True>, <Reservations: Booking2/2023-03-15/2023-03-22/True>, <Reservations: BookingX/2023-03-08/2023-03-14/False>]> >>> I am trying to retrieve all resources that do not have an 'active' reservation for a given date period using below query. >>> Resource.objects.exclude((Q(reservations__startdate__range=('2023-03-08','2023-03-14')) | Q(reservations__enddate__range=('2023-03-08','2023-03-14'))) & Q(reservations__active=True)) <QuerySet [<Resource: Resource2/RES2>, <Resource: Resource3/RES3>, <Resource: Resource4/RES4>]> >>> Resource1 does have a reservation: BookingX for period 2023-03-08 to 14 but it is active=False. I expected 'Resource1' to show up in above exclude query but it didn't(intended logic: 'exclude all resources that fall in … -
Update only 2 field in DRF
i have a model and with DRF i want pdate only 2 field in model but when i update , 2 field are update but the other fields are empty . #View `@api_view(['GET', 'PUT', 'DELETE']) def snippet_detail(request, format=None): try: requestd = request.POST['card_number'] requestd2 = card.models.Card(card_number=requestd) #snippet = Card.objects.get() print(requestd2) credit = Card.objects.filter(card_number=requestd).values('initial_credit') credit2 = int(credit[0]['initial_credit']) requestcredit = int(request.POST['initial_credit']) #print(snippet) print(credit) print(credit2) except Card.DoesNotExist: return Response(status=status.HTTP_404_NOT_FOUND) if request.method == 'PUT': serializer = CardModelSerializer(requestd2, data=request.data, partial=True) #insted of requestd 2 was snippet if serializer.is_valid(): #print(request.data) new_credit= credit2 - requestcredit comment = 'Not ٍ Enough' comment2 = 'Not Valid' if new_credit >= 0: if requestcredit >0: serializer.save() return Response(serializer.data,status=status.HTTP_200_OK) else: return Response (comment2, status=status.HTTP_400_BAD_REQUEST) else: return Response(comment, status=status.HTTP_451_UNAVAILABLE_FOR_LEGAL_REASONS) return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST) #serializers class CardModelSerializer(serializers.ModelSerializer): class Meta: model = Card fields = ['card_number', 'initial_credit'] #'all' #Model class Card(models.Model): card_number = models.CharField(max_length=100, unique=True ,primary_key=True, verbose_name='شماره کارت') first_name_and_last_name = models.CharField(max_length=100) company_name = models.CharField(max_length=100) national_number = models.CharField(max_length=100, unique=True) initial_credit = models.IntegerField(default=0) password = models.CharField(max_length=100) phone_number = models.CharField(max_length=100) personnel_code = models.CharField(max_length=100) #unique=False card_status = models.CharField(max_length=10, choices=(('فعال', 'فعال',), ('غیر فعال', 'غیر فعال',))) created_at = j_models.jDateTimeField( null=True ,blank=True ,default=datetime.now ) #auto_now_add=True, updated_at = j_models.jDateTimeField(auto_now=True) class Meta: verbose_name = 'Card' verbose_name_plural = 'Cards' def __str__(self): return self.card_number` -
Poetry install error while running it on github workflow
Encountering an error message while installing dependencies using Poetry with GitHub Actions. It works fine when I install it locally. However, it gives out the runtime error of ['Key "files" does not exist.'] missing when Action runs on GitHub for the line [Install dependencies]. Error Message 'Key "files" does not exist.' Error: Process completed with exit code 1. Github Workflow name: Linting on: pull_request: branches: [ master ] types: [opened, synchronize] jobs: linting: runs-on: ${{ matrix.os }} strategy: matrix: python-version: [3.9] os: [ubuntu-latest] steps: - name: Checkout uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - name: Set up Poetry uses: abatilo/actions-poetry@v2.0.0 - name: Install dependencies run: poetry install - name: Run code quality check run: poetry run pre-commit run -a Toml File [tool.poetry] name = "ailyssa_backend" version = "4.0.9" description = "The RESTful API for Ailytics using the Django Rest Framework" authors = ["Shan Tharanga <63629580+ShanWeera@users.noreply.github.com>"] [tool.poetry.dependencies] python = "^3.9" Django = "4.1.3" djangorestframework = "^3.13.1" django-environ = "^0.8.1" djangorestframework-simplejwt = "^5.0.0" drf-spectacular = {version = "0.25.1", extras = ["sidecar"]} django-cors-headers = "^3.10.0" uvicorn = "^0.16.0" django-filter = "^21.1" psycopg2 = "^2.9.3" django-auditlog = "2.2.1" boto3 = "^1.22.4" django-allow-cidr = …