Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Gunicorn worker timeout - Which gunicorn worker sync vs gthread
I am using Django and Django Rest Framework (DRF) for my project. In production, when I make HTTP requests, Gunicorn module on the server creates another worker to process that request. This process requires two workers: one to handle the Django request and another that is spawned when the Django code makes an HTTP request to the DRF view. After a while, I frequently find myself experiencing long response times, eventually leading to a 502 Gateway Error. Upon examining the logs, I discovered that all my workers were busy and waiting for the DRF response. Simultaneously, different clients made requests, but there were no available workers to handle these new HTTP requests (I am using 3 workers with Gunicorn's default synchronous worker model). How can I manage this situation when there are multiple simultaneous requests? -
Celery Task with AWS SQS Broker Cancels Immediately After Starting in Docker Environment
I'm experiencing an issue where a Celery task, configured with an AWS SQS broker, starts and then immediately cancels when run in a Docker environment. This behavior occurs despite the task executing successfully when run from PyCharm on the same machine. Below is the relevant part of the Celery configuration and the debug output I receive when the task is executed. Environment: Django version: 4.2 Celery version: 5.3.6 Broker: AWS SQS Deployment: Docker Celery configuration: from __future__ import absolute_import, unicode_literals from celery import Celery, shared_task from firmwave import settings app = Celery( 'firmwave', broker=f'sqs://{settings.AWS_SQS_ACCESS_KEY}:{settings.AWS_SQS_SECRET_KEY}@', ) app.conf.broker_transport_options = { 'region': settings.AWS_SQS_REGION, 'predefined_queues': { 'celery': { 'url': settings.AWS_QSQ_QUEUE_URL, 'access_key_id': settings.AWS_SQS_ACCESS_KEY, 'secret_access_key': settings.AWS_SQS_SECRET_KEY, }, }, 'is_secure': True, } app.conf.enable_utc = True app.conf.broker_connection_retry_on_startup = True app.autodiscover_tasks() Debug output: [DEBUG/MainProcess] Event request-created.sqs.GetQueueAttributes: calling handler... [DEBUG/MainProcess] Response body: b'<?xml version="1.0"?><GetQueueAttributesResponse xmlns="http://queue.amazonaws.com/doc/2012-11-05/">**<GetQueueAttributesResult><Attribute><Name>ApproximateNumberOfMessages</Name><Value>155</Value></Attribute></GetQueueAttributesResult>**<ResponseMetadata><RequestId>922533a1-ce80-5018-8f23-6d970e5039f6</RequestId></ResponseMetadata></GetQueueAttributesResponse>' [2024-02-02 10:06:08,319: DEBUG/MainProcess] Event needs-retry.sqs.GetQueueAttributes: calling handler <botocore.retryhandler.RetryHandler object at 0xffffb3475970> [DEBUG/MainProcess] Sending http request... [DEBUG/MainProcess] Certificate path... [DEBUG/MainProcess] Response headers... [DEBUG/MainProcess] Response body... [DEBUG/MainProcess] No retry needed. [DEBUG/MainProcess] Canceling task consumer... [DEBUG/MainProcess] Closing consumer channel... The Celery worker starts and appears to connect to AWS SQS successfully, but then cancels the task consumer and closes the channel without processing any tasks. Ensuring that the … -
Automatically set author on POST
I'm working on a events administration app powered by Django APIRest. When a user post a event is considered the author and I wonder what is the most elegant/professional way to do it: Override the post view Override the create model method Override the save serializer method This is what I currently have (option 1) The models.py: class Events(models.Model): title = models.CharField(max_length=200) description = models.CharField(max_length=200) dateday = models.DateTimeField() start_hour = models.TimeField(null=True) end_hour = models.TimeField(null=True) author = models.ForeignKey(Users, on_delete=models.CASCADE) The serializers.py: #... class EventsSerializer(serializers.ModelSerializer): class Meta: model = Events fields = '__all__' class UsersSerializer(serializers.ModelSerializer): events = EventsSerializer(many=False,read_only=True) class Meta: model = Users fields = '__all__' extra_kwargs = {'password': {'write_only': True}} #... The views.py: #... class EventsList(ListCreateAPIView): queryset = Events.objects.all() serializer_class = EventsSerializer def post(self, request): request.data['author'] = request.user.pk return super().post(request) #... It works, but I still have to prevent changing the author in a PUT request. There's a better way to minimize code or make it reusable? I tried the solution here: class EventsList(ListCreateAPIView): queryset = Events.objects.all() serializer_class = EventsSerializer def perform_create(self, serializer): serializer.save(author=self.request.user) but it does not work: a POST with a body without author the response is that the field author is required. -
Why is my Django signal file not working after setting it up?
I'm trying to send an email to a seller after a buyer completes their payment but I'm facing some issues and the email was not sent. I added a print statement and a try-except block so that I can use that to debug but the print statement did not bring any information in the console and the try block did not return any success or error message in the console too. Please help. Here's my signals.py file # Stdlib Imports import uuid # Django Imports from django.db.models.signals import pre_save, post_save from django.dispatch import receiver from django.core.mail import send_mail from django.conf import settings # Own Imports from payment.models import PaymentHistory @receiver(pre_save, sender=PaymentHistory) def create_ref_code_if_does_not_exist(sender, instance, **kwargs): """ Creates a reference code that will be used by paysack; if one does not exist. """ if not instance.ref_code: instance.ref_code = uuid.uuid4() @receiver(post_save, sender=PaymentHistory) def send_payment_notification_email(sender, instance, created, **kwargs): if created and instance.status == 'completed': print("PaymentNotificationEmail signal triggered.") # For debugging # PaymentHistory model has a ForeignKey to the BuyerOrderHistory model buyer_order = instance.order # BuyerOrderHistory has a ForeignKey to the Product model product = buyer_order.product # Get the seller's email address and name seller_email = product.user.email seller_name = product.user.full_name # Compose the email … -
I can't call the data properly into my html page
I am trying to pull data from the SQL Table that I have and I am able to create a for loop for the number of items i have in the table but i am unable to pull the data. main.py @app.route("/Playback" , methods=['GET', 'POST']) def Playback(): cursor = mysql.connection.cursor(MySQLdb.cursors.DictCursor) cursor.execute("SELECT * FROM `movies`") query = cursor.fetchall() return render_template('playback.html', cursor=cursor, query=query) playback.html <table> <tr> <td>Movie Name:</td> <td>View</td> <td>Delete</td> </tr> {% block content %} {% for obj in query %} <tr> <td><p>{{ cursor['movie_name'] }}</p></td> <td><button>View</button></td> <td><button>Delete</button></td> </tr> {% endfor %} {% endblock %} </table> Here is what I have tried and the results are in the picture below results i am trying to pull the movie name from the table movies but the movie names from the table is not appearing. Please help. Thank you in advance. -
When is the django db connection made for the tasks in case async operations or django-q?
I want to know when the db connection is made in case of async operations or django-q. My CONN_MAX_AGE = 0 and in the docs this is written, The default value is 0, preserving the historical behavior of closing the database connection at the end of each request. I want to understand what a request mean in this case? Does it mean web requests only? If yes when is the db connection opened or closed in case of async operations or in case of django_q. -
AttributeError at /users/login/ 'Form' object has no attribute 'email'
I'm creating API for login_view, but I have a problem with a Form. Im using Django-ninja so I created serializers.py and have class LoginInput(Schema): email: str password: str from django.shortcuts import get_object_or_404 from ninja import NinjaAPI, Query, Form from ninja.responses import Response from main.models import Category, City, DeliveryPoint, Product, Cart, CartItem from user.models import User from .serializers import * from typing import List from user.forms import UserLoginForm, UserRegistrationForm from user.utils import generate_jwt_token, decode_jwt_token from ninja.security import HttpBearer from django.views.decorators.csrf import csrf_exempt from django.contrib.auth import get_user_model User = get_user_model() @api.post("/login/") def login_api_view(request, login_data: LoginInput = Form(...)): if request.method == "POST": email = login_data.email password = login_data.password form = UserLoginForm(request, data={"username": email, "password": password}) print(form.errors) if form.is_valid(): user = form.get_user() if user is not None: password = form.cleaned_data["password"] if user.check_password(password): token = generate_jwt_token(user) return {"message": "User Signed In", "token": token} return Response({"message": "Invalid credentials"}, status=400) return Response({"message": "Invalid request method"}, status=405) I'm creating front-end with NextJS. when I go to api/docs I can log in, authenticate and etc, but on actual website I have a problem and cant log in. it says that Form has no attribute 'email'. class UserLoginForm(AuthenticationForm): class Meta: model = User fields = ['email', 'password'] PLEASE HELP ME … -
How do I do a Django authorization data check?
So, I wrote the code for the reg.html page. If the registration data is filled in correctly, the form is saved and the account is created. I checked everything, the data is entered into the database. The only thing left to do is to make authorization. But here's the question - how do you do a check for the correct data? To put it simply, if the user logs in and such an account actually exists, then it should be redirected to the main page. Otherwise, the site will display "There is no such account". Here is the code below. views.py: from django.shortcuts import render, redirect from django.http import HttpResponse from .form import SignUpForm, RegisterForm from .models import Registration def index(request): return render(request, 'main/index.html',) def about(request): return render(request, 'main/about.html') def register(request): if request.method == 'POST': form = RegisterForm(request.POST) if form.is_valid(): form.save(commit=False) return redirect('log') form = RegisterForm() return render(request, 'main/reg.html', { 'form': form }) def log(request): if request.method == "POST": form = SignUpForm(request.POST) if form.is_valid(): if Registration().objects.filter().exists(): return HttpResponse('Да') else: return HttpResponse('Нет') form = SignUpForm() return render(request, 'main/log.html', { 'form': form }) -
LDAPBackend authenticate return INVALID_CREDENTIALS
I have an issue when I do in login_form.py : from django_auth_ldap.backend import LDAPBackend auth = LDAPBackend() user = auth.authenticate(request, username=User_Name, password=User_Password) this does return Caught LDAPError while authenticating User_Name: INVALID_CREDENTIALS({'msgtype': 97, 'msgid': 1, 'result': 49, 'desc': 'Invalid credentials', 'ctrls': [], 'info': '80090308: LdapErr: DSID-0C090569, comment: AcceptSecurityContext error, data 52e, v4563'}) but when I do in login_form.py : import ldap con = ldap.initialize('LDAP://URL ') con.simple_bind_s('User_Name', 'User_Password') This does work as excepted. In my setting.py I have set the LDAP as follow : AUTHENTICATION_BACKENDS = [ 'django_auth_ldap.backend.LDAPBackend', 'django.contrib.auth.backends.ModelBackend', ] LDAP_IGNORE_CERT_ERRORS = True AUTH_LDAP_START_TLS = False AUTH_LDAP_SERVER_URI = "LDAP://URL" # Use the NTLM format for domain authentication AUTH_LDAP_CONNECTION_OPTIONS = { ldap.OPT_REFERRALS: 0 # You can add other options if needed } AUTH_LDAP_BIND_DN = "CN=BIND_USER,OU=AZE Users,DC=aze,DC=azerty,DC=priv" AUTH_LDAP_BIND_PASSWORD = "BIND_PASSWORD" AUTH_LDAP_USER_SEARCH = LDAPSearch("OU=AZE Users,DC=aze,DC=azerty,DC=priv",ldap.SCOPE_SUBTREE,"(sAMAccountName=%(user)s)",) What am I doing wrong ? -
Prevent a logged in user from peeping into other client's orders
class OrderDetailView(LoginRequiredMixin, DetailView): model = Order def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) context["object_list"] = self.object.selectedproduct_set.all() if context["object_list"].first(): if context["object_list"].first() != self.request.user: return {} context["grand_total"] = get_total(context["object_list"]) return context This is for an online shop. LoginRequiredMixin checks only whether a user is logged in or not. But a logged in user can view somebody else's orders. That is a busybody user can iterate through orders manually like /orders/15, /orders/16 and have a look at the contents. It is intolerable. To the best of my ability I prevented that by checking if the user is the owner of the order. But this is clumsy: we should send 403 status or something rather than just showing an empty list. Could you help me understand how to do that? -
Trouble with a contact form, sending emails using Gmail, was working great now I've added new html files to another app it's stopped working
I had my emails generating in the terminal in development and to my Gmail in production. All working very well. Once I done a bit more code which involved static sites and a modal on another app in my django project. It now doesn't work. If I roll back my project it works again. So it's something I've done, however, I haven't changed anything on my contact app. Can anyone suggest anything please https://github.com/StaceyRb89/transcribe.git I removed the custom javascript, and bootstrap javascript from the base.html hoping it could have been that, but it didn't make a difference, so the home page burger button doesn't work as well as it should. But it was to try it out. I have messed around with settings. I even copied the older commit directly to it which was exactly the same bar the two src js files, I don't know what else to do. I have searched and should probably mention I've only been coding for 5 months. Thank you -
Django SimpleUploadedFile is not being sent
I'm developing Django application and wrote a test that checks if view method acts correctly. I need to send some data in request, including the image file. In my case: def setUp(self): ... self.image_file = SimpleUploadedFile("test_image.jpg", b"file_content", content_type='image/jpeg') ... def test_save_image_instance(self): ... files = {'image': self.image_file} response = self.client.post(endpoint, data=data, files=files) # assertions there ... I double-checked, everything is correct, there is SimpleUploadedFile instance in file dictionary. But in the view request.FILES is empty (<MultiValueDict: {}>), though data was sent correctly. Also, if I look into request.META there is 'files': {'image': <SimpleUploadedFile: test_image.jpg (image/jpeg)>}, which indicates that the file should be there. Django CommonMiddleware is set correctly, type of content in the request is multipart/form-data I tried using UploadFile class instead of SimpleUploadFile, checking values in different places of the program to find the problem, but it didn't help. -
I am working on generating mail for new users. writing html code with inline css in Django. Here I have to check outlook,web,mobile&chrome screens
Here is my sample code '\ ' '\ ' Your username is : '+ toaddr +''\ ' You can set your password using below button: '\ ' '\ ' '\ ' Set Your Password →'\ ' '\ ' '\ ' '\ ' '\ But, in outlook border-radius is not working & in google mail it is not getting properly. How I can make proper for outlook & mail & mobile versions? I tried many things for border radius and View for google mail but nothing works. -
When using two databases in tests, django applies migrations to both
I have two databases: "default" and "logs". "logs" is MongoDB which is used for logging. Here are my settings: DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'project', 'HOST': 'localhost', 'PORT': 5432, 'PASSWORD': 'passwd', 'USER': 'user', }, "logs": { "NAME": "djongo", "ENGINE": "djongo", 'HOST': 'localhost', 'PORT': 27017, "USER": "user", "PASSWORD": "passwd", }, } I also wrote a router class LogsRouter: route_app_labels = {"logging_system"} def db_for_read(self, model, **hints): """ Attempts to read auth and contenttypes models go to auth_db. """ if model._meta.app_label in self.route_app_labels: return "logs" return None def db_for_write(self, model, **hints): """ Attempts to write auth and contenttypes models go to auth_db. """ if model._meta.app_label in self.route_app_labels: return "logs" return None def allow_relation(self, obj1, obj2, **hints): """ Allow relations if a model in the auth or contenttypes apps is involved. """ if ( obj1._meta.app_label in self.route_app_labels or obj2._meta.app_label in self.route_app_labels ): return True return None def allow_migrate(self, db, app_label, model_name=None, **hints): """ Make sure the auth and contenttypes apps only appear in the 'auth_db' database. """ if app_label in self.route_app_labels: return db == "logs" return None In the test I added two databases: class TestTestCase(TransactionTestCase): databases = ["default", "logs"] When starting I get the error: djongo.exceptions.SQLDecodeError: Keyword: None Sub SQL: … -
django unexpected amount of queries executed
given models.py: from django.db import models class Menu(models.Model): name = models.CharField(max_length=255) menu_url = models.CharField(max_length=255) def __str__(self): return self.name class MenuEntry(models.Model): menu = models.ForeignKey("menu", null=True, blank=True, on_delete=models.CASCADE) parent = models.ForeignKey("menuentry", null=True, blank=True, on_delete=models.CASCADE) text = models.CharField(max_length=255) def __str__(self): return self.text when execuring in another file draw_menu.py the following: from django import template from menu.models import MenuEntry from django.db import connection register = template.Library() @register.simple_tag def draw_menu_tag(menu_name): queryset = MenuEntry.objects.raw("WITH RECURSIVE \ my_menu_items \ AS( \ SELECT * FROM menu_menuentry WHERE menu_menuentry.menu_id=(SELECT id FROM \ menu_menu WHERE name=%s) \ UNION \ SELECT m.* FROM menu_menuentry m \ INNER JOIN my_menu_items r ON m.parent_id = r.id \ WHERE m.parent_id IS NOT NULL \ ) \ SELECT * FROM my_menu_items mmi INNER JOIN menu_menu mm ON mm.id = mmi.menu_id", ["menu_B"]) q = list(queryset) resulting_html = str(queryset_to_dict(q)) breakpoint() return 'resulting_html' def queryset_to_dict(queryset): out_dict = {} out_dict['menu'] = queryset[0].menu.name out_dict['menu_url'] = queryset[0].menu.menu_url num_queries = len(connection.queries) print(f"Number of queries executed: {num_queries}") return out_dict when loading the page with the tag, I get "Number of queries executed: 2". This following gives an extra query out_dict['menu'] = queryset[0].menu.name But I have joined the corresponding menu items. It should be retrieved without any extra queries. Please help, thanks a lot! -
Django: View uploaded docs/pdf files
I'm trying to fetch a file that I uploaded. But when I click the file, it returned the page where I'm in. Or if I try to download the file, it shows the html file of the page. My code is the same in uploading images, but I have no problem viewing the image. I did the same thing in uploading a file, but it didn't show the file. Here is my code: models.py class File(models.Model): id = models.AutoField(db_column='id', primary_key=True) soano = models.CharField(db_column='SoaNo', max_length=20) studentid = models.ForeignKey('Student', on_delete=models.CASCADE, db_column='studentid') file = models.FileField(db_column='file', upload_to='soa/', verbose_name="") class Meta: managed = True db_table = 'soa' views.py def file_upload(request): if request.method == 'GET': student = Student.objects.all() return render(request, 'admin/file_upload.html', {'student': student}) if request.method == 'POST': upload = Soa() randomid = ''.join(random.choices(string.digits, k=5)) upload.soano = f"{randomid}" studentid = request.POST.get('studentid') upload.studentid_id = studentid if len(request.FILES) != 0: upload.file = request.FILES['file'] upload.save() return redirect('/students/file/') file.html {% for obj in query %} <tr> <td>{{ obj.fileno }}</span></td> <td>{{ obj.student.lrn }}</span></td> <td><a href="{{ obj.file.url }}" download="{{ obj.file.url }}">{{ obj.file }}</a></td> </tr> {% endfor %} I checked the directory and the file I uploaded was there. But I just can't view it with {{ obj.file.url }}. I don't know what am … -
How to set tailwind-css or bootstrp and js file in django for offline work?
In django, is there any way to link-up bootstrap css and js file to work in offline? I find solution for link-up tailwind-css with my django project also. I create a static folder globally. I keep these files in static folder. Then I try to link-up these files by using and tags from base.html file which is located in templates folder. I also set dirs = ['templates'] in my settings.py file. But they don't work. -
Mai apna fam pay account delete krna chahta hu
Mera old number off hone wala hai isliye mai apna number change krna chahta hu Mera account delete ho jaye Please aap kaise bhi krke mere account ka number change kr deejiye nhi toh account delete kr deejiye please Mere new mobile no hai 7068527369 -
Plotting a bar graph in expense tracker app
I want a bar graph of date as x-axis and amount as y-axis. The date is as date list that can have duplicate values but is guarranted to have same len as that of amount list. for eg-date=[2014-1-4,2014-1-4,2014-1-4,2014-1-5] and amount is [100,5000,1000,2000]. The bar graph that I have created is showing duplicate dates as one and other dates as one. Can anyone have a solution? -
How to filter images by collection in Wagtail API v2
I have a Page type with a foreign key to Collections: class PageWithManyPhotos(Page): collection = models.ForeignKey("wagtailcore.Collection", ...) I would like to retrieve all images of the collection selected for a page via the API. Ideally from the pages endpoint, but from the images endpoint would do too (it'd need an extra request, first to get the collection id and then to filter images by collection) 1st approach When I add an APIField to my Page model: api_fields = [APIField("collection", serializer=CollectionSerializer())] class CollectionSerializer(ModelSerializer): images = ImageSerializer(read_only=True, many=True) class Meta: model = Collection # fields = ["id", "name", "images"] exclude = [] and make a request at /api/v2/pages/?type=base.GalleryPage&fields=collection, I get a reply but without the images: "collection": { "id": 8, "path": "000100050003", "depth": 3, "numchild": 0, "name": "Collection 1" } I cannot get the reverse relationship. Perhaps because Collection is an MP_Node and not a models.Model? 2nd approach I also tried the second aproach, to add a custom viewset in the /api/v2/images/?collection=<collection_id> endpoint and filter images by collection in the images endpoint. The collection field is not in the default fields . I tried to add it doing something like: class CollectionField(Field): def get_attribute(self, instance): return instance def to_representation(self, image): return image.collection_id … -
Update Increment If Value is Equal Django
I'm trying to create a versioning system in django. I want separate versioning per asset name. I've been able to setup a custom increment tool but I can't quite work out how to check what I'm currently trying to create against what's already there. This is the code I currently have: def next_version(): latest = Asset.objects.order_by("version").last() if not latest: return 1 return latest.version + 1 class Asset(models.Model): path = models.CharField(max_length=255, unique=True, primary_key=True) name = models.CharField(max_length=255) version = models.IntegerField(default=next_version) asset_type = models.CharField(max_length=255) created_at = models.DateTimeField(auto_now_add=True) created_by = models.CharField(max_length=255) dependencies = models.JSONField(null=True) def __str__(self): return self.name But the problem I'm having is that the next_version function can't read the name of the asset I'm currently trying to create (or at least I think it can't). So the goal I'm trying to achieve is for the created asset to check the name it's trying to set and if it already exists to bump up the version. Can anyone tell if this is possible? Thanks, Mitchell -
i created a template file but it dosen't work.what can i do?
I created a template file but when go to that file and create a .html file, my file shows a dj icon by the file name and html snippet does not work in that file. it's picture of my app and my template in vscodeWhat can i do? I created a template file but it does not work. What can i do? -
pytest-django test collection behavior is inconsistent
I have a Django project that is set up with pytest-django and everything seemed to be running just fine. However, I recently added tests to a test file and noticed that they weren't being picked up by the pytest command. Here are a few of the things I've tried: Adding @pytest.mark.django_db to the new tests causes them to be correctly collected, but this decorator should only be used when database access is needed, and these tests don't need database access. Moving the unmarked tests so they come after the marked test in the same file causes the 3 unmarked tests to be picked up by the test runner, but now the marked test fails to be collected. Running pytest on that specific file causes all tests to be collected (and pass) with or without the decorators on the tests that don't need them. I've been unable to identify anything wrong with my pytest configuration, though I did note that we're also using the Coverage tool with it to measure code coverage of the tests. The pytest.ini file is very simple: [pytest] env_files = .env addopts = --cov . --cov-report html --cov-report xml --cov-config "coverage/.coveragerc" --disable-warnings DJANGO_SETTINGS_MODULE = config.settings.test I've also … -
raw postgresql query in django
Please help me with raw postgresql query: given models.py: from django.db import models class Menu(models.Model): name = models.CharField(max_length=255) menu_url = models.CharField(max_length=255) def __str__(self): return self.name class MenuEntry(models.Model): menu = models.ForeignKey("menu", null=True, blank=True, on_delete=models.CASCADE) parent = models.ForeignKey("menuentry", null=True, blank=True, on_delete=models.CASCADE) text = models.CharField(max_length=255) def __str__(self): return self.text I am trying to retrieve a menu item with related tree of menuentries, in another file: queryset = MenuEntry.objects.raw("WITH RECURSIVE \ my_2ndmenu_items (id, parent, text) \ AS( \ SELECT * FROM menu_menuentry WHERE menu_menuentry.menu_id=(SELECT id FROM menu_menu WHERE name=%s) \ UNION \ SELECT m.* FROM menu_menuentry m \ INNER JOIN my_2ndmenu_items r ON m.parent_id = r.id \ WHERE m.parent_id IS NOT NULL \ ) \ SELECT * FROM my_2ndmenu_items", ["menu_B"]) But I'm getting the following error, trying to get queryset[0]: *** ValueError: Cannot assign "'menu_B_1lvl_entry'": "MenuEntry.parent" must be a "MenuEntry" instance. Thanks a lot for your help! -
“/workspaces/studydjango/studydjango/api/rota” does not exist
Erro no redirecionamento: api/url.py api/view.py studydjando/url.py Quando acesso a api getMessage funciona normal: enter image description here Porém quando tento acessar a api getRoutes retorna que a pagina não existe: enter image description here alguém sabe o que pode ser?