Cesar
Cesar
you should first order by, and then slice it.
There is no much logic in ordering (or filter) after slicing
Jay
Shrey
Cesar
Mohamad
How to return to the current url?
return HttpResponseRedirect(request.path)
Shrey
You could try
return redirect("viewname")
|-|●$€!|/|
Hello ,
Why I cant use slug in
Get_absolute_url ?
Yulian
Ravi
add current user to model please help me
Ravi
from django.db import models
from django.contrib.auth.models import User
from django.conf import settings
# Create your models here.
class Book(models.Model):
name = models.CharField(max_length=200)
created_by = models.ForeignKey(User,null=True,on_delete=models.SET_NULL,editable=False)
def _str__(self):
return self.name
Izzat Alharis
Dheekshith
Hi
Can anybody give a clue about how to deploy a django application
Like on which platform and what package should I choose
Dheekshith
I tried using pythonanywhere
I did all the config but site didn’t load.
It would be helpful even sharing tutorials which worked for you
Thanks in advance
Amnas
CSRF verification failed. Request aborted.
Amnas
Origin checking failed - http://35.72.2.239 does not match any trusted origins.
.
hello guys ,
how can i create the parent and its chiledren in one form
i know that i need to use inline formset to create many chileds in one time ,buy how can i crate the parent and relate it to them if i did not make before
whoami
hi all. i have a confluent-kafka producer, and i wanna see the result of this produce, how can i do it, can anyone give me good tutorial about it?
Dheekshith
Dheekshith
Something went wrong: (
Something went wrong while trying to load this website; please try again later.
If it is your site, you should check your logs to determine what the problem is.
Dheekshith
Maxim
S
How to send email with attachement?
S
Using django
Doragonsureiyā
How to send email with attachement?
These single steps will help you a lot:
Step 1️⃣: Open a browser
Step 2️⃣: Write down https://google.com or https://duck.com and press Enter
Step 3️⃣: In the search box, write down the same words you asked here
Step 4️⃣: Read the first results
S
Ok thank you
Vishnu
Anyone have project model using django
Doragonsureiyā
Krunal
I am using swagger to documentation of my drf api. Some of my api use query parameters. swagger is not giving input for such situations. can someone please help me how cam i get that in swagger?
Mirco
Tура
hello is there any alternative for social share in django, because there is not instagram
Tура
also no posibility to share photos
Mirco
Doragonsureiyā
also no posibility to share photos
Rule 5️⃣: To share code or error tracebacks, use an online pasting service like:
- https://dpaste.org
- https://linkode.org
- https://hastebin.com
- https://bin.kv2.dev
If you posted a wall of text, go back and delete it.
Tура
!paste
I mean in 'social share' app
Tура
Mirco
how
Google it, search, study how it works
Georg
hello.. How to make a query SELECT ... FROM (SELECT ...) forcibly ?
Georg
I mean, what I should use to separate internal "select" from external ? Subquery isn't useful for this...
Georg
I want something like this:
Separator(MyModel.objects.filter(...).annotate(...)).filter(.<by fields created in annotate>.).exclude(.<by fields created in annotate>.)
Georg
in objectives I want to filter my queryset by new annotated fields (like status, some summas, etc)
Georg
if I do it in standard in simple flat select - it does not work as it should.. It filters first and then calculates balance-on-row. But I need vice versa
Sudhanshu
I have one issue...from frontend date is coming in string '01/12/2022' in dd-mm-yyyy format but django save it into mm-dd-yyyy format 12/01/2022
Bandar
Bandar
Using the dateutil library:
import dateutil.parser date_string = '01/12/2022' date_parsed = dateutil.parser.parse(date_string) # datetime.datetime object YourModel.objects.create(date=date_parsed)
Or using the datetime library:
import datetime date_string = '01/12/2022' date_parsed = datetime.datetime.strptime(date_string, '%d/%m/%Y') # datetime.datetime object YourModel.objects.create(date=date_parsed)
Bandar
I have a question does using multiple files for html file increase the speed ?
Bandar
like instead of one file for file.css I do 2 files
S
How to implement celery on sending emails
Gumi
I'm using multi threading in django, I tried to stop my development server with Ctrl + C but it doesn't worked for me, it only happens whenever I use multi threading, any suggestions please?
💻
Hello , i want to know if there is a way to restrict django views if another another view which contains a form isnt completed ?
Neo
Osiris *
task scheduling ?
For scheduling purpose, implement crontab with celery - see celery service in documentation
Sergey
Hi guys!
For some reason, m2m_changed signal does not come to me, maybe, because I connected 11 fields to the handler. I have connected 11 fields because these fied are have same structure connection with exact one model :) Anybody can help?
Ivan
hello everyone, does anyone know how to make a page on django admin where you can aggregate model objects? for example, I have an expense model, and I want to group expenses by text and calculate how much money is spent in total
or can anyone tell me how to make such reports?
I tried Django Slick Reporting, but it didn't seem so flexible to me for such a task
Omadbek
Has anyone tried linking the yml file in Django
Doragonsureiyā
Has anyone tried linking the yml file in Django
Don't ask meta questions like:
"Any user of $x here?"
"Anyone used technology $y?"
"Hello, I need help on $z!"
Just ask directly! The better you are at explaining the problem, the more likely you are to get help.
Asking smart questions
Pradhipta
Hello everyone 👋
Anyone want to share how you usually manage your migration files when working with your team in django?
I often do merge migrations because I often run into conflicts with other feature branches, or usually feature branches depend on someone else if there is a migration. is this efficient way? let me know ehat do you think. Thanks!
Smile
Hello
how can i automatically call a function (with business logic) every time the model is updated? I dont want do it every time in my template.
cj
Smile
Bekk1 👨💻
which free hosting can i use to deploy my project
Bekk1 👨💻
???
navid
pythonanywhere
Bekk1 👨💻
thank you broo ✊✊✊
Bekk1 👨💻
before i used heroku but now i did not understand they changed paymend systems and removed free dynoses
asterix
Mahdi hosseini
Hello everyone,
I have a very busy mind when I start coding and sometimes I don't know where to start. This way I lose huge time
Do someone have any practical idea to solve this problem?
Doragonsureiyā
.
hello guys ,
how can i create the parent and its chiledren in one form
i know that i need to use inline formset to create many children in one time ,buy how can i crate the parent and relate it to the new children if i did not make it before , which means its id is not Existing