Dasa
Django allauth with cookie cutter
cj
Django allauth with cookie cutter
could you provide the link to that cookiecutter template? 🤔
Dasa
could you provide the link to that cookiecutter template? 🤔
https://cookiecutter.readthedocs.io/en/latest/readme.html
cj
https://cookiecutter.readthedocs.io/en/latest/readme.html
the link of the specific template you're using
Dasa
the link of the specific template you're using
Like what exactly do you mean by template? Isn't cookiecutter a template
cj
Like what exactly do you mean by template? Isn't cookiecutter a template
cookiecutter is a tool to work with templates 🙄
cj
there are thousands of templates made with cookiecutter 🤷🏻‍♂️
None
Hello. Did anybody work with wagtail?
Akash
Hello. Did anybody work with wagtail?
Many people probably did. Ask direct questions that will be answered... People will usually avoid replying to these any such user, anyone used this questions.
None
Many people probably did. Ask direct questions that will be answered... People will usually avoid replying to these any such user, anyone used this questions.
I want to add a group for users and I have a menu which called "Permissions for objects". It contains objects and permissions for each. I need to know where these objects store. Cant find a table in db.
Raghava
Hi, I need to detect a persons exact location and store it in models can anyone suggest how should i proceed. Like should i use google maps api or django easy maps or......
Rajjix
Hi, I need to detect a persons exact location and store it in models can anyone suggest how should i proceed. Like should i use google maps api or django easy maps or......
I think it’s best to use browser built in geolocation, it is supported by all browsers and asks user for permission before sharing location.
Rajjix
but i’s not as accurate as google maps, for that i think u’ll need to pay to use their geolocation api and might require some more coding on ur side
gamer_boy
http://dpaste.com/2PP09V9
gamer_boy
detail.html👆
gamer_boy
plz help me to solve this error
cj
plz help me to solve this error
show your urls.py for that view
gamer_boy
http://dpaste.com/3BCV18A
gamer_boy
app/urls.py
cj
change question.id for question_id
gamer_boy
i tried but still it gives me error
cj
question_id=object.id 🤦🏻‍♂️
Rajjix
are u passing the question id to ur vote view?
cj
you just have to change a . for a _ 🙄
cj
but where
Here https://t.me/django/22723
gamer_boy
k
gamer_boy
thank you ☺️
Shubham
Hello do anybody has working knowledge about vagrant? I have one query
Shubham
Whenever I hit the command vagrant up and the vagrant ssh , server start , then each time I need to install virtual env
Shubham
I meant everytime its not dynamic
Shubham
https://docs.google.com/document/d/1Wpgh_Mpa1ko8zuvJmkU7bwtzUIL2h9iQZ-13V1ODik4/edit?usp=drivesdk
Shubham
Please have a look
Rajjix
i think for ur use-case docker can be a lot less of a headache, haven’t use vargant before, just an open suggestion as they almost serve the same purpose
Shubham
Ya I heard that too
Shubham
Thnx
Shubham
I will use it
Rajjix
good luck 🍀
Rammanoj
hey, is there any way to send a file along with json data in postman
Rammanoj
?
Rajjix
Google said yes 😁
Rammanoj
Google said yes 😁
how to do it @Rajjix ?
Rajjix
Googles’ answer not mine 🤷‍♂️ send+file+postman
Rajjix
or post would be better
Rammanoj
yep , I did and in stackoverflow I got an answer that we need to send it using the form data.
Rammanoj
it successfully sends the data
Rajjix
If this is the same error i had some time ago here’s how i fixed it
Rajjix
In ur api view add an attribute like so, renderer_classes = (JSONRenderer, )
Rajjix
from rest_framework.renderers import JSONRenderer
Rajjix
btw code=‘blank’ is not json data
Rajjix
“Code”:”blank” is
Rammanoj
thanks @Rajjix but its not working, for all the other api viewsI am giving json data as input and it worked. But for this I gave form data even specifying renderer_classes giving same html response
Rajjix
ur model is sending an error string=‘something’ that’s not json format
Rajjix
I think that’s ur problem
Rammanoj
maybe but I am not able to find the exact error, I will paste the codes in dpaste one sec
Rajjix
Ur examduraion field
Rajjix
Assign those 2 fields a default vaule and u won’t see this error but that won’t fix the problem
Rajjix
Exam_duration and code
Rammanoj
these are my code snippets: 1. https://dpaste.de/bGB1 -- models.py 2. https://dpaste.de/gSiz -- serializers.py 3. https://dpaste.de/Behy -- views.py
Rammanoj
Assign those 2 fields a default vaule and u won’t see this error but that won’t fix the problem
No, actually the problem is if the user has not filled any field ro someting and submitted the data, it has to return some json response saying that this field is empty. But in this case validation error is being raised. But I am getting the error that it is not json serializable
Rajjix
Exactly what i’m saying xd
Rammanoj
Exactly what i’m saying xd
but why is the error not returning json response ?
Rajjix
because that’s not what django model does out of the box 📦
Rajjix
but what i would have done in this case is use serializers to validate ur data instead of the model
Rajjix
It’s much easier
Rammanoj
but I have to consider each and every case right ??
Rajjix
what do you mean each an every case ?
Rammanoj
such as if the user has given input or not to a field and if it is given is the input given by him is valid or not etc
Rammanoj
eg: in case of publication_date it can't be less that today, and it has to be valid publication date in specified format
Rajjix
two things u need to know
Rajjix
validate_<field_name> is same as django clean_<field_name>, only difference is you raise serializers.ValidationError in case data is not right
Rajjix
and u can check for model data in ur serializers as well and raise validation error accordingly, if something is not right
Rammanoj
thanks @Rajjix will do that
Rajjix
no probs, good luck 🍀
Rammanoj
no probs, good luck 🍀
@Rajjix got the exact error now. I am calling the super class (i.e super.post(request, *args, *kwargs) from try block). So whenever the error comes, it is being handled by the try block. Hence django is raising the exception instead of returning the json response.
Rammanoj
no probs, good luck 🍀
really thanks for the help