Category "django"

csrf cookie not set on linux

I know this question is quite popular, before asking it, I researched all the previous questions and their answers, but never found a solution for myself. My pr

Visual Studio Code: Intellisense not working

My Visual Studio Code's Intellisense is not working properly. Every time I try to use it with Ctrl + Shift, it only displays a loading message. I'm using Python

pytest-django could not find a Django project

Trying to configure pytest with django, the project already has a lot of test not written with pytest (written with unittest) but I am trying to get them run wi

Understanding ManyToMany fields in Django with a through model

I'm having trouble understanding the use of ManyToMany models fields with a through model. I can easily achieve the same without the ManyToMany field. Consideri

zipfile write dont find files in gcloud

Im trying zip a few files from Google Storage. The zipfile of Python doesnt find the files in gcloud, just in the project. How can I do for my code find the f

Django ORM: get the monthly average of price for each category

Imagine this simple model: class Expense(models.Model): price = models.DecimalField(decimal_places=2, max_digits=6) description = models.CharField(max_len

Django: Error: You don't have permission to access that port

I'm very new to this whole setup so please be nice. On dev the command usually works with no errors but since I have been experimenting with different commands

nothing happens when submitting django form

I have a problem with django forms, when submitting a form nothing seems to happen, even the server didn't get any response except GET request to view the form

django urls: "Django tried these URL patterns"

I am trying a tutorial on Django called blog. I have the following structure: FirstBlog|FirstBlog settings urls __init__ etc blog templates | index.html migra

Check if the response of a get api is a proto object

I fetch a proto object from an api , is there anyway I can validate that the response is a proto object. One thing which I did was check content-type as mentio

filter in ascending order in Python/django

I am trying to run a filter in Python/django. All the data is coming from DB. This query currently works but I want to able show it in ascending order of Name f

runserver can't serve media if MEDIA_URL is within STATIC_URL

My config is as follows: STATIC_URL = '/static/' MEDIA_URL = '/static/media/' And since I upgraded django 2.1 to 2.2 I get: "runserver can't serve media if

django to snowflake connection and running ORM queries

I am looking to shift out of Postgres to SnowFlake as some of my features require run time analysis which is faster in Snowflake. I could only get the Python c

Django retrieve sessionID created with Login

I am using Django 1.9. Base on the Django documentation: " To log a user in, from a view, use login(). It takes an HttpRequest object and a User object. login()

Enable post of HTML form to Django database backend

I'm trying to write the code to enable form data to be sent to the backend database. The form is just a few fields, name, website, and portfolio address created

Problem while using mypy with my django project

I have implemented mypy in my django rest framework but I am getting errors ModuleNotFoundError: No module named 'config' while running mypy.Is there any wrong

Endpoints sharing part of an URL

I'm currently building an API with Django Rest Framework and I want to have two viewsets. One related to my User model, and one single route to verify a User em

Connect Django with Azure PostgreSQL using managed identity in azure

How can I configure Azure PostgreSQL database in Django settings.py using Managed Identity in Azure?

Google Cloud Storage doesn't upload to the correct media and static directory in the bucket

I have created an app in Django and want to use Google Cloud Storage to keep my statics and media files. However, when running python manage.py collectstatic It

Is there a way to know if the user is on a particular heading, paragraph or a div etc

I was trying to find a way to start an animation only if the user is on it, at first I tried getting screen size, and its works, but its not an optimal solution