Rohan
Read requests doc for file upload
Hugo
OK...let me check
Kostya
Hi, how a u? Maybe who did use pysftp for connection by sftp with secret key?
N S
Guys i have a question which is the best tool used to send sms in a django application
Alexander
sms is not good choice for anything in 2019 (for security reasons)
Alexander
only for phone verification may be
Alexander
https://www.twilio.com/verify
N S
only for phone verification may be
I am using it for notification and initail verification only
Alexander
I know some of telegram accounts of russian opposition were hacked because of sms (SS7)
Alexander
https://habr.com/ru/company/pt/blog/283052/ (ru)
N S
What is the max limit in twilio
Alexander
I don't use it, but I know, it's one of the leaders on this market
Anonymous
If all my requests need authentication do I still need csrf token? Why?
Mirco
If all my requests need authentication do I still need csrf token? Why?
Read about csrf token on official docs and you will understand the reason why 😁
Anonymous
So that's a yes
Anonymous
I'm not gonna find a way to remove csrf token I just was wondering if someone is gonna attach with cross site forgery well their request will be denied. Then csrf token is obsolete. I am wondering this 👆👆. Not that I'm proposing it
Mirco
Make a search on Google first
Anonymous
Hello.. Any tried to upload croped image to db in django ???
Anonymous
Is there any package or only JavaScript ?
Anonymous
Any idea guys.
Anonymous
Use Pillow, with Image field
So user can crop by himself ?
Mirco
So user can crop by himself ?
You have to setup a view for doing it
Mirco
Anyway there's a django package that can help ya
Anonymous
You have to setup a view for doing it
I tried to crop the image which upload. But it's fixed. What i meant is suppose you upload your photo in facebook. You can crop na ?? That's what I'm talking of.
Anonymous
You mean crop it on update your profile , aren't ya ?
Yea. I written a code in model itself. It will crop the image during the time of upload.
Anonymous
Can idea mahn.
Anonymous
?
Mirco
Yep, you need to do that job in a UpdateView , not CreateView
Anonymous
.
How to render form into template created using forma.py
.
forms.py
Anonymous
How to render form into template created using forma.py
You need link your model to form. They in view create object for that form and pass it .html you want to display
Anonymous
Check documentation
Anonymous
Template tags also.
.
Tq
.
Do you have any sample project on django to do crud operation
Mirco
Okay but how to get crop functionality.
Again, check Pillow 😁
Yusniel
Hello everyone, I'm refactoring a Django project. I need to put all of common functionalities (auth, notifications, mails, etc) in a common app inside of the project and every app have to use it. Is there a way to do that? How I should to structure my project?
Yusniel
I'm new in django BTW.
Nitesh
How to render form into template created using forma.py
Class MyView(TemplateView): form_class = YourForm template_name = 'project/index.html' def func(request): your_form = YourForm() return render(request, 'project/index.html', {'your_form': your_form})
Nitesh
Use {{ your_form }} in your template
Nitesh
Authenticate your form using HTTP request in your function
Nitesh
I use CBV you can use FBV
.
Is anyone have sample django crud app do share
Mirco
Is anyone have sample django crud app do share
Google it 😁 it's plenty of them out there
N S
I can't exclude a primary field in modelformsetfactory can anyone help
N S
Use exclude into Meta
Did that no change
Mirco
We don't have a magic ball, if u share your code we can help ya
N S
https://dpaste.de/xMdb
N S
my forms.py
N S
my models.py https://dpaste.de/UL76
N S
my views.py https://dpaste.de/fAjv
N S
the html rendered by views.py https://dpaste.de/H93a
Mirco
https://dpaste.de/xMdb
Instead of "id" , type "pk" into your exclude
N S
no change
Mirco
Even in models
N S
Even in models
where in models that is auto generated
N S
i have added in forms and views but no change has happened
Mirco
where in models that is auto generated
Into you model , your form set is a modelformset so it inherit fields from your model
N S
Into you model , your form set is a modelformset so it inherit fields from your model
yes but if i add id or pk in exclude the field should not be there but why is it still asking for it if such a field is not shown in the html table
N S
here is the request.POST data https://dpaste.de/6vP6
highnes
I have two html files index.html and user.html the user.html doesn't load static files, can anyone help.
highnes
Ive done that
highnes
Still it dsnt load static files
pino@mastrobirraio ~$
Still it dsnt load static files
did you add this to your main urlpatterns? urlpatterns = [ ... ... ] + static( settings.MEDIA_URL, document_root=settings.MEDIA_ROOT )
pino@mastrobirraio ~$
In this case obv
Mirco
In this case obv
Yup 😁😁
pino@mastrobirraio ~$
Because you need to import it
pino@mastrobirraio ~$
from django.conf.urls.static import static
highnes
Still no static files show up
Mirco
pino@mastrobirraio ~$
Still no static files show up
Can you show us eventual errors in console?
highnes
https://dpaste.de/Jq4U