Maxim
charan
I want to learn python and I know max important concepts in python now what do I need to learn do I need to learn a framework if yes what do I need to choose flask or django or fast api
Charly
Doragonsureiyā
Any django book
Looking for Django tutorials? you can follow these three recommended ones:
* Official documentation and tutorial
* Tutorial from MDN
* Tutorial from django-girls
you7
How to upload more than one file for a single object ??
inactive
How to upload more than one file for a single object ??
creating separate table(model) with many-to-one relation(ForeignKey) for storing images and related objects, if you’re talking about the form layer then:
https://docs.djangoproject.com/en/5.1/topics/http/file-uploads/
or
https://docs.djangoproject.com/en/5.1/topics/forms/formsets/
@SamahTech
Hi, how can i store files using FileField(upload_to= ) to the ftp server
B
Anyone tried mjml in django for email?
Saturn
Hi I want to start reading Django.. Any suggestions for me
Ako
Hi everyone,
I'm working with drf-spectacular for generating Swagger docs in my Django project, and I was wondering if there's a built-in feature to keep track of the last opened endpoint in the URL. In some other Swagger implementations, the address bar updates automatically when you open a new endpoint.
Does drf-spectacular support this out of the box, or would I need to implement a custom solution to achieve it?
Thanks a lot!.
Number one
Ridiculous problem😂 index.html page
with page
Cart_summary.html
Header
Is it one?
It doesn't matter whether Index .html was there or not
Now only program to
Cart_summary.html
It is related
Tech
Hello everyone please has anyone worked with playwright here?
Kishu
you7
.
addresses = (
Address.objects.filter(category__id=category, long__isnull=False)
.annotate(
position=Point(F("long"), F("lat"), srid=4326),
distance=Distance("position", user_location),
)
.order_by("distance")
)
{
"error": "Invalid parameters given for Point initialization."
}
how to fix t
Narendra
can any help me hosting a asgi application in any of the server
奈姆
Vinay
share your Django settings.py STATIC_ROOT and STATIC_URL values.
BASE_DIR = Path(file). resolve().parent.parent
STATIC_URL = "static/"
STATIC_ROOT = BASE_DIR / 'static'
So I tried HttpResponse, FileResponse, HttpResponseRedirect from django.http and
sendfile module
But I am getting same issue for all
"The requested resource not found in the server"
奈姆
vch.py
hello! why did when i configure a custom jwt authentication it worked properly but when i started use drf simple-jwt i got the error about invalid token? sensitive data are the same
Vinay
Vinay
Yes, from static folder css,js and icons all are loading
Aza
Hi, Сan anyone help me, the template takes 10 seconds to load, it has 12 thousand rows in the table. When I look at the page size in the browser I get 1 gigabyte although if I save it the template size is much smaller which could be the problem?
clouded
clouded
Shaikh Ahmad Raza
clouded
Use react for frontend
Just using JavaScript to render a table of 12k rows might not do the trick of improving rendering performance.
clouded
奈姆
Shaikh Ahmad Raza
Shaikh Ahmad Raza
Shaikh Ahmad Raza
clouded
Hunny
Implementing Localization in DRF.
In an ongoing development project of DRF, I have to support the translation for multiple languages.
My question is how should I do it.
Like upgrading existing APIs with the translated response (need to alter the viwesets and serializers).
Having a separate translation APIs.
The data which is added from the CMS is how it's translation to be done, cause from the CMS the translation can be updated as well and storing so much of the data for each language in the DB doesn't sound good to me.
I know how the translation works with django and the Rosetta as well for the updatable interface.
My question is how should I approach it for the entire project.
Please guide me, if you can it would be very helpful.
Thanks.
Nikita
Hi!I have question about Django templates, someone use them or not?Just as far as I know at the moment most of the sites are written with a separate frontend and a separate backend, so I do not know if there is a sense to go deep into the templates.
Shaikh Ahmad Raza
Rkh
Hi, I have a doubt. I'm trying to deploy my django project on AWS. I tried adding the csfr trusted origin yet I am still getting error
Rkh
Can anyone help me figuring out what the issue is
Rkh
I can't use the elastic IP address yet and I have a public ip address assigned nor can I excempt the csfr token.
mea
Charly
Rkh
Forbidden (403)
CSRF verification failed. Request aborted.
You are seeing this message because this site requires a CSRF cookie when submitting forms. This cookie is required for security reasons, to ensure that your browser is not being hijacked by third parties.
If you have configured your browser to disable cookies, please re-enable them, at least for this site, or for “same-origin” requests.
Help
Reason given for failure:
CSRF cookie not set.
In general, this can occur when there is a genuine Cross Site Request Forgery, or when Django’s CSRF mechanism has not been used correctly. For POST forms, you need to ensure:
Your browser is accepting cookies.
The view function passes a request to the template’s render method.
In the template, there is a {% csrf_token %} template tag inside each POST form that targets an internal URL.
If you are not using CsrfViewMiddleware, then you must use csrf_protect on any views that use the csrf_token template tag, as well as those that accept the POST data.
The form has a valid CSRF token. After logging in in another browser tab or hitting the back button after a login, you may need to reload the page with the form, because the token is rotated after a login.
You’re seeing the help section of this page because you have DEBUG = True in your Django settings file. Change that to False, and only the initial error message will be displayed.
You can customize this page using the CSRF_FAILURE_VIEW setting.
Rkh
It works properly in local host, but when I deployed it in ec2 the issues comes
Rkh
I have tried setting the cookies, trusted originis
Shaikh Ahmad Raza
have you added @ensure_csrf_cookie in view function
Shaikh Ahmad Raza
also in setting.py Middleware
Rkh
Rkh
Shaikh Ahmad Raza
from django.views.decorators.csrf import ensure_csrf_cookie
@ensure_csrf_cookie
def your_view(request):
...
Shaikh Ahmad Raza
This I have done
hlo brother have you deployed your frontend on another server
Vinit
Can anyone suggest best resource to learn django
Benyamin?!
Do I need to learn front end stuffs like html and css for learning Django or not
Charly
Shivashish
Bhavin
{% extends "layouts/app.html" %}
{% load static %}
{% block title %}
<title>EARN HERE</title>
{% endblock %}
{% block link %}
<link rel="stylesheet" href="{% static 'css/earn.css' %}">
{% endblock %}
{% block content %}
I have linked the css properly then too its not loading
Bhavin
So i wanted to send my ss.
Charly
So i wanted to send my ss.
No screenshots are allowed. Do you see any error in the browser console related to load the the CSS?
Bhavin
No
Charly
No
Then why you say is not loading?
Charly
do you see it properly linked in the rendered template? if you open the link of the css you see the code?
Bhavin
I have written some css in static -> css -> earn.css
Bhavin
The web page is loading only html
Bhavin
Other file css are all working but not this
𝘼𝙗𝙤𝙡𝙛𝙖𝙯𝙡
𝘼𝙗𝙤𝙡𝙛𝙖𝙯𝙡
ctrl + f5
your internet have to be on
Ahmed
Bhavin
Solved guys thanks. It was a cache problem