Anonymous
Which database do you use ? and what is your operation system?
I use Sqlit3, that's default database in Django, and I am using Windows operating system
Groot
Use filter()
Thanks bro thats working now
Groot
But i want only one field data to be shown after user response another one will load
Groot
Also how can i match the user selected option with correct option
I want to do that after that next field data wil shown
Groot
Any idea for that?
on
WordPress uses yoast seo plugin for seo. Which package i can use for django for seo purpose
William
Any idea for that?
Can you share the code. It will be easy for me to answer.
Groot
Okay wait
Kiarash
Mubtasim
Can anyone please tell me how to redirect back to previous page or dynamically after social login?
Mubtasim
It always Redirects me to LOGIN_REDIRECT_URL ='/' at seetings.py file while i want to redirect it to the previous page... not at single home page.
Mubtasim
The Page's url takes post.id and post.title... Those are not same for all posts... Suppose one user is reading a single post and then he wants to login from navbar login... The post has an unique url like other posts... After login he redirects back to home page or a single page... I want to redirect him back to that post
Frank
Can anyone please tell me how to redirect back to previous page or dynamically after social login?
U know the "login?=next" statement? That goes within the actual url to indicate u want to go after any action
Frank
https://stackoverflow.com/questions/16750464/django-redirect-after-login-not-working-next-not-posting
Groot
Can you share the code. It will be easy for me to answer.
<section id="categories" class="categories-area pt-170 pb-170"> <div class="container"> <div class="row"> <div class="col-xl-8 col-lg-10 mx-auto"> <div class="section-title text-center"> <h2 class="wow fadeInUp" data-wow-delay=".2s">MOCK TEST</h2> <p class="wow fadeInUp" data-wow-delay=".4s"></p> </div> </div> </div> </div> {% for qu in qu %} <div class="container"> <div class="row"> <div class="col-xl-6 col-lg-7 col-md-10 mx-auto"> <div class="section-title text-center"> <h2 class="mb-15 wow fadeInUp" data-wow-delay=".2s">{{ qu.question_text }}</h2> <ul class="wow fadeInUp" data-wow-delay=".4s"> <li>{{qu.choice1}}</li> <li>{{qu.choice2}}</li> <li>{{qu.choice3}}</li> <li>{{qu.choice4}}</li> </ul> </div> </div> </div> {% endfor %} {% endblock %}
Mubtasim
U know the "login?=next" statement? That goes within the actual url to indicate u want to go after any action
Yes i know... But for social login like google, when i use ?login=next it doesn't work.... I will be very helpfull if you provide any code...
Mubtasim
Social allauth login**
Mohammad
django.db.utils.ProgrammingError: type "jsonb" does not exist LINE 1: ...LL, "further_details" text NOT NULL, "attributes" jsonb NOT ... How can I fix this error? I am using the psql database I read somewhere that JasonB field could help but did not solve the problem. I have asked this question several times but have not received an answer. I welcome any answer that can help me even a little to solve this problem
William
Rule 5️⃣: To share code or error tracebacks, use an online pasting service like: - https://del.dog - 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.
Eilia
Hey guys! Anyone can help me to implement JSON Web Token in my DRF project? any link o document to implement it? Thanks in advance
https://django-rest-framework-simplejwt.readthedocs.io/en/latest/ Follow the document its easy to implement
.
Hi, can anyone help please. How to store post with likes, and how to know if user who's send the request liked post or not?
Frank
Hi, can anyone help please. How to store post with likes, and how to know if user who's send the request liked post or not?
maybe the solution is in the section Django Sessions, I did some of that a long time ago but I don't remember anymore haha
Conditional elector of HRE
Hello everyone! Why isn't the django form displaying? Here is the views.py code - https://pastebin.com/r1tJ54Kh, here is the registration.html code - https://pastebin.com/9R4ymWAw and here is the forms.py code - https: / /pastebin.com/Q0pdryr7 I indicated in the form {% csrf_token%} {{form.as_ul}} {{form}} doesn't work either
Глеб
How to get attributes values using model id?
Irfan
Anyone help me to get data from react form in django
.
سلام به همه دوستان چرا این کد خروجی از بهم نمیده؟؟
.
سلام به همه دوستان چرا این کد خروجی از بهم نمیده؟؟
class myrouter(object): def init (self,routername,model): self.routername = routername self.routername = model def print_router(self,date): print("the router model is:"),self.model router1=myrouter("R1","2900"
Глеб
Using get()
example?
William
example?
ModelName.objects.get(id=1)
Глеб
ModelName.objects.get(id=1)
i need value of attribute
William
i need value of attribute
Data from the database?
William
Yes
Try using the above method
Глеб
Try using the above method
example? Your example returns object id
Emre
Hi, anyone knows that how can i save base64 format image as an jpg or png and return it to vue as an image?
William
example? Your example returns object id
Pass the id in get u will get the data
Глеб
Pass the id in get u will get the data
It returns Model object (55)
William
Anonymous
Anyone help me to get data from react form in django
What do you exactly want? Generally you can build a rest-api (using drf, etc.) then get data by a request and use it in react
The
What's the cheapest way to host a Django project for a client
Глеб
Share the code.
What code? URL.objects.get(id='55') returns URL object (55) I need get value of variable. Value of variable i request as form
Sumit
Hi, I need one help. I have to upload more than one image for a product, number of images is not fixed. How can I write a model for it.
Sumit
class Product(models.Model): name = models.CharField(max_length=100) product_image = models.ImageField(upload_to='product_image/', null=True, blank=True) price = models.PositiveIntegerField() description = models.TextField() def __str__(self): return self.name
Sumit
This is for one image per product , but I need multiple images for one product.
William
Rule 5️⃣: To share code or error tracebacks, use an online pasting service like: - https://del.dog - 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.
William
Share your code through one of the above options!
William
URL is model
Try passing 55 as the number
William
Share with me your models, views code.
Глеб
Share with me your models, views code.
views has only print(URL.objects.get(id=55)
William
What is the output you got?
Глеб
Share with me your models, views code.
from django.db import models class URL(models.Model): full_url = models.CharField(max_length = 200) short_url = models.CharField(max_length = 10, default='')
Глеб
William
Tell me what you get when you pass URL.objects.all()
Глеб
<QuerySet [<URL: URL object (36)>, <URL: URL object (37)>, <URL: URL object (38)>, <URL: URL object (39)>, <URL: URL object (40)>, <URL: URL object (41)>, <URL: URL object (42)>, <URL: URL object (43)>, <URL: URL object (44)>, <URL: URL object (45)>, <URL: URL object (46)>, <URL: URL object (47)>, <URL: URL object (48)>, <URL: URL object (49)>, <URL: URL object (50)>, <URL: URL object (51)>, <URL: URL object (52)>, <URL: URL object (53)>, <URL: URL object (54)>, <URL: URL object (55)>, '...(remaining elements truncated)...']>
William
store get() in a variable and use for loop on that variable and print
Eilia
William
Don't do URL.objects.all() now.
William
Try URL.objects.get()
Глеб
Try URL.objects.get()
get() returned more than one URL -- it returned more than 20!
William
get() returned more than one URL -- it returned more than 20!
Pass id value. GET will give you distinct value only. It is a unique field that's why I told you to use get.
William
If you want multiple data with some similarities then use filter()
William
Try URL.objects.get(id=55)
William
i did it many times. it prints URL object (55)
for i in URL.objects.get(id=55): print(i)
William
Try the above code.