Category "django"

How can I add ordering for ManyToMany field?

I have two models: CustomUser and AgreementReglament At this moment relation between the models looks like this: class AgreementReglament(models.Model): nam

I display a table with ajax in real time and I check some lines which I return in my views

I have this problem in summary: when i fill my input automatically i display an array using ajax , and on the same table I shock a few lines and when I send bac

Django heroku push gives could not build wheels for backports.zoneinfo error

I am trying to push a django project to heroku. heroku create worked fine but when trying to push to heroku main I get the following error. ''' Enumerating obje

Adding markdown highlighted fenced block to django app with markdonx

I have been looking through the documentation but I can’t seem to get this to work. I wish to publish posts from a “creation page”. I want to

Pytesseract - using .traineddata file on hosted server (Heroku)

I have a Vue, Django integrated project. I hosted the Vue project on Netlify and the Django project on Heroku. A python script (integrated into Heroku) is calle

Django form with dropdown list using Database returns empty fields

I'm discovering Django and I'm trying to develop a simple application. I have three tables in my database : One big table to report all the information to users

Django and Axios Forbidden (CSRF token missing or incorrect.)

I am having issue with my django server when trying to connect it to axios. It should be a simple fix but I am stuck! I am getting this error from my django ser

in Django : Why nothing happens when I try to Create new note with the html form in the notes.html page

I've just started my first app with Django by following a video on YouTube. The app is a students dashboard with 8 tools and features to help the student to mak

django.core.exceptions.ImproperlyConfigured error

Here is the error message: django.core.exceptions.ImproperlyConfigured: The included URLconf '<module 'basicsiteApp' from '/Users/msa/trydjango/basicsite/ba

Cann't install django with error 'Non-zero exit code (2)'

When i create new django project in pycharm i have error enter image description here Help me please

Django cache real-time data with DRF filtering and sorting

I'm building a web app to manage a fleet of moving vehicles. Each vehicle has a set of fixed data (like their license plate), and another set of data that gets

FieldError at /teacher/8/. Cannot resolve keyword 'teacher' into field. Choices are: classroom, faculty, faculty_id, id, name

I reach the error in my django project when I was trying to display my view. The problem seems like related to the Course model but i honestly dont know where t

drf_yasg.generators: path component of api base URL http://localhost:8080/ is ignored; use FORCE_SCRIPT_NAME instead

I am using swagger (drf_yasg.generators) with Django and I get the following error message Error message is drf_yasg.generators: path component of api base UR

Django Rest-Framework search-fields wont work inside @action

I'm trying to use the search field offered by DRF inside of an action, but it seems to not work. I had a similar problem paginating inside of the action but fou

Django `LookupError: App 'accounts' doesn't have a 'User' model` causes AUTH_USER_MODEL fails with `accounts.User` has not been installed

I am trying to refactor an existing code base by creating new accounts app with new custom User model. When I try to do makemigrations, I get the following erro

Django form_valid method

In my form's view I wonder what if I don't add product_form.save method in the code below and what if I add that: def form_valid(self, form): product_fo

Django form_valid method

In my form's view I wonder what if I don't add product_form.save method in the code below and what if I add that: def form_valid(self, form): product_fo

django_elasticsearch_dsl -RequestError(400, 'search_phase_execution_exception', 'failed to create query: For input string: )

I am trying to search with Elasticsearch using django_elasticsearch_dsl and 'django_elasticsearch_dsl_drf',, but I get RequestError(400, 'search_phase_execution

Django / Create HTMl file from a form

In my Models.py class Scenes(models.Model): name = models.SlugField('Scene name', max_length=60,unique=True) description = models.TextField(blank=True)

Stuck in urls.py while migrating a website from Python 2 to Python 3

urlpatterns = format_suffix_patterns(urlpatterns, allowed=['json', 'html']) While running manage.py makemigrations, got this error and was stuck in this error