I have the following problem, which has been difficult for me to find documentation on function-based views to document them with drf_spectacular since all this is found for class-based views I have tried different ways to document the requestBody in …
Given a list of arbitrary Django models, how can you use the Django ORM to generate the JOIN statements for an SQL query? This of course will only work if the relationships are defined in the model and there is …
I already created an animation in dom for the login and registration but the only thing I need is to validate the registration and I already have the registration with django but I need it to show me the error …
CRUD operations are working just fine when I check the admins site. All of the new created items, updated or deleted are shown in the admins site, but in order to make the data appear in the website I have …
Hi I finished making my contact form but it doesn't let me send email, I'm using mailtrap as a test server but I get an error. I'm using Django 5.0 and Python 3.10 Settings.py # Email config EMAIL_HOST = 'sandbox.smtp.mailtrap.io' …
I am building a game tracker. I would like to have it where if the user selects anything other than 'Win' then the wincon field of the form is unchangeable or set to a default field. This is to make …
I need to run next some years Django on IIS (don't ask why :-). I found two ways https://learn.microsoft.com/en-us/visualstudio/python/configure-web-apps-for-iis-windows?view=vs-2022 1. httpPlatform + runserver wsgi.multithread:True wsgi.multiprocess:False The solution is multithreaded, working almost well, low resources, good performance. 2*5 …
I am using Django Rest Framework and Grappelli in my Django project. I need to add a cookie consent notice. Is it possible to customize both to show the notice? Do I need to create a new template?
I'm encountering an issue with Django where form submission is not redirecting to the success page as expected and the data input its not happening . Here's a breakdown of the problem: I have a Django application where users can …
Have a question on using docker-compose when entering into debug mode by manually setting breakpoint(). This is my service and it has a /health which calls almost every 5s, and it prints out 200 status code to stdout. However, when …
So this is my views.py when I use atrakcjatest my images work, but when I try to use the filtered atrakcja(atrakcje_list) it doesnt work and only images dont work, the rest of variables are ok def map_view(request, trasa_id): trasa = …
I want to deploy my django project which is face recognition for online transaction on render but it show ERROR: Could not build wheels for dlib, which is required to install pyproject.toml-based projects how could i resolve this ? i …
In my Django app with Graphene for GraphQL, how do I intercept the Graphene GraphQL messages so I can sanitize the content? I tried creating a custom graphql view and a custom_execute function and using that in the urlpatterns endpoint …
I'm facing a strange issue with Django. I have set up a simple form in a template that submits to a view, but I'm not getting the expected 404 response. Instead, I'm being redirected to the URL http://localhost:8000/clear/ without seeing …
I'm having trouble uploading my Django web app to Heroku due to the Slug Size limit. My web app includes an AI API that requires a torch dependency. This is the error: Compressing... remote: ! Compiled slug size: 700M …
I've a certain code that updates bulk rows: from simple_history.utils import bulk_update_with_history from django.utils.timezone import now bulk_update_list = [] for chart in updated_chart_records: chart.coder_assignment_sequence = count chart.queue_id = work_queue_pk chart.level_id = role_id updated_num = bulk_update_with_history(bulk_update_list, Chart, ["coder_assignment_sequence", "l1_auditor_assignment_sequence", "l2_auditor_assignment_sequence", "l3_auditor_assignment_sequence","queue_id", …
I have a project with the following urls.py. urlpatterns = [ path('category*/', include('student.urls')) // * could be replaced by a number ] In that project I then have an application student whose urls.py looks like this: <pre …
I am trying to get the user's login and password from the HTML template (from ) and use these inputs for processing. I want to use the inputs from the HTML template and not the usual Django forms, like: <label …
I have following django models : class ModelA(models.Model) : # fld1, fld2 class ModelB(models.Model) : fld_a1 = models.ForeignKey(ModelA, related_name='modela_1') fld_a2 = models.ForeignKey(ModelA, related_name='modela_2') # other fields Now when I delete resource from ModelB, how to make sure that the …
I have a Django application that has large I/O-bound tasks. I use Celery to run these tasks in threads and manage the progress in the UI with a progress bar. Here's my configuration : Django version : 5.0.2 Celery version …
I building a multitenants project using django-tenant and django-tenant-user but I am facing a weird issue where the CSRF TOKEN and email fields of my login form are being overwritten with the password data after a failed login attempt. Please …
I have made a REST API using Django, and I have issues with retrieving a user's information by inserting a token. I am using the User model. So here is the view: class getUserInfoView(APIView): #generics.RetrieveAPIView #authentication_classes = [authentication.TokenAuthentication] …
I want to show some information on the admin index.html, but I do not want to use context processors for this, but have my own view. So I tried like described in the docs and discussed <a …
I used uwsgi to start my project, and then I logged it in my uwsgi configuration, and then I logged it in my django project setup file, but I found out today that my django log only logged this morning …
Is there a way to add a record to me DB BEFORE sending off a response? I just learned about Django Signals so I assume that might be a candidate. The reason why I'm asking this is because of an …
I am using rest_framework_simple_api_key in my production application on python version 3.9 . On running command python generate_fernet_keymanage.py as given in doc(djangorestframework-simple-apikey) i am getting File "C:\Users\DELL\anaconda3\lib\site-packages\rest_framework_simple_api_key\models.py", line 15, in <module> class AbstractAPIKeyManager(models.Manager): File "C:\Users\DELL\anaconda3\lib\site-packages\rest_framework_simple_api_key\models.py", line 16, …
I got above error while running the makemiragtions command. So I delete/renamed the existing migration folder and rerun the makemirations command it's is migrated but when I run the migrate I got same error i.e., TypeError: 'class Meta' got invalid …
I'm building a To Do list in Django by following a tutorial, I'm trying to make seperate CSS file instead of directly writing it within HTML file, However i'm recieving 404 error. Below is directory structure ├─ base/ │ …
I am trying to store an instance of an Item model as a field in my users model using ForeignKey like so: class UserProfile(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) username = models.CharField(max_length=255) items = models.ForeignKey('Item', on_delete=models.CASCADE) def __str__(self): return …
Class BlockDirectAPIAccessMiddleware: def __init__(self, get_response): self.get_response = get_response def __call__(self, request): protected_paths = ['/api/socialinfo', '/api/crypto-data'] if any(request.path.startswith(path) for path in protected_paths): googlebot_user_agents = [ "Googlebot", "Googlebot-Image", "Googlebot-News", "Googlebot-Video", "Storebot-Google", "Google-InspectionTool", "GoogleOther", "Google-Extended" ] # Check for Googlebot (allow access) user_agent …
My Django project will not migrate the changes I have made to the settings.py I get this error (1045, "Access denied for user 'root'@'localhost' (using password: NO)") I installed and setup a MySQL created a database connected all the information …
I'm using JQUERY and Magnific Popup in a django project. When I clicked on any image in the gallery, it always popup the first image instead of the one selected. This is my current code: Here is the django template …
I'm using DjangoRestChannels (based on Django Channels). I made a simple comments page. When new Comment added by any User instance consumer sends in to JS and renders on HTML. Everything works exceps when User instance gets deleted I'm getting …
While trying to upload my Django application I got these errors requirements.txt error: subprocess-exited-with-error × Getting requirements to build wheel did not run successfully Error: Command failed: pip3.12 install --disable-pip-version-check --target . --upgrade -r /vercel/path0/requirements.txt error: subprocess-exited-with-error how do …
I am learning django and couldn't find an answer on this. I am receiving data a query in denormalized form. Here is how it looks like. Store_id Shelf_id Product_id Qty store1 …
I'm trying to get postgres 14 (upgrading from 11) to work locally. Initially the docker file looked like: db: image: postgres-14.11 environment: volumes: healthcheck: test: timeout: 20s retries: …
I have a problem. When clicking on the link http://127.0.0.1:8000/accounts/register / returns the KeyError error at /accounts/register/ 'email'. I program in django in pycharm this is code: registration/urls.py: from django.contrib.auth import views as auth_views from django.urls import …
I have a Django project running on Kubernetes with Redis, Postgres, Celery, Flower, and Nginx. I deploy it using Minikube and Kubectl on my localhost. Everything looks fine; the pod logs appear good, but when I'm trying to tunnel the …
I´m trying to a picture to website with help of Django 5 and static files, the website its self is working with no error is diplayed in Django 5 but image is not displayed Has tried to read the documentation …
Firstly hypertable needs all PK contains partition column, in this case time, and in the other hand Django does not allow create multi column PK so you can't create a PK that could contains the time column. Second: if I …