Mayank
What should I do
Doragonsureiyā
What should I do
To get an answer to your question, it is worth to formulate it more clearly, perhaps add more details, perhaps add explanations.
chowmin
I have a one form like quiz form I want to apply strip payment integration on it like subscription plan suppose plan A 1000 number of people give the quiz and Plan B 10000 how can I do it in Django rest API any please guide me
vahiden
names = ['a','b','c','d','e','f']
unname1 = names.pop(0)
unname2 = names.pop(1)
unname3 = names.pop(2)
unname4 = names.pop(3)
unname5 = names.pop(4)
unname6 = names.pop(5)
vahiden
Why this code do not working ?
vahiden
I get index out of range
vahiden
Pop can delete just 3 element
Charly
names.pop(0) should work
vahiden
vahiden
Woow
Charly
Realy ?
What do you think pop does?
vahiden
What do you think pop does?
I never think about that thanks dude(i think pop remove all in one time but i forgot python read a line and goes to the next lane
vahiden
I was completely discouraged from learning Python because of this
vahiden
Charly
but again, thats a common thing in programming
Charly
even for senior programmers
vahiden
For me little hard many website need vpn
vahiden
Access to free internet is difficult
vahiden
The book is hard to get hold of
Shivam
vahiden
cj
Дока
Kritesh
Show your code
Bro can't share my code because it's confidencial
Kritesh
I want in url: localhost/auth? Token
Kritesh
It will be get request ok
Дока
Yemam
hey there help me
Doragonsureiyā
hey there help me
No one can help you until you explain your difficulties.
Yemam
in my django project the import file says for example
import "django.shortcuts" couldn't be resolved from source pylance(reportmissing modulesource)
Yemam
where is my error please
Charly
where is my error please
That's not an error, that's just your editor misconfigured
Can you run the code?
Yemam
no I can't it says like the above error
Yemam
oh I got the problen
Kritesh
Whats the problem?
Bro I want my url dynamic ok instead of using / I want to to be like auth? Token
Kritesh
Just like get request data
Now u understand
All in All
Umidjon
I have an error who can help me ?
.
Umidjon
{% extends 'base.html' %}
{% load static %}
{% block content %}
<h1>Certificates</h1>
<hr>
{% for certificate in certificates %}
<div class="card mb-3">
<img src="{{ certificate.image.url|safe }}" class="card-img-top" alt="{{ certificate.title }}">
<div class="card-body">
<h5 class="card-title">{{ certificate.title }}</h5>
<a href="{{ certificate.get_absolute_url }}" class="btn btn-primary">Read more</a>
</div>
</div>
{% empty %}
<p>No certificates available.</p>
{% endfor %}
{% endblock %}
Umidjon
when I open certificates page it shows "No certificates available", I think my for loop does not work
Umidjon
but I don have any idea to fix it cause i have tried many times
Umidjon
help please guys 🙏
Careful
Umidjon
Umidjon
I mean status my certificates form admins page
Careful
Can you show Certificate model?
Umidjon
yes sir
Umidjon
class Certificate(models.Model):
class Status(models.TextChoices):
Draft = "DF", "Draft"
Published = "PB", "Published"
title = models.CharField(max_length=250)
image = models.ImageField(upload_to="certificates/images")
publish_time = models.DateTimeField(default=timezone.now)
status = models.CharField(
max_length=2, choices=Status.choices, default=Status.Draft
)
objects = models.Manager() # default manager
published = PublishedManager()
class Meta:
ordering = ["-publish_time"]
def __str__(self):
return self.title
Careful
Did you try your queryset on shell ?
Umidjon
Careful
And does it work?
Umidjon
when I open certificates page it shows "No certificates available", I think my for loop does not work
Umidjon
I dunno why
Careful
Maybe don't rename the context object and use queryset in the loop to see if
Umidjon
Don’t got u
Anonymous
Does te template file of django contains the html files ? ... I learnt it contains static files like image css and js ... Does that include the html files too?
Anonymous
Can someone explain me in simple terms ... what mapping of url means in django. There are many documentation on this but I am not getting the concept
.
Андрей
good afternoon, please tell me how to make nesting in drf a:[{b:[{c:[]}]}] and so on up to 128 pcs
.
Anonymous
Arslan
Hello guys, how to limit the number of created objects, so that it would not be possible to create an object through views or through the admin panel if there are already 5 objects in the database?
Ali
if ModelName.objects.all().count >= 5:
pass
else:
ModelName.objects.create(...)
Adorilson
Anonymous
https://codeshare.io/vwZqAL someone please help me with this error am getting
Sharif
Anonymous
Sharif
Ok
Yusuf
{% if vacancy.frontend =="0" and vacancy.backend =="0" and vacancy.fullstack =="0" and vacancy.Intern == "0" %}