Rammanoj
this snippet is working one — https://dpaste.de/y9vi
Rajjix
nice, you did it 🎉
Rajjix
your welcome
Ronald
Anyone with some decent Django Rest Framework experience? Got a question.
ʚɞÇherry Łoveʚɞ
Ronald
So
Ronald
No sure if Rest Framework is out of scope of this chat
Ronald
but anyway
ʚɞÇherry Łoveʚɞ
no, it's related
Ronald
I’ve managed to setup the basics of Django rest framework.. it returns the whole queryset of a model. Nice.
Rajjix
controlling satellites with django rest?
Ronald
however
Ronald
I don’t find much info online for when it comes to filtering the API.
Ronald
especially with variables
Rajjix
u ruined it, you made all that big intro i thought u had a spacex idea
Ronald
Ronald
anyway\
Ronald
back to my question
Rajjix
filtering what ? The queryset ?
Rajjix
(model data)
ʚɞÇherry Łoveʚɞ
ʚɞÇherry Łoveʚɞ
what's you exactly want to do ?
Ronald
oh more specifically, foreign keys
ʚɞÇherry Łoveʚɞ
are you tried with this docs
https://www.django-rest-framework.org/api-guide/filtering/
usmanium
Can someone share this book please?
Rajjix
if you’re not willing to pay for it, you won’t get it here for sure, but here is a website for the author of the book, he shares a lot of tutorials
https://wsvincent.com
George
I wouldnt also pay for a book cos there is no need to.
George
Internet has enough free resources.
usmanium
It's okay no problem, but some kindsness Will be better. We all using Internet but nobody knows whose behind. I came in peace
George
Sergey
Hello! Tell me, is there a name for authentication with one key? Not a login and password. Only one unique key. TY
Rajjix
token
Sergey
You misunderstand me a little
I need to implement authorization in drf so that the user sends a token(instead of login and password) that is recorded in the database, and I gave him jwt. I can't find such solutions.
Maybe some specific name?
Rajjix
as far as as i know u can let someone login with their grandpa’s name if you want. it doesn’t always require login and pass that’s just the convention, u only need to override your backend method that’s responsible for authenticating users and giving them a token to receive their grandpa’s name instead of login&pass, but if your purpose to make your own api-key like other services we usually use, it’s very similar drf has something called token authentication, or third party library called django-rest-framework-api-key which makes it a bit easier, but authentication principle remains the same in all mentioned subjects u require any type of identification of the user and issue a token to the user, which he will use to access your services
Adil
Mohit
How to let users login using either username or email? The user should be able to login with both
Renita
Hey there! I would like to know how can I do the following using Django:
I have a python file full of methods of extracting data from a URL. I need that data to be fed as the database data. How can I achieve that?
Where should the python file reside in the project structure and how do i insert data into database from the file
Rajjix
django responds to http requests, so you would need to trigger those functions in your views, or another method would be using celery if you want trigger those functions on a time schedule, make a model and use the save method to save retrieved data
Renita
Okay I will look into it
Rammanoj
hey guys, I have a large sql file (both ddl and dml written). I have no models. Is there any way to generate models from it??
R
Renita
Oh
Renita
I will look into that
Nithin
Hey, i am developing a rest api using drf.
When users are signing up they can choose what all features they want acess to and they can only access those features.
Is the best way to impliment this using permissions? Or is there any specific packages for this?
ibrahim süren
you can write your own permission classes
ibrahim süren
easiest way i think
Nithin
I see, thanks
mahori.
Anyone experienced with using django+spacy?
mahori.
Would love to discuss
Raghavendra
How to get a object from js in a html page to views.py
dhelbegor
Hi guys, can you help me with a question please?
how do I pass an index on the self.get_object to receive only the folder and not the files inside it?
This is what is coming: little-thomas-test: s3.ObjectSummary (bucket_name = 'little-thomas-test', key = 'run-001 / 000000401917_DP10_E09_15.ab1')
and I just need it: little-thomas-test: s3.ObjectSummary (bucket_name = 'little-thomas-test', key = 'run-001 /') # just the folder
detail this folder is in a s3 bucket
This is my configuration.
bucket = s3.Bucket (name = "little-thomas-test")
FilesNotFound = True
get_folder = str (self.get_object () .slug)
for obj in bucket.objects.filter (Prefix = get_folder):
print ('{0}: {1}'. format (bucket.name, obj)
FilesNotFound = False
if FilesNotFound:
print ("ALERT", "No file in {0}". format (bucket))
Anonymous
Good day
Anonymous
How do I send a document from database to email, please any code snippet or reference
George
Mirco
Anonymous
Thanks Guys sorry for not getting back to you, I have a solution already
Ghorz
Ghorz
Ghorz
Ghorz
Also remember to specify the event, either send on users action trigger or send to all users based on event such as time
ibrahim süren
hello, my static files gives 404 error on production
George
ibrahim süren
George
did you read it?
ibrahim süren
yes
ibrahim süren
https://docs.djangoproject.com/en/2.1/howto/static-files/ is it?
George
no
George
DEPLOYMENT
George
development is not deployment
George
https://docs.djangoproject.com/en/2.1/howto/deployment/