Category "django"

How do I display a Django form correctly using ListView

I am writing a simple app to track sales leads based on the Django tutorial "Writing your first Django app" (https://docs.djangoproject.com/en/4.0/intro/tutoria

How to include Bearer Token in Header using Django Rest Framework?

I'm using rest_framework_simplejwt package for JWT authentication in Django. I created some APIs for login, reg, token_verify, referesh_token and student_data.

Understanding pytest-django test arguments

What are 'rf' and 'user_context' parameters and when are they assigned? import pytest from rest_framework import status from rest_framework.reverse import rever

DRF how to update, create OneToOneField in serializers?

I have two models, with OnetoOne field. How can I update/create them with help of serializers? class Page(models.Model): info = models.TextField(null=True, bla

Django customUser models

I have faced two or three issues with django customuser model. The first one being the skills models. I wanted to add the Skills in the custom user, realized th

Two HTML Forms in one DJango views

I have two simple HTML forms on one page. I want to create Django view to submit multiple Django forms. I can submit form1 but I have no clue how to submit form

Rotate native iPhone images based on EXIF info?

Working on a site where users can upload photos. As many of you many know, unedited iPhone photos use an "Orientation" EXIF tag to determine orientation. On my

from django.core.management import execute_from_command_line not working

I am working on a bug project. Which is on Python 2.7, we are migrating to Python 3.9. I am getting import errors in manage.py during importfrom django.core.man

Django use urls with same ending

I ahve a django project with the application web-api and the following url configuration: main project urls.py urlpatterns = [ path('admin/', admin.site.url

I need to split array to sub arrays of similar values in python

lets suppose i have this queryset_array: queryset_array = [{"category":"a"},{"category":"a"},{"category:"b"},{"category":"b"},{"category":"c"},{"category":"c"}]

Issue migrating on m1 mac: geos incompatible architecture

I have run through a setup and I'm having issues migrating my app (within my venv). When I run python manage.py migrate I recevie this error: OSError: dlo

React - Module parse failed: You may need an appropriate loader to handle this file type 6:15

Help me with this error: NPM run error my webpack setting: module.export = { module: { rules: [ { test: /\.js$|\.jsx/, exclu

How do I upload a webcam image using JavaScript ajax to a Django site?

I am creating a livestreaming site using Django and I need to upload an image using an ajax post request to a model form on the django site. I am working with t

How do I integrate Ajax with Django applications?

I am new to Django and pretty new to Ajax. I am working on a project where I need to integrate the two. I believe that I understand the principles behind them b

How to aggregate one column of django table based on another column

I have a table like below: id | type | code ------------------------------------- 0. 5 2 1 6 6 2 8

how to install channels redis in django using pip without errors

I am trying to install channels redis module using pip but so far am still getting errors. I installed Microsoft c++ build tools as the error suggested but so f

Django hot reload only working on certain files

I have this weird issue where not all file edits are being picked up by the hot reloader for Django. I have this structure: / app/ ... apps in here. config/

Django Stripping Blanks In Between Words When Generating Blanks

I am working on a Hangman game using Django and I'm having some trouble generating the blanks from the words if the answer is two words, such as a first and las

Rich text editor for Django with comments/annotation (open source)

Is there anyone succeeded integrating any rich text editor through Django along with inline comments option? I refer inline comment as highlighting a word or se

Forbidden (403) CSRF verification failed. Request aborted. Reason given for failure: Origin checking failed does not match any trusted origins

Help Reason given for failure: Origin checking failed - https://praktikum6.jhoncena.repl.co does not match any trusted origins. In general, this can occur when