Category "django"

Getting TypeError: __init__() missing 1 required positional argument: 'on_delete' when trying to add parent table after child table with entries

I have two classes in my sqlite database, a parent table named Categorie and the child table called Article. I created first the child table class and addes ent

wsgi error: Address already in use - socketio/django/apache2

My project is created with React (create-react-app), React router (no webpack), -- Django (rest) and Socketio with eventlet on the backend. I have 3 problems wi

I'm try to deploy my django project in Heroku by use Heroku CLI I face installation error

Everything goes right till I run this command: git push heroku master I get this massages: git push heroku master Enumerating objects: 55, done. Counting objec

[Django][AWS S3] botocore.exceptions.clienterror an error occurred (accessdenied) when calling the PutObject operation

I am trying to connect Django project to AWS S3. settings.py contains below: AWS_ACCESS_KEY_ID = #ID AWS_SECRET_ACCESS_KEY = #Key AWS_STORAGE_BUCKET_NAME = #B

django-filter checkbox ajax

I am trying to implement django-filters + ajax(jquery) after sending the request, the selected checkboxes "disappear" I have little experience yet, tell me how

Why can't pytest-django find manage.py?

I have a project structure like this: setup.cfg integration_tests/ |----tests.py src/ |----manage.py |----my_django_app/ And a setup.cfg with this: [t

Not able to migrate changes to mysql database from Django

I have added foreign keys to some of the models in a Django application but the changes are not being reflected in the MySQL database even after migrating them.

Pyinstaller doesn't include django rest framework templates

I have a django app that uses rest_framework, and everything works perfectly, I am using pyinstaller to get an exe for this app, the executable app works fine,

Django: ProtectedError exception handling is not working

I am trying to handle ProtectedError exception and try to post a custom error message in my template. def delete(self, request, *args, **kwargs): obj = sel

Django STATIC FILES not loading in actual Production

I have tried many things to solve this like adding whitenoise middleware, also added STATICFILES_DIRS = [], added mimetypes for css in settings.py file CSS/JS W

How to create a pathlib relative path with a dot starting point?

I needed to create a relative path starting with the current directory as a "." dot For example, in windows ".\envs\.some.env" or "./envs/.some.env" elsewhere I

How to remove this error 'No application configured for scope type 'websocket''

I am trying to build a chat app with Django but when I try to run it I get this error No application configured for scope type 'websocket' my routing.py fil

Is it possible to use/test a value of Django's BooleanField without a model?

I'm trying to make a workflow where the user enters data on one page, then has to check the data and tick a tickbox to accept the T&C's. So the code has to

django_celery_beat - "no such table: main.django_celery_beat_solarschedule__old" while updating "django_celery_beat_periodictask"

I'm using django + celery, when running django devserver I'm getting exception django.db.utils.OperationalError: no such table: main.django_celery_beat_solars

Forbidden (CSRF token missing or incorrect.): /

So i want to make models form to upload file mp3. I was copy the code from website, but suddenly it goes error. Here's error message on the website : Forbidden

How to test a Django on_commit hook without clearing the database?

The on_commit function has been added to Django 1.9 to be able to trigger an action (e.g. a Celery task) after the current transaction has committed. They ment

How to consume TokenAuthentication based user authentication built in DRF in Django web application

I have created a WebAPI for user authentication using Token Authentication built on Django Rest Framework. with the help of Postman I am able to determine that

Reopening a closed django InMemoryFileUpload using class based views

I have a Django project which involves a user uploading a CSV file via a form. I parse this file in the forms clean method, and then in the views form_valid met

Django: How to make json data readable in django?

i am trying to retrieve the lastest news from hackernews api, everthing seems to be working fine and when i print the status code, i get Status Code:200. Now i

Django: how save bytes object to models.FileField?

My web application has the following structure: backend with Django frontend with React. I have a form with React. I send a file from client form and I receive