Mithun
Your payment initiation request is getting successfully. But when our payment page is loaded it is not able to detect the redirect origin.  This could happen if you have no-referrer policy set on your website or you are opening the payment page in a completely new TAB. due to this the transactions are getting blocked.
I'm facing this issue in phonepe payment gateway integration can anyone please help me from this
khaled
Hi I want to make a middleware to get the ip of the user in each request and I did it correctly
but how can I make it return in all of the view responses without having to add it my self?
is there a way to alter the response?
Ashish
hi iam trying to automatically update total_expenses and total_income fields of the category class when new entries gets saved in Expense and Income classes. What should i do to, should i use signals or something else. here is the code : https://hastebin.com/share/ohehovelez.scss
Alex
Doragonsureiyā
⚠️ Maxim warned ㅤ [1469491269].
1/3: [Django] nonsense message
This warning expires on 2024-11-09
Levitybot
Typically you would create a templates folder in your django project, a sub folder for each app, and then the html templates. You also need to tell Django that this new templates folder exists by adding it in the settings file
DÎmMortaLP
Hi, I am very new to the Django framework. I'm familiar with HTML, CSS and JS but the template style in Django is confusing me. I'm self learning by following the documentation but it's kind of boring. Any resources to learn?
Doragonsureiyā
amira
how to make a dashboard containing login and logout pages and apply it in djando
Это Роза🌹
Does anyone have a full Django project on Github? I recently started studying and would like to see what the code looks like from professionals. thank you in advance
Maxim
Rud
if i want to collaborate with people/friends for django project in github
how can let database accesible for me and my friends when we are not in the same connection
do we use sqlite all that django provided?
Rud
Rud
so basically dbeaver is like a cloud db that connect localhost db postgresql?
The Inspired
The Inspired
Try downloading DBeaver and using it.
Rud
noted i will find some source for dbeaver, thanks a lot
Madhur
How do I can run in debug mode. by making check point in code?
Charly
Charly
For a break point is by use pdb or ipdb as in any other program
Madhur
is this library?
Levitybot
I don't think you need the posts import in the setting.py but yes add the templates directory. You should have already added your app to the list of installed apps in settings.py
Ange
Hello guys.
I am Carly
I am a junior web developer.
I just made a django website for my company.
So now we need to put that online.
We got a domain name
But I’m looking for a platform where I can deploy the site by keeping our domain name instead of hostinger
jonte111
Railway.app is an awesome cloud service provider i deploy my django apps there
Ange
Ange
Tererai Tyler
hi guys so im using vs code and my manage.py runserver is refusing to give feedback what could the issue be
Charly
Sam
Hello guys
Sam
can you recommend me a DRF course or sth like that
Sam
Klaus
🤏
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
questions = self.object.questions.all()
context['questions'] = questions
answers_dict = {}
for question in questions:
answers_dict[question.id] = question.answers.all()
context['answers'] = answers_dict
return context
how to fix this {% for answer in answers.get(question.id) %}
TemplateSyntaxError at /test/57/
Could not parse the remainder: '(question.id)' from 'answers.get(question.id)'
🤏
pls help
Levitybot
pls help
'for answer in answers' first so that you have a list of answers. You can then call properties later
for answer in answers:
print(answer.get(question.id))
Or, to get a list
my_list = [answer.get(question.id) for answer in answers]
nyctophile
Hi guys
What should I do with allowed hosts in settings after deploying my API application
Charly
nyctophile
add the hoost
What host, it is my first time deploying anything, what's happening right now I can see my API running on global but front end cannot access it and giving error cors
Charly
Charly
nyctophile
nyctophile
Thank you
khaled
hello
how can I exclude a view from a middleware? I have created a custom middleware and it is working for all requests. but I want to exclude a view from it
🤏
def post(self, request, *args, **kwargs):
self.object = self.get_object()
questions = self.object.questions.all()
total_questions = questions.count()
correct_answers_count = 0
for question in questions:
selected_answer_id = request.POST.get(str(question.id))
if selected_answer_id:
selected_answer = Answer.objects.get(pk=selected_answer_id)
answers = question.answers.all()
if selected_answer.is_correct1 and answers.is_correct1:
correct_answers_count += 1
score = (correct_answers_count / total_questions) * 100
test_result = Result.objects.create(user=request.user, test=self.object, score=score)
return redirect('test_result', pk=test_result.pk) ploblem with score, if user touch answer ( answer have Boolean T and F) and answer have Boolean True +1 score
Olumide
Good time here guys,
Pls how do I customize django admin UI
Maxim
Olumide
Abhi
Hey I saw everything from the last 2 days but I haven't found the solution to this problem ModuleNotFoundError: No module named 'mafia.settings'
Abhi
I already see a document but I don't find better solution
Abhi
Mafia is my project directory name
pranav
Farman
Can any no fee sms service
Mirco
Abhi
Smart manu
Farman
N
I am new to django and try to develop inventory system (which includes - Purchase / sales and account modules -
Do you have any flow chart including fields ?
pranav
🏅♐Mark
I integrated razorpay with python django but it is only working when clicking a button
I will explain:
Actually I have 2 html pages for this
One is book tickets.html and 2nd one is payment.html
When I add razorpay script code added to the payment.html and added pay button in book ticket.html
But its not working
But it is working when I add razorpay pay button in payment.html
But I want like when a user clicks on book ticket button it needs to be redirected to the razorpay payment page and after show razorpay things
ERS1N
Hey,guys do you know how can i convert markdown api in open api?
‹m›Javad‹/n›
Does anyone know how to write a video post in Django in the models
N
Anyone know add to cart function to add multi items without using JASON
‹m›Javad‹/n›
‹m›Javad‹/n›
I am asking you how to write the code in models.py
Eben
‹m›Javad‹/n›
Eben
FileField
‹m›Javad‹/n›
FileField
File = models.FileField()?
Eben
Yh
Eben
file =models.Filefield(upload_to 'folder to store video')
‹m›Javad‹/n›
Eben
file =models.Filefield(upload_to = 'folder to store video')