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
I get index out of range
because each time you pop an element the list changes its size
Charly
names.pop(0) should work
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
Charly
I was completely discouraged from learning Python because of this
what? just a mistake and wanted to resign? Dude be prepared for a life of mistakes, that's how's programming is
Charly
I cant slove this sh!t for few days
You could have readed the documentation of that method
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
vahiden
even for senior programmers
Anyway thank you🧡
Дока
I want url: auth? Token
Write your own Authentication
Kritesh
Write your own Authentication
Yaa.. I have created a authentication only I want url has to GET request and redirect to me page
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
Дока
It will be get request ok
Whats the problem?
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
Charly
no I can't it says like the above error
That error is from pylance not from running it
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
Yes, you can update database value with HttpRequest, you can use post or get
Is there any better way for it, because anyone can gimmick it
All in All
Is there any better way for it, because anyone can gimmick it
Anyone can perform a http request outside the website manually
Umidjon
I have an error who can help me ?
.
I have an error who can help me ?
No one can help you until you explain your difficulties.
Umidjon
No one can help you until you explain your difficulties.
I made a web page for myself. I added the certificates section. If I post new certificates with title and image from the admin panel, they don't appear on my web page
Umidjon
Using a code pasting website, share your code 1. views function 2. template html
class CertificateListView(ListView): template_name = "sections/certificates.html" queryset = Certificate.published.all() context_object_name = 'certificates' class CertificateDetailView(DetailView): model = Certificate template_name = "sections/certificates.html"
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 🙏
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 ?
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
.
when I open certificates page it shows "No certificates available", I think my for loop does not work
Have you made sure that what you added in the admin page is published objects?
Anonymous
Mapping of url: telling the computer if a visitor visits a url, which function should be called
Now mapping is of 2 types app url and project url .. what's the key difference?
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(...)
Anonymous
https://codeshare.io/vwZqAL someone please help me with this error am getting
Sharif
https://codeshare.io/vwZqAL someone please help me with this error am getting
I think you have to set your home view in your url patterns.
Sharif
Ok
Yusuf
{% if vacancy.frontend =="0" and vacancy.backend =="0" and vacancy.fullstack =="0" and vacancy.Intern == "0" %}