Avinash
add @csrf_protect before every view function
Avinash
Before that import csrf_protect from django.views.decorators.csrf
T
thanks!
Mnemonics ?
Rohan
Mnemonics ?
Memeonics
Mukesh khandelwal
Which Open source IDE is to be used for creating Web app in Django
Muflone
Normal python editor, like pycharm
Muflone
The professional edition has some features for Django but they are pretty unuseful
cj
Which Open source IDE is to be used for creating Web app in Django
if you are specifically looking for an Open Source IDE, take a look to NINJA-IDE
Mukesh khandelwal
Normal python editor, like pycharm
pycharm available in community version not with full features
cj
The professional edition has some features for Django but they are pretty unuseful
I must disagree with that, but nvm 🤷🏻‍♂️
Muflone
Maybe I cannot find them useful
Mukesh khandelwal
Which Open source IDE is to be used for creating Web app in Django
Is Spyder with Anaconda is a good choice. please confirm
Eric
Which Open source IDE is to be used for creating Web app in Django
Just use VScode with the Python extension, or the community version of PyCharm... That'll be more than enough for a Django project
Mahakaal
pychrm is also better
Vivek
Yes pycharm is better
Akash
I have 1 django project and 1 python project independent of django... I want both to use same database and models. In standalone python I am using peewee ORM. What's the best way to keep both in sync so I don't have to code things twice. Right now if I change a model in django, I have to make same changes in peewee models also and sometimes also change relevant codes in both projects. What's a better solution for this?
Vivek
How to do forget password option in change 2.0
Vivek
I am not able to receive mail on my account
Omair
I am not able to receive mail on my account
Can you share the error you are receiving
Vivek
Ya I will
Anonymous
Anyone had any experience with Django PWA? Can you use it to force the browser to show stored views from local cash, rather than the one from the server?
Vivek
How to solve error 'ModelBase' object is not iterable in django 2.1
Vivek
Can you share the error you are receiving
I had solved that error buddy
👍
how to save django-filter result to csv ???
Omair
Omair
how to save django-filter result to csv ???
https://simpleisbetterthancomplex.com/packages/2016/08/11/django-import-export.html
👍
but this will not work with django-filter
👍
you can use csv module
def search(request): template = 'search/patent_list.html' patent_list = Book.objects.all() patent_filter = PatentFilter(request.GET, queryset=patent_list) context = {'filter': patent_filter} return render(request, template, context)
Mirco
how i can print filtered result in terminal
print() [ bad way ] logging [ better way imho ]
Rohan
how to save django-filter result to csv ???
What's the data structure like?
Rohan
you can use csv module
I'd recommend doing it with pandas, less hassle
Rohan
But that's just me
👍
okk
👍
Thanks bro
👍
I solved
Rohan
Noice
Mirco
I'd recommend doing it with pandas, less hassle
yup, but I don't know if he really needs all the stuff of pandas
Rohan
the fuck what?
Anonymous
the fuck what?
😐 what the fuck or fuck the wat witch is ture?
Marko
hi do somebody know/have samples how to run server code after render in django ?
Marko
python manag.py runserver??
I mean execute python function in thread or async after render template
Artyom
Hi! why i can't get a field value from related model? :
Artyom
goal_agree = Agreement.objects.get(pk = 30) # get an object goal_renter_name = goal_agree.renters_id goal_renter = goal_agree.get_field('renters_id__fnameplp') #wish to get a related field
Sirius
Hello everybody! Is it possible, to register by to register forms in Django?
Juliano
https://www.udemy.com/share/10100sBUsccV5UQw==/
Sirius
explain better
I want to save users date from two forms in the same model.
Anders (izzno / gooood) 🇳🇴
DRE: Am I right in understanding that you cannot override viewsets.ModelViewSet retrieve method but rather create a GenericAPIView with the RetrieveModelMixin (+ whatever else you need)
Anders (izzno / gooood) 🇳🇴
Which is quite simulare to defing "manually" in a veiwset.ViewSet" except class attributes that is ?
Anders (izzno / gooood) 🇳🇴
Btw: https://nesdis.github.io/djongo/ This looks interesting...
Artyom
And one more questions. Could you say, why in admin renders in name field this: <django.db.models.fields.CharField> instead 'Deutschland'?
Isaías
Hello. In django rest using APIVIew, how to get the pk sent in the url in the method patch?
Isaías
url(r'v1/user/(?P<pk>\d+)/', UserAPIView.as_view()),
Avinash
How to save session django ?
cj
How to save session django ?
what do you exactly want to do? 🤔
Rohan
How to save session django ?
django.contrib.sessions?
Avinash
In login view, request.session['member_id'] = some value
Avinash
In logout, it raise key error for request.session['member_id']
cj
In logout, it raise key error for request.session['member_id']
when you logout, all the session is flushed 🤷🏻‍♂️
Avinash
In my logout view it is the first stmt executed
Avinash
If there is an id then del the session else nothing
Rohit
Hey, is there anyone who has worked with django-allauth?
Rohit
I have some doubts
Rohit
Hey, is there anyone who has worked with django-allauth for social authentication? I have some doubts Thanks in advance!
iNcAeLuM
hello guys, i am trying to understad update_or create() in django docs, but am little confused, in this example: ´´´ obj, created = Person.objects.update_or_create( first_name='John', last_name='Lennon', defaults={'first_name': 'Bob'}, ) ``` i guess that if first_name and last_name is matched then updated all fields with defaults dict, and if it dont matches then create new one obj with all fileds including fist_name and last _name