raven
😁
Алишер
Manish
How to store same input value three time with help of orm
Manish
@robbyoconnor??
Name
What is the best practice of storing env variables for Django project?
Mirco
Name
.env with python module?
Jimmies San
Mirco
inchidi
inchidi
Name
Thx
Shubham
I have created the registration API using allauth, and generated token, what should be the next step so that I can implement the signIn fuctionality
https://github.com/shubham1507/school
Jesus
Hello, my name is Jesus and I come from Spain. Im currently developing a web app in Django but I am still a learner.
Jesus
I was wondering if there is any library or something that helps me create something like Dropbox but im much simpler way. At the moment, a user can upload one document and get a list of his documents. I would like to allow him to create folders and give some metadata to his files. Any suggestions?
Juris
Hello, Jesus. I'm also new to Django. I think you can:
- Create a model for folders
- Attach files to it
- Create a folder web page html.
Jesus
Juris
Welcome, and feel free to pm me Ajax tutorial/learning resources - should get on that myself!
Navruzbek
Hello people, can you suggest any good tutorial for lernign djangorest framework
Mirco
Navruzbek
Mirco
Anonymous
https://www.youtube.com/channel/UCiuZer2ELlG3dAhWCzwz9Og
Anonymous
I haven't seen his videos but I read his book which really helped me getting into Django
Maz
Man it's good to be back here.
Hi folks. 👋
tz
hey guys, I am building my first API in django and I need little help
tz
anyone here have knowledge regarding this topic?
🏳️🌈Robby [ Private Message = Spam]
🏳️🌈Robby [ Private Message = Spam]
🏳️🌈Robby [ Private Message = Spam]
tz
when I test with Postman, it works fine
🏳️🌈Robby [ Private Message = Spam]
tz
but I cant fetch data from ajax
tz
lemme send you a ss
🏳️🌈Robby [ Private Message = Spam]
🏳️🌈Robby [ Private Message = Spam]
give a paste of the error https://dpaste.de
tz
error fron console log?
🏳️🌈Robby [ Private Message = Spam]
🏳️🌈Robby [ Private Message = Spam]
Because odds are you have an error there
🏳️🌈Robby [ Private Message = Spam]
or you're making requests incorrectly
tz
Bad Request: /fetch/
[25/Apr/2019 02:55:28] "GET /fetch/ HTTP/1.1" 400 7
tz
in ajax query?
tz
var settings = {
"url": url,
"method": "GET",
"headers": {
'Accept': 'application/json',
"Content-Type": "text/plain",
},
"data": seconds,
}
$.ajax(settings).done(function (response) {
console.log(response);
});
🏳️🌈Robby [ Private Message = Spam]
in ajax query?
I don't know how your backend is setup
tz
@api_view(["GET"])
def fetch(seconds):
try:
with open('resources/backend.json') as f:
miliseconds=json.loads(seconds.body)*1000.0
data=json.load(f)
close=closest(data.keys(), miliseconds)
index=data[str(close)]
ans={"miliseconds":miliseconds, "closest":close, "index":index}
return JsonResponse(ans)
except:
return Response("error", status.HTTP_400_BAD_REQUEST)
tz
my ajax call
tz
and view
🏳️🌈Robby [ Private Message = Spam]
Looks like you're hitting an exception — figure out why
tz
any idea where to look? because i'm messing from 2 hours :(
tz
okay thanks friend
🏳️🌈Robby [ Private Message = Spam]
it's pretty bad practice to just swallow an exception like this
🏳️🌈Robby [ Private Message = Spam]
Swallowing is bad, always spit.
tz
I'm doing for first time (i'll have to google how to log actually :P)
🏳️🌈Robby [ Private Message = Spam]
Name
🏳️🌈Robby [ Private Message = Spam]
Both work
Name
Ok. Thx. Choose this way
Turtle_In_Hurry
Hello guys.
i need to keep track of(or store) all information mailed to users is there any best way to do that in django apart from saving it in a model (database)
tz
🏳️🌈Robby [ Private Message = Spam]
🏳️🌈Robby [ Private Message = Spam]
You're not sending any useful information out in addition to the 400 error response.
tz
Sorry if this is too basic question, can you please elaborate or give me some study material
🏳️🌈Robby [ Private Message = Spam]
tz
thanks a lot
🏳️🌈Robby [ Private Message = Spam]
https://docs.python.org/3/howto/logging.html#logging-basic-tutorial
Turtle_In_Hurry
Turtle_In_Hurry
oh you mean storing it into normal model would be the best option
Jimmies San
done ;)
🏳️🌈Robby [ Private Message = Spam]
tz
hey guys, I have a JS related problem but since it'd be off-topic for this group, please tell me if I can PM you...
🏳️🌈Robby [ Private Message = Spam]
tz
Ask here.
I have a json object which contains left-top and right-bottom co-ordinates of rectangular bounding box in the format [x1, y1, x2, y2] and some text. how can I make that rectangle and print the text inside it?
🏳️🌈Robby [ Private Message = Spam]
tz
Okay thanks
tz
I'm trying using canvas