Maxim
Faizan
Is there to way to integrate Scrapy spiders in django views?
Badal
upgrade Study with Gaming
Any one can explain this task:
1. Create an admin
2. Login into admin site
It's mark as a "Enter the admin site"
Badal
Saddam
http://linkode.org/#3KC0XM4tviwm4mIZyQzKD2
Saddam
form
Saddam
http://linkode.org/#vGg5sIjmeQutJg9YqmEu25
Saddam
with script tag try to implement this in your code
Saddam
validation will work
Joker
hey guys, I'm from Iran and i need to activate Tor browser for my Brave browser, how can i get a bridge??
Kells
HINT: Add or change a related_name argument to the definition for 'pages_app.User.user_permissions' or 'auth.User.user_permissions'.
Kells
maybe smb met such error
Paulo
Hi guys, I've just read a post about Django serializers and it's performance...
https://hakibenita.com/django-rest-framework-slow
I've been using the ModelSerializer and I'd like to test the simple function as in the post
Do you guys have already tried something like that? Would you mind to share some of your experience and maybe some code that I can take as an example for a ModelViewSet approach?
Binary
Hey I need some solution regarding django models i have a models named user-detail it have a choice field from 1-24 i want to have foreign key of user in user-detail table but i want to save choices only once in user-details table.... How can I do that?
Piyush
Hello can any one help me I was creating a project based on employee record management system but I stuck on one point I want to delete employee by there username not by there Id how to do that
Vijay
Vijay
Us*
Patrick
SantiU
good people, I am working for the first time with aws s3, where I have images to upload from the django admin, everything works perfect on localhost, but once deployed the images are uploaded but not displayed on the web, someone could give me a hand?
Vaibhav
Vaibhav
Mirco
SantiU
Mirco
SantiU
this is my code
SantiU
https://stackoverflow.com/questions/74583166/how-can-i-acces-to-my-aws-s3-bucket-in-django
Mirco
Mirco
And then you have to share also that MediaStore
SantiU
Mirco
Mirco
Share that MediaStore
Dj - 505
Hello .. How I handle the nested urls using DRF-ModelViewset ?
for example I want to CRUD on comment 3 here:
http://127.0.0.1:8000/api/post/1/comment/3/
Jerome
Paulo
Thank you very much
Clement
Stéphane P
How do you filter the records of an object based on its foreign key in the view?
Stéphane P
If you have the link's, please share with us
Billy
Tell me please, what is the error
class ImagesInline(SortableTabularInline):
model = Images
readonly_fields = ["display_image_field", ]
def display_image_field(self, obj):
new_width = 200 * obj.image.width / obj.image.height
return format_html('<img src="{url}" width="{width}" height={height} />'.format(
url=obj.image.url,
width=new_width,
height=200,
)
)
class PostAdmin(SortableAdminMixin, admin.ModelAdmin):
inlines = [
ImagesInline,
]
When I started inheriting ImagesInline from SortableTabularInline, an error came out(error is 'NoneType' object has no attribute 'is_hidden'), and when I inherited from admin.TabularInline, everything worked
Jerome
How do you filter the records of an object based on its foreign key in the view?
different ways, here 2
by a queryset & double underscore to target foreign key values:
Article.objects.filter(genre__name=‘’..")
also related_name:
articles=Article.objects.select_related(‘genre’)
for article in articles: article.genre.name
Depends, you need to focus on that, not just grab 2 or 3 lines of code around there, it's a main topic
Doragonsureiyā
Tell me please, what is the error
class ImagesInline(SortableTabularInline):
model = Images
readonly_fields = ["display_image_field", ]
def display_image_field(self, obj):
new_width = 200 * obj.image.width / obj.image.height
return format_html('<img src="{url}" width="{width}" height={height} />'.format(
url=obj.image.url,
width=new_width,
height=200,
)
)
class PostAdmin(SortableAdminMixin, admin.ModelAdmin):
inlines = [
ImagesInline,
]
When I started inheriting ImagesInline from SortableTabularInline, an error came out(error is 'NoneType' object has no attribute 'is_hidden'), and when I inherited from admin.TabularInline, everything worked
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.
Aiman
Hello i have a question, i just started Django on visual code linux, however i am facing this issue
code : from . import views
output error : attempted relative payment import with no known parent package
Vijay
Aiman
i already have it installed
Aiman
what does from . import views actually mean?
𝒊𝒃𝒐
Trying to create detail page when I load the page, Django static files not serving in DetailView but other pages are loading static files. Can u help me
iplogger
R
Hello guys, I've used django user model for registering my user details and auth for loggin in...I need to login to my app using Google authentication...Do I need to store these credentials into my User model? I mean ho does the Google authentication works? For simple logging in we check whether the user exist in our User model and log in...can anyone explain?
Vijay
Aiman
Aiman
is there like some sort of extension i need to download or?
Vijay
Vijay
We can get some details of users
Vijay
Like name, email, picture etc
Vijay
I think sharing document in the group is prohibited
Shivam
Failed to start [powershell.exe ] : D\Project name
How to solve this error in Pycharm ?
yegor
If i have one to many database, how i can get all child ?
yegor
q.choice_set.all() only like this ?
yegor
or like in flask ?
yegor
yegor
For now i have:
class Writer(models.Model):
name = models.CharField(max_length=50)
birdate = models.DateField(help_text="Enter the date of birth")
def __str__(self):
return self.name
class Book(models.Model):
title = models.CharField(max_length=50)
pubdate = models.DateField(help_text="Enter the date of publication")
writer = models.ForeignKey(Writer, on_delete=models.CASCADE)
def __str__(self):
return self.title
yegor
Anonymous
You
Hello, I want to create a model for a user with AbstractUser, but when I type makemigrations in the terminal, it gives an error. Thank you for your answer.
Faizan
python manage.py makemigrations
Faizan
Python manage.py migrate
RRH
Faizan
What error it gives can you specify?