Category "django"

Running django with ASGI?

I have a django app I using this [docker] (https://github.com/tiangolo/uvicorn-gunicorn-docker) for production deployment when I run the app using: gunicorn --l

How to upload multiple files in Django using Dropzone js?

Info: I want to upload multiple files using Dropzone js in Django project. I have two models. One for the Post and the other would be for the File. My files mod

Django media file not found

Media file is not getting. The fields related to User model are working(eg. object.username, object.email) but field with ProfileImage is not working. urls.py

Pycharm underlines absolute import, but it works fine

I have path server->api(folder), manage.py. Pycharm underlines my absolute import from api.views import create_user but it works! If i type like from server.

Why does Django raise "KeyError"?

I am currently trying to implement pagination to my Django web app. However, when I try to use template tags from the library, Django raises a key error. To be

Django+Vue:static file not found

When I use Django+Vue to build a web appliction, It occoured that the staic files always not found though I had placed all the files correctly. the logs from se

What's the point of Django's collectstatic?

In Django, the convention is to put all of your static files (i.e css, js) specific to your app into a folder called static. So the structure would look like th

Django - no such table exception

In Django, I've added some models into models.py. After manage.py makemigrations, manage.py migrate raised this exception: django.db.utils.OperationalError: no

Django model fields not appearing in admin

I have a relatively simple model in my Django project (I should note that the wording is weird in that the app itself is called 'games' and within it the model

Django custom model Interger extrafield not saving in the database return None instead

my models class UserManager(BaseUserManager): def create_user(self, email, password=None, **extra_fields): print(phone_number, 'phone_number')

Django: Non-primary Foreign Key object can't access related model instance

I'm new in Django. I have 2 class tech_system adn equiptment in models.py class tech_system(models.Model): id_tech_system = models.BigAutoField(db_column='I

How to Fix "django channels", Failed to build cryptography?

I try to install Django channels and I get this error how to fix it? =============================DEBUG ASSISTANCE============================= If you are s

How to get all objects referenced as ForeignKey from given field in a module in django

I have two classes: Author and Book. I want class Authors to have an attribute that contains all books written by the said author, as referenced to as foreign k

Django cannot find my media folder while debug = False

I have a django project that works very well and shows all media files uploaded from the admin when debug = True but immediately i turn change to debug = False

RexProScriptException transaction is not open in Django with Titan (graph DB)

I am stuck with my TitanDB, Django1.8 and Mogwai0.7.7 package. I have Graph database titan/cassandra on localhost dev machine, and after creating wrong queries

Django superuser doesn't have permission to delete models

I am working on upgrading a Django website from Django 1.8 to Django 2.2 and have come across a problem when trying to delete an object from the Django admin ch

How to manually customize parameters of DRF views using drf-yasg Swagger?

I am using drf-yasg package to integrate Swagger with DRF. As documentation said I used @swagger_auto_schema decorator to manually customize auto-generated endp

Displaying child records based on parent id from URL

I have one model Dataset and another one called DatasetReview, where DatasetReview has a foreign key connection to Dataset. I would like to display all of the D

Django ModuleNotFoundError

I can't make a simple Django project work at all. I get the same error as listed in this question which I found: Python/Django =- ModuleNotFoundError: No modul

How to Crop Images in a Django Application *JavaScript Issue*

I am having issues with my JavaScript code, and I am trying to get the image crop (picture) below to pop up but when I click the Choose File button but nothing