Danil
how to impelemt google authenticator in django app?
Isaías
I want to do this using CreateView
Rajjix
u can
Rajjix
but you know django uses it’s own hashers to store passwords, so there’s something missing here in ur models password field
Isaías
u can
How do I do that
Isaías
Yes
Rajjix
for a starter approach i would list user attributes in the model class, and create a form for passwords, then django will do it’s part hashing them
Rajjix
i’ll send you a snippet
Isaías
ok
Isaías
https://pastebin.com/yPuvnxHe
Isaías
Model User django.
Rajjix
https://pastebin.com/UpbYcDrn
Rajjix
check this out
Rajjix
there are many other ways, but this is the most basic one, and allows django to hash your provided passwords properly
Isaías
thank you
Rajjix
anything for the cause
Anonymous
Medium
Well, the medium experience has been degrading since quite a time.
Leon
Hi :)
Leon
Does anyone know why django gives me this error: Module „configurations“ not found? I mean its pretty clear that a module is missing but i don‘t understand how to fix this. It gave me this error after I included the urls file from my app into the urls.py in my main project
Leon
I already checked my code for typos but cant find any
Guilherme
Did you checked your models.py, settings.py, views.py (declarations and imports)?
Rajjix
is it your app?
Rajjix
It’s the app i’m guessing
Leon
is it your app?
Thats what confuses me, my app is called configuration, an i included via include(„configuration.urls“)
Rajjix
if you installed your app in the setting with that name, than check you app.py file in ur app
Leon
So i didn‘t wrote configurations anywhere so far
Rajjix
ur settings can’t reach ur app, it’s just a naming hickup, your app name is defined in the app.py file
Guilherme
So, your installed APP calls configuration, either your view?
Leon
Ok i‘ll do that thx
Sayan
I am making a project on library management system. How I register a user as librarian and as student. I used user model and create two view pages.but it does not work separately. Plz help
Rajjix
just some logic should work, u can just add an is_librarian= in the models which gives higher privileges, and u define permissions on your views some can only be viewed by a user if he’s a librarian
Andrii
Just google django permissions
Andrii
Not so hard as it seems to be
Andrii
And I also reccomend to create custom User model It will be easier to work with it
Andrii
Don’t forget to change user_model in your settings file
Andrii
9/10 projects
Andrii
always do that in my opinion
Rajjix
Django usermodels never seem to be enough
Andrii
I had some simple projects where user permissions were equal and it was enough)
Andrii
But yes, I agree
Shubham
I can fetch the application/Id+json ....but can't fetch the json data that it hold ... please help?
Anonymous
How to plot column graphs?
Mirco
How to plot column graphs?
Have a look at Python plotly
Anonymous
Ok
Luis
Guys, I'm using DJango forms and getting validation error 'cause object already exists on database. I need to update the object data. Ideas?
cj
it's a simple number posted to an endpoint
Anonymous
it's a simple number posted to an endpoint
Can you advice give a link or something to read?
cj
Can you advice give a link or something to read?
I don't know if there's anything to read about something that simple, but I will tell you to read about sending and reading JSON to/from an API (using DRF if you want)
Doug
Where can I find more info on what default templates are used for form fields?
Anonymous
Actually,i'm a begginer in django.
Anonymous
👍
Luis
make sure you're updating an instance of the object, and not creating a new one
OK, I will get object from the database and use it in instance arg to create the form
cj
OK, I will get object from the database and use it in instance arg to create the form
Actually you can use an UpdateView and use the pk of the object in the URL, if you don't have a complex view
George
Medium
Thank you, ill try when i have time :)
John
sorry guys
Anonymous
Hi,
Anonymous
Can Anyone Tell me How to call a .py file Method in Django rest Framework ?
Anonymous
import it
Anonymous
And then call it
Anonymous
and how about passing the arguments that I'll be getting in the API request ?
Anonymous
Modify it's signature
Anonymous
Or just wrap it inside the another function
Anonymous
OKay...
Anonymous
Let me Explain the whole process.. !!
Anonymous
I have a python Script which Crawls some site and add entries to db. Now I want to create API for that
Anonymous
I started firstly for getiing the response directly from DB. And got the results. Now as I've imported the file, But now as soon as I start server, It calls the file
Anonymous
Well create an endpoint in django
Anonymous
For that endpoint create a function which receives the request
Anonymous
And inside that function call your crawling function