Soheyl Taheri
or better explain your question
I searched about my question but, I can’t found it
Faizan
Is there to way to integrate Scrapy spiders in django views?
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"
Saddam
In js file
Write in script tag
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
Us*
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?
SantiU
Are you using django-storages?
yes, and boto3, but the html not return the link of aws, its empty
SantiU
this is my code
SantiU
https://stackoverflow.com/questions/74583166/how-can-i-acces-to-my-aws-s3-bucket-in-django
Mirco
And then you have to share also that MediaStore
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/
Paulo
I'm using DRF but some peeps integrate FastApi with WSGIMiddleware
I'm using drf too, but some APIs are too slow... Thought that was because query, but after that post I think might be because of serializer
Jerome
I'm using drf too, but some APIs are too slow... Thought that was because query, but after that post I think might be because of serializer
Have a look at this Medium post, there s some info to pick, and some tips for using fastapi in django. Todays there s a bunch of folks running django with fastapi & mongo db, it can hurt at first glance, but it def worth a look
Paulo
Thank you very much
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
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
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
what does from . import views actually mean?
import all functions from views or classes if you using class-based views as I understand
iplogger
what does from . import views actually mean?
dot means import from same directory
iplogger
what does from . import views actually mean?
its like ''from same directory import everything from views''
𝒊𝒃𝒐
import all functions from views or classes if you using class-based views as I understand
def BlogView(request): post = Post.objects.all() context = { 'post':post } return render(request, 'blog.html', context) def SingleBlog(request, slug): post = Post.objects.get(slug=slug) context = { 'post1':post } return render(request, 'single-blog.html', context)
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?
R
Of course u should store those detail inside ur db
How to get the details from Google...does Google share with the app Google authentication is integrated?
Aiman
its like ''from same directory import everything from views''
i see, so um does anyone know how can i fix this issue?
Aiman
is there like some sort of extension i need to download or?
Vijay
We can get some details of users
Vijay
Like name, email, picture etc
R
We can get some details of users
Ok share me some documents related to it
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 ?
Anonymous
q.choice_set.all() only like this ?
you can set related_name on field so you can do this: q.related_name.all()
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
Anonymous
should i create one more column for this ?
you can define as foreign key attribute, like: models.ForeignKey(User, related_name='posts’)
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
Faizan
What error it gives can you specify?