Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Can DRF Simple JWT be used to validate a token it didn't generate?
I'm using @azure/msal-react for AAD authentication on the client. It returns an accessToken and an idToken that I need to send to my Django/DRF API where they need to be validated, user it belongs to found or created if they don't exist, and then a JWT issued back to allow further client-API communication. I'm currently sending the accessToken in the header as Authorization: Bearer <accessToken>. Because I have the following in my settings.py, I am getting Unauthorized: /api/v2/auth/aad_token/validate/: 'DEFAULT_AUTHENTICATION_CLASSES': ( 'rest_framework_simplejwt.authentication.JWTAuthentication', ), The response says: { "detail": "Given token not valid for any token type", "code": "token_not_valid", "messages": [ { "token_class": "AccessToken", "token_type": "access", "message": "Token is invalid or expired" } ] } It looks like it the DEFAULT_AUTHENTICATION_CLASSES is intercepting it and can't validate it, I assume because it is one it didn't generate. Due to this, I was about to start writing DRF custom authentication that subclasses BaseAuthentication, permitting the HTTP_AUTHORIZATION to be received where I can do with it what I need. However, I read the Microsoft documentation a few more times, these parts in particular: There are also several third-party open-source libraries available for JWT validation - there is at least one option for almost every … -
Django serialization of multiple big QuerySets into one json object
Hello I have this problem about serialization QuerySets for now I do it like that: I have 9 querys like that: s1 = S280000020E3120.objects.filter(date__range=[dateo, datee]).values('date', 'temprature') s1 = s1.filter(date__minute=20) |s1.filter(date__minute=40) |s1.filter(date__minute=00) ...[sinp]... And then I go list() on all of them result = { 'ds1':[ list(s1), S280000020E3120.objects.last().sensor.description, ], ...[sinp]... And at the end of view I go just return JsonResponse(result, safe=False) And this is slow and my raspberry is running all the time with usage of 100% memory and swap because of list() I guess. I tried to replace list() with django.core serializers like that: result = { 'ds1':[ serializers.serialize('json', s1), S280000020E3120.objects.last().sensor.description, ], ...[sinp]... But this didn't do the trick either, it was even slower than plain list(). With list() it take approximately 60s to serialize everything and output on the website. With serializers.serialize() it is approximately 80s. The whole 9 query take like split of a second to complete and return data. So my question is: Is there a way to do it better? How do I cut some time and memory usage? But mostly I care about time to be honest. -
how to sum many fieldes in django
hi i want to sum a student degree for all subject like below and stor it in to TotalSub TotalSub = (ArabicSub+EnglishSub+MathSub+GeographySub+SinceSub+ReliganSub) any idea her is my model class StudentDgree(models.Model): StdIDNumber = models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID') GroupNumber = models.SmallIntegerField(null=True,default=0000) StdName = models.CharField(max_length=250) ArabicSub = models.SmallIntegerField(null=True,default=None) EnglishSub = models.SmallIntegerField(null=True,default=None) MathSub = models.SmallIntegerField(null=True,default=None) GeographySub = models.SmallIntegerField(null=True,default=None) SinceSub = models.SmallIntegerField(null=True,default=None) ReliganSub = models.SmallIntegerField(null=True,default=None) TotalSub = models.SmallIntegerField(null=True,default=None) -
How do I query a Foreign key, but in reverse and list them in Django Rest Framework?
I'm having a hard time getting my head around this for some reason. I know how to do this in plain Django, but not sure how to do this in DRF. class Novel(models.Model): name = models.CharField(max_length = 100) image = models.URLField(blank = True) linkNU = models.URLField(blank = True) author = models.ForeignKey(Author, on_delete = models.CASCADE, null = True) category = models.ManyToManyField(Category) description = models.TextField(blank = True) slug = models.SlugField(primary_key = True, default = None, max_length=100) numOfChaps = models.IntegerField(default = 0) novelStatus = models.BooleanField(default = True) #True will be for Ongoing, False for Completed def __str__(self): return self.name Chapter Model looks like this class Chapter(models.Model): index = models.IntegerField(default = None, blank = True) text = models.TextField(max_length=None) title = models.TextField(max_length = 100) novelParent = models.ForeignKey(Novel, on_delete = models.CASCADE, verbose_name = "chapter") nextChap = models.BooleanField(default = False) novSlugChapSlug = models.CharField( max_length = 100, blank = True, default = None) def __str__(self): return f"Chapter {self.index} - {self.novelParent}" Right now this is what I have for ChapterSerializer but it doesn't work: class ChapterSerializer(serializers.ModelSerializer): novel = serializers.CharField(source = 'novelParent.name') novSlug = serializers.CharField(source = 'novelParent.slug') class Meta: model = Chapter fields = "__all__" # fields = ('index','title','text','nextChap','novel','novSlug','novSlugChapSlug') I've read around and feel like it probably is going to … -
Is there a way to use pandas in django without using models or db
This may be a stupid question but I need help with a project I'm working on (also english isnt my first language so bear with me...). I'm developing a web app with Django to perform sentiment analysis of live tweets (using tweepy) and I am using a form to get from user input the keyword to search from django import forms class TwitterForm(forms.Form): keyword = forms.CharField(max_length=50) And now I have to fetch tweets using this function here def get_tweets(self, query, count=100): tweets = tweepy.Cursor(self.api.search, q=query, lang="en", since='2021-01-01').items(count) cleaned_tweets = [self.clean_tweet(tweet.text) for tweet in tweets] sentiment_object = [TextBlob(tweet) for tweet in cleaned_tweets] #sentiment_object[0].polarity, sentiment_object[0] sentiment_values = [[tweet.sentiment.polarity, str(tweet)] for tweet in sentiment_object] #sentiment_values[0] Now, I run this code on Colab and everything worked, I printed the fecthed tweets with pandas. But how does it work on Django? I wrote down this code in views.py but I've literally no clue... def prediction(self, request): sentiment_df = pd.DataFrame(self.sentiment_values, columns=["polarity", "tweet"]) sentiment_df["analysis"] = sentiment_df["polarity"].apply(self.getAnalysis) #sentiment_df.head() if request.method=='POST': self.api = TwitterSentClass() t=request.POST['keyword'] result = self.api.get_tweets(query=t, count=100) return render(request,'myapp/prediction.html',{}) I searched everywhere on internet and google and Pandas is always used for Django models or queries...How do I use pandas to just print fetched live tweets? Thank … -
how to perform a query with filter in the django template
hello family by the way I am a beginner in web programming with the python language and its django framework my concern is to be able to display the information coming from the join of several tables or models in my case I have the following tables: Country table city table church table but I used the mptt for country and city and everything is working fine but I want to display the list of all the countries with their respective cities as well as all the churches for each city. this is where the great difficulty lies for the month. If there is someone who can help me I will be very very happy -
Django rest framework; how do you use the ID of a foreign key to create an instance through the serializer?
I have two serializers, one for Country and one for my model Foo, I want to save the object by using the foreign key for this model but it errors out whenever I try to validate. I have this class Actor(TLPWrappedModel, CommentableModel): label = models.CharField(max_length=56, unique=True) country_of_origin = models.ForeignKey(Country, on_delete=models.CASCADE) class FooSerializer(serializers.ModelSerializer): country_of_origin = CountrySerializer() class Meta: model = Actor fields = [ 'id', 'country_of_origin', 'label', ] class Country(models.Model): label = models.CharField(max_length=56, unique=True) iso_code = models.CharField(max_length=3, unique=True) class CountrySerializer(serializers.ModelSerializer): class Meta: model = Country fields = [ 'iso_code', 'label', ] And this is what I'm trying to do serializers = FooSerializer(data={'label': 'Foobar', 'country_of_origin': self.country.id}) serializers.is_valid() print(serializers.errors) print(serializers.validated_data) serializers.save() But I get this error {'country_of_origin': {'non_field_errors': [ErrorDetail(string='Invalid data. Expected a dictionary, but got int.', code='invalid')]}} is it possible to use the ID of a foreign key to validate and create the object using the serializer? -
When I enter 'python manage.py runserver' it takes a lot of time and shows "env: python: Argument list too long" on Mac terminal and pycharm
I just started learning Django after completing python. When I enter the command 'python manage.py runserver' it takes a lot of time and shows "env: python: Argument list too long" on Mac terminal and pycharm. How should I fix this? -
Django session Conflict between logged users
I am using the estructure below to login a custom user: usuario = Usuario.objects.get(pk=uuid) request.session['usuario_id'] = usuario.pk But some users are logging and using session of the other user. I have a lot number of the views per day, i belive be concurrency. Exemple: A "User B" logged and this User posted comments with "User X" session My config: VPS server: Nginx Gunicorn Postgres Memcached Somebody can help me? -
BrowsableAPIRenderer in Django 2.2 for function-based-views
I am new to Django rest Framework. I am trying to create a public POST api and on display it should also have the HTML form like it does with the class based views. Here is my view. @api_view(['POST']) @permission_classes([permissions.AllowAny, ]) @authentication_classes([]) @renderer_classes([JSONRenderer, BrowsableAPIRenderer]) def lead_create(request): serializer = LeadSerializer(data=request.data) if serializer.is_valid(): try: serializer.save() except Exception as e: return Response( str(e), status=status.HTTP_400_BAD_REQUEST ) return Response( {'message': 'Lead Successfully Saved'}, status=status.HTTP_201_CREATED ) My problem is the output is something like below: Why am I not getting the HTMLForm even when i have added the 'BrowsableAPIRenderer' renderer class -
Django REST framework - Adding Depth in Serializer gives Foreign Key Constraint Failed on POST data
I am having a model like this: class KioskShelfMapping(models.Model): mapped_shelf_basket_name_reference = models.ForeignKey(ShelfBasketMapping, on_delete=models.CASCADE, default=1) mapped_shelf_name = models.CharField(max_length=15, null=False, blank=False, default="default") mapped_kiosk_name = models.CharField(max_length=15, blank=False, null=False, default="default") shelf_position = models.PositiveSmallIntegerField(null=False, blank=False, default=0) and below is my Serializer: class KioskShelfMappingSerializer(serializers.ModelSerializer): class Meta: model = KioskShelfMapping fields = ['id', 'mapped_shelf_basket_name_reference', 'mapped_shelf_name', 'mapped_kiosk_name', 'shelf_position'] depth = 2 The issue I am facing is whenever I am adding the depth on POSTING some data to the model gives me FOREIGN KEY constraint failed But when I remove the depth field, I am able to POST the data to the model successfully. I tried searching for the same issue and found this and modified my serializer accordingly: class KioskShelfMappingSerializer(serializers.ModelSerializer): class Meta: model = KioskShelfMapping fields = ['id', 'mapped_shelf_basket_name_reference', 'mapped_shelf_name', 'mapped_kiosk_name', 'shelf_position'] depth = 2 def __init__(self, *args, **kwargs): super(KioskShelfMappingSerializer, self).__init__(*args, **kwargs) request = self.context.get('request') if request and request.method =='POST': print('Method is POST') self.Meta.depth = 0 print(self.Meta.depth) else: self.Meta.depth = 2 This doesn't seem to work. I still get the same error. Where am I going wrong? Thanks for you help in advance. -
Django app - sourcing static files from S3
I've tried every possible tutorial that I could find on the internet but I still can't figure out what I'm doing wrong. I'm trying to use AWS S3 in order to serve the static and media files for my app. The access to the bucket is public and seems to be working fine because I can access any of the files there in the browser. Furthermore, I'm able to download and save a file from there when running this command: import boto3 session = boto3.session.Session() s3 = session.client( service_name='s3', aws_access_key_id=settings.AWS_ACCESS_KEY_ID, aws_secret_access_key=settings.AWS_SECRET_ACCESS_KEY, ) print(s3) s3.download_file(Bucket=settings.AWS_STORAGE_BUCKET_NAME, Key='research_files/abc.xlsx', Filename='research_files/abc.xlsx') The problem is that Django is not looking at AWS for the static files. I'm getting 404 errors as Django is unable to find the files on my local server: 127.0.0.1/:10 GET http://127.0.0.1:8000/static/css/material-kit.css?v=2.0.7 net::ERR_ABORTED 404 (Not Found) 127.0.0.1/:13 GET http://127.0.0.1:8000/static/js/core/jquery.min.js net::ERR_ABORTED 404 (Not Found) I've added 'storages' to my list of apps and tried all kind of different AWS settings in my settings.py as you will see from the commented out lines below. settings.py: # Static files (CSS, JavaScript, Images) # STATIC_URL = '/static/' # MEDIA_URL = '/images/' # STATICFILES_DIRS = [os.path.join(BASE_DIR, 'static')] # MEDIA_ROOT = os.path.join(BASE_DIR, 'static/images') AWS_ACCESS_KEY_ID = config('AWS_ACCESS_KEY_ID') AWS_SECRET_ACCESS_KEY = config('AWS_SECRET_ACCESS_KEY') … -
How to test a view that needs authentication with PyTest?
I am starting out with Django and I wanted to get my hands dirty with TDD. I am confused on whether this is the correct way to test a view, especially that I want to implement it in Heroku. I want to emphasize that I want to test the status code. Is this the right way to do so? Here is my code below @pytest.mark.django_db def test_get_personal_successful(client): headers = {"Authorization": "Bearer " + user["idToken"]} r = client.get("http://127.0.0.1:8000/personal-infos/", headers=headers) assert r.status_code == 200 Note that the assertion is successful in the code above. -
Apply django authentication for all views
I am trying to implement Django basic authentication for all of the views in my views.py file. Although I can add the authentication code snippet in every view, but it will not be easy to apply this to upcoming views. Is there any way that every view in my views.py will automatically check for the authentication? views.py def mgmt_home(request): ############################################################## # This code is repetitive ############################################################## if request.user.is_anonymous: return redirect("/login") ############################################################## test_name = Test.objects.all()[0].test_name metadata = { "test_name": test_name, } return render(request, "mgmt_home.html", metadata) Is there any way where I can avoid this repetitive code in all of my views? -
I need a text when your login "Your password incorrect"
Can you help me to understand logic : I need when I enter have a message near login form "Your password incorrect" "Your login incorrect. I have a base registration form with this messages: class RegistrationForm(auth_forms.UserCreationForm): """ A form that creates a user """ error_messages = { 'password_mismatch': 'Password mismatch.', } password1 = forms.CharField( label='Password', strip=False, widget=forms.PasswordInput(attrs={'autocomplete': 'new-password'}) ) password2 = forms.CharField( label='Access password', widget=forms.PasswordInput(attrs={'autocomplete': 'new-password'}), strip=False ) I think to write the same for login : Class AuthForm(AuthenticationForm): error_messages = { 'password_mismatch': ("Password mismatch" ), 'invalid_login': ("Invalid login"), } But I think it is not correct. my views.py this: class BaseRegistrationView(ActivationEmailMixin, generic.FormView): form_class = RegistrationForm @transaction.atomic def form_valid(self, form): self.new_user = form.save(commit=True) self.new_user = authenticate( username=form.cleaned_data['email'], password=form.cleaned_data['password1'], ) login(self.request, self.new_user) self.send_activation_email() return super().form_valid(form) # new class BaseLoginView(LoginView): authentication_form = AuthForm And html in templates: {% if field.is_hidden %} {% render_field field %} {% else %} <div class="form-group"> <label class="form-group__label"> {{ field.label }} {% if field.field.required %}* {% endif %} </label> {% if field.field.widget.input_type == 'checkbox' %} {% render_field field class="form-group__control" %} {% else %} {% render_field field class="input form-group__control" %} {% endif %} {% if field.errors %} {% for error in field.errors %} <div class="form-group__error"> {{ error }} </div> … -
Show error for django unique_together in CreateView form
I'm using Django CBV CreateView and have a unique_together setting on the model class Meta: unique_together = ('field1', 'field2',) When the user adds a non-unique new record, it triggers an error at the database level, which is a 500 error. I'd like to instead just explain to the user that their entry was a duplicate and to add something else. Any idea for an easy way to do this with CBV and the unique_together setting (or a validator)? I'd like to keep this at the model level so the unique check happens regardless if the user creates, edits, or if an admin does it in the Django admin. Thank you! -
Django client.cookies is empty, but when visiting the url there is clearly a CSRF token assigned as a cookie
Django 3.2, python 3.8 I have a function that forces a login so I can grab data from a protected API. Here is the code: def force_client_login(client, base_url): url = urljoin(base_url, '/login/') client.get(url, allow_redirects=False) print(client.cookies) csrftoken = client.cookies['csrftoken'] login_data = { 'username': 'HIDDEN', 'password': 'HIDDEN', 'csrfmiddlewaretoken': csrftoken, } response = client.post(url, data=login_data) For some reason, the client.cookies is printing [] / an empty array. When I visit the URL (which I printed out and verified it is correct), I can clearly see there is a cookie and that it is the CSRF token, I can see this by looking in the browser dev console under networking and looking at the get request. This function worked on a python 3.6 version of the same project I had running on multiple separate machines. Any thoughts? -
Django kills older requests
I am running a Django website over IIS. When a user saves an object it can take some time, so rather than have them wait for it to finish an AJAX request is sent to the server with the submission information and the page is immediately redirected. However, if the server gets many more requests that old saving request is killed rather inelegantly. The log files show that it ends mid execution with no error messages or other indication that it failed. How do I keep older requests alive in Django? P.S. I have already investigated starting a new multithreading Process but encountered issues around Django models, and I am looking for something more simple than Celery. -
Field 'id' expected a number but got <customerlogin: customerlogin object (4)>
I am trying to add customer and salon to their respective tables according to what option is selected by the user.I gave "Customer" and 'Salon owner" in dropdown menu.The name given in dropdown menu is "category". If a user select "Customer" from dropdown menu, registration form details should be added to customerlogin and customerreg tables.Similarly, in the case of "Salon owner".But unfortunately when any of these two option is selected,details were added to both customerlogin table and salonlogin table but not to other two tables. Views.py def register(request): if request.method == 'POST': ufname = request.POST.get('fname') ulname = request.POST.get('lname') uemail = request.POST.get('email') upassword = request.POST.get('password') umobile = request.POST.get('mobile') ucategory = request.POST.get('category') uaddress = request.POST.get('address') if (salonreg.objects.filter(Email=uemail).exists() or customerreg.objects.filter(Email=uemail).exists()): messages.info(request, "Email ID Already Taken") return redirect('register') elif (salonreg.objects.filter(Mobile=umobile).exists() or customerreg.objects.filter(Mobile=umobile).exists()): messages.info(request, "Mobile Number Already Taken") return redirect('register') elif (ucategory=="Customer"): cloginobj = customerlogin() cloginobj.Username = uemail cloginobj.Password = upassword cloginobj.save() cuserreg = customerreg() cuserreg.Login_id_id = cloginobj cuserreg.First_name = ufname cuserreg.Last_name = ulname cuserreg.Email = uemail cuserreg.Password = upassword cuserreg.Mobile = umobile cuserreg.Address = uaddress cuserreg.save() cuserdetail = customerreg.objects.get(Email=uemail) request.session["userid"] = cuserdetail.id return render(request, "profile.html", {'userdetail': userdetail}) else: sloginobj = salonlogin() sloginobj.Username = uemail sloginobj.Password = upassword sloginobj.save() ssalonreg = salonreg() ssalonreg.Login_id = sloginobj.id … -
Django, create form that has copy and paste ability from Excel
As the title states I want create a django from that allows a user to copy and paste data from excel to the form. Right now I just have a very basic form from django import forms from .models import CATEGORIES, Generator class GeneratorForm(forms.ModelForm): class Meta: model = Generator # fields exclude = {'save_id', 'user', 'create_date', 'data_table', 'save_name'} widgets = { 'category': forms.Select(attrs={'class': 'form-check-label', }, choices=CATEGORIES), } And also a very basic html page. <main role="main" class="container"> <div class="d-flex align-items-center p-3 my-3 text-white-50 bg-dark rounded box-shadow"> <div class="lh-100"> <h2 class="mb-0 text-white lh-100">Generator</h2> </div> </div> <div> <form action="" method="post"> <div class="form-check"> {{form.category|as_crispy_field}} </div> <br> <input type="submit" class="btn btn-success text-right" value="Submit"> </form> </div> </main> How would I go about adding another form item/items in my Generator form to be able to take in a 3 column excel table (via copy paste mechanic). Would I need to use js as well to get this done? Apologies in advanced for the minimal amount of code. Kinda new to this Django thing. -
how to convert SQL query to django query?
I have an SQL query but I'm not able to convert it into a Django query. Any help is appreciated! select article_id, count(distinct user_id) as count_of from articles_likes group by article_id -
Django annotate existance in related field
My models: class Character(models.Model): name = models.CharField(max_length=100) class Item(models.Model): name = models.CharField(max_length=100) class Equipment(models.Model): owner = models.ForeignKey(Character, on_delete = models.CASCADE) item = models.ForeignKey(Item, on_delete = models.RESTRICT) And now i need to annotate if items are in equipment: you = Character.objects.get(pk=1) items = Item.objects.all().annotate(ready=Value(True, output_field=models.BooleanField()), filter=Q(equipment__owner__in=you)) but something is wrong : TypeError: 'Character' object is not iterable -
Printing Output from an External Python Script on Django Webpage
I have incorporated an external python script into my Django webpage. I am currently able to display the output of my script in the terminal once a button is clicked, but I want my script to be displayed on my webpage once the button is clicked. The output I want displayed on the webpage from the script is stored in the variable 'res'. This is what I currently have in each file relating to this issue: Views.py def reccomendation_system(request): •external python script for a recommendation system code• return res class IndexPageView(TemplateView): template_name = 'main/index.html' class ChangeLanguageView(TemplateView): template_name = 'main/change_language.html' class MovieReccomdationView(TemplateView): template_name = 'main/recomend.html' def results(request, res): return HttpResponse("Your personalised output:" % res) urls.py path('reccomendation_system/', views.reccomendation_system,name='script'), path('results/', views.results, name='results'), recomend.py <form action="/results"> <button onclick="location.href='{% url 'results' %}'">Output on Webpage</button> {% if data %} {{data | safe}} {% endif %} </form> The error that I am currently getting is: TypeError: results() missing 1 required positional argument: 'res' I am pretty new to Django so I'm not too sure where I am going wrong. The above code is what I seem to have gathered from different tutorials. Any help is appreciated :) thanks -
Adding Abstract Models support to django-rest-framework-mongoengine
In a Django project I am using mongoengine that provides Django style models to MongoDB collections. I am also using django-rest-framework-mongoengine witch extends DRF to support Documents, EmbeddedDocuments, DynamicDocuments and DynamicEmbeddedDocuments the MongoEngine model representation of MongoDB. While Django and DRF allow for using abstract classes in the Models. This is now supported by DRF-mongoengine. However i believe it is possible to add support for abstract Models by writing custom Serializers. So far I was unable to succeed and I would appreciate your help in getting this to work. class Entry(Document) meta = { 'abstract': True, 'allow_inheritance': True, } text = StringField() class Post(Entry) meta = { 'allow_inheritance': True, } class comment(Entry) meta = { 'allow_inheritance': True, } post = ReferenceField(Post) # No Problem serializing this # for the sake of Demonstration, related is a list of posts and comments related = ListField(ReferenceField(Entry)) # This is not supported by DRF-mongoengine class PostSerializer(DocumentSerializer) # Works class Meta: model = Post fields = '__all__' class PostsViewSet(ModelViewSet): serializer_class = PostSerializer queryset = Post.objects.all() class CommentSerializer(DocumentSerializer) # Fails class Meta: model = Comment fields = '__all__' class CommentsViewSet(ModelViewSet): serializer_class = CommentSerializer queryset = Comment.objects.all() What I am currently trying to do is to write … -
SonarScanner Error "Line is out of range in the file"
So I'm doing my django project normally, then, out of nowhere I got this error from my SonarScanner when I refactored the function names in formulas.py (and only that, I didn't tweak my sonar.properties nor my ci.yml file): java.lang.IllegalStateException: Line 308 is out of range in the file dietela_quiz/formulas.py (lines: 306) then I decided to add more whitespaces so it reaches 308 lines but ever since then, the error persists, and as I add more whitespaces or even created a dummy function (to increase the length of file legitimately), an error pattern was established like this: java.lang.IllegalStateException: Line n+1 is out of range in the file dietela_quiz/formulas.py (lines: n) where n is the actual number of lines in formulas.py this is my yml file: stages: - test - sonar-scanner - deploy UnitTest: image: python:3.6.5 stage: test before_script: - pip install -r requirements.txt - python manage.py makemigrations - python manage.py migrate - python manage.py collectstatic --no-input - python manage.py runserver 8000 & when: on_success script: - echo "Starting linter..." - sh linter.sh - echo "Starting tests..." - coverage erase - DATABASE_URL=$TEST_DATABASE_URL coverage run --include="./dietela_quiz/*","./nutritionists/*","./dietela_program/*" manage.py test --keepdb - coverage xml -i - coverage report -m artifacts: paths: - coverage.xml SonarScanner: image: …