Category "django"

How to change the `frontend_domain` port in `GRAPHQL_AUTH` in the verification mail?

I'm working on a Docker-Django-Graphene-React stack where Django is the backend which receive GraphQL queries through Graphene from React which acts as the fron

Django - Is there any way to get the current logged user in the signals.py file of my proyect?

I am trying to create an instance of a relationship model(intermédiate table many-to-many) automatically with signals when one of the independent models

Can OR-clauses be combined with distance filters in Haystack for Django?

I've been using a distance filter using regular django query filters within an OR-clause: # either it's within the preset distance of the location # OR it's not

Connecting to MSSQL from django 1.8 on Ubuntu

I need to connect to MSSQL database from Django 1.8 and preserve Django 1.8 (not upgrade to newer version od Django). I installed pip install django-mssql . ENG

Django Dependent/Chained Dropdown List in a filter

I am using Django to implement my web page; in this page I have a classic item list that I manage with a for loop. I also implement a filter as a form (with sea

API takes longer to load first time opening my webpage

I have a Django app configured on AWS Lambda with zappa. In this app I created some basic APIs with DRF. On the otherside I have a ReactJS frontend that makes

Create Dynamically table and save data in database on django

if i'm Create Dynamically table using jquery this is working This is my .html file code. <!DOCTYPE html> <html> <head> <title>test

Django: Getting the page an object is on

Let's say I have a class Foo. I want to know what page a particular instance of Foo will be on: eg: api.myapp.com/foos/?page=25. Given an object: Foo.objects.ge

How to use django-jalali calendar in tempates?

Im new to Django and im trying to use django in a Persian app, therefore I need users pick i a date(jalali date) and send it to server. I've used django-jalali

How to fill and access a Django ArrayField?

To solve my (kinda specific) problem, I found that I have to use Django ArrayField: https://docs.djangoproject.com/en/2.1/ref/contrib/postgres/fields/#arrayfiel

Django Decimal field with value Decimal(0.00) is displayed as 0E-10 in the Django Admin Inline

Django 2.2. Model Definition. class BlockPeriod(BaseModel): price = models.DecimalField(max_digits=20, decimal_places=10) margin = models.DecimalField(m

Django Dependent/Chained Dropdown List in a filter

I am using Django to implement my web page; in this page I have a classic item list that I manage with a for loop. I also implement a filter as a form (with sea

How to find static files using regex in django in view?

I have django project that has a staticfile with the structure staticfiles/bundles/static/js/main.[hash of 8 random characters].js I want to get the name of mai

How to extract Data from Django Queryset

How to retrieve the data from Django queryset for use in a variable When an output is received in below form after running the query <QuerySet [{'name': 'J

Using annotate and distinct(field) together in Django

I've got a bunch of reviews in my app. Users are able to "like" reviews. I'm trying to get the most liked reviews. However, there are some popular users on the

How to fix " TypeError: post_details() got an unexpected keyword argument 'slug' "

I'm creating my blog with django, and trying to make posts urls in slug way, after I created the models and called it in views it showed me this error: [TypeErr

Need to do POST method for the Nested serializers using django

models.py class Organisation(models.Model): """ Organisation model """ org_id = models.AutoField(unique=True, primary_key=True) org_name = m

Django channels rest framework don't return data of subscription in production environment (gunicorn/daphne/nginx)

Hi everyone I deployed django with channels via daphne for websocket and gunicorn for normal request http with reverse proxy nginx, I have a problem that has no

how to change folder location to save file - DJANGO FileSystemStorage

so i want when i upload a file, the file will go to media/mp3 not media/txt. how to change save file location? views.py: def homepage(request): if request.m

How render django-table when click on TamplateColumn delete button?

I try build user table with delete option I use django table2 to view the list and when I click on delete button and delete user I want to render only the tab