Django Bot
>> Links - NewbieMistakes – Django - How not to structure your database-backed web applications: a study of perf
Django Bot
>> Links - Molo’s documentation
Django Bot
>> Links - Django Newbie Mistakes | Hacker News
NRC
How to create chatting web app using django.. any documentation or tutorial
Jimmies San
How to create chatting web app using django.. any documentation or tutorial
first result on google https://gearheart.io/blog/creating-a-chat-with-django-channels/
Jimmies San
an updated one https://danidee10.github.io/2018/01/01/realtime-django-1.html
Django Bot
>> Links - Painless PostgreSQL + Django – agatha – Medium
syam
Any completed projects in git with auth0 authentication.
Anonymous
Any completed projects in git with auth0 authentication.
How will you convert your django project to apk
syam
Why do I need to convert to apk
syam
I only want to integrate auth0 authentication system to my Django project
Anonymous
Why do I need to convert to apk
I meant, if you made an app using django How will you convert it to apk
syam
I don't know. Haven't tried it. Yet
Anonymous
I don't know. Haven't tried it. Yet
Oh thanks anyways, friend
syam
You are welcome
Anonymous
Hi, I'm writing a django rest web app and react js for frontend I'm using django-rest-auth and it's provide this link for me http://127.0.0.1:8000/api/accounts/registration/account-confirm-email/MTQ:1fYZdp:8XswQnA4_gXVMNjkesqk9CwMBnI/ I need to get this MTQ:1fYZdp:8XswQnA4_gXVMNjkesqk9CwMBnI and show it in a box of react js application do you have any point of view about it?
Django Bot
>> Links - Obey The Testing Goat
Django Bot
>> Links - NewbieMistakes – Django
Django Bot
>> Links - NewbieMistakes – Django
Django Bot
>> Links - How to Structure Django Projects | James Beith - MicroPyramid/django-webpacker: A django compressor tool that bundles css, j - PixxxeL/django-ffmpeg: Download and encode video files by using ffmpeg util - GitHub - squ1b3r/Djaneiro: Django support for Sublime Text 2/3 - Django and Sublime Text 3 (Example) - The Book - Obey the Testing Goat!
Django Bot
>> Links - Django Newbie Mistakes | Hacker News
Django Bot
>> Links - Django documentation | Django documentation | Django - The Book - NewbieMistakes – Django
Django Bot
>> Links - NewbieMistakes – Django
N S
Does modelformset factory work for foriegn key fields
inchidi
thats what make it different with modelform factory tbh
N S
Initially i get the form containing the values from the queryset in the formset but after submit the data in the fields becomes blank and says that this field is required.
inchidi
why you got warning on objects there? is Marklist valid class model name?
N S
Yes
inchidi
how its looks like?
N S
I will show wait a second
N S
wait a minute
Robert
How would you make a file download after a model form is submitted? I know how to add a file to a response object and make the download dialog pop up in an on click event, but you can only have one response object returned per request. On submit in JavaScript happens before the form is submitted. And I need data from the model instance in the file.
Robert
mind to elaborate the last part?
I have a model form. When I submit the form, the view creates some objects in related models. Currently, after the redirect of the form submission, the users have to click a download button to get a CSV of the data created from the form submission. The users want one less click, so I must download the file either right before it right after the redirect
inchidi
i wont download that tho. use dpaste.de or pastebin etc
Anonymous
isnt it link sent to user by email after registration?
yes it is, thank you i was asked from my friends and they helped me
inchidi
which code do i need to show you
just Marklist class enough i think
Robert
inchidi
Currently it's a file response object in memory.
then you can store it somewhere as media and then you can redirect to the link of that new media
Robert
then you can store it somewhere as media and then you can redirect to the link of that new media
Can I had a callback or something to pass the file url to the absolute url of the model instance?
N S
are you sure you update the object instead create new object?
i found this code in the video which updates the field this way but it is not happening
inchidi
you can use HTTPResponseRedirect for the http response and to get url string of the media just simply concat settings.MEDIA_ROOT with TheModel.objects.last().media_field
inchidi
the if request.method == 'POST': part pretty important here, you should not comment it out
N S
ok but it is not updating
inchidi
but the error should be different, not this field is required
N S
but the error should be different, not this field is required
no change this field is required is coming
N S
https://www.youtube.com/watch?v=we8-83hzTpk i used this video to do that
Anonymous
I created a custom user for my application but when i want to get self.request.user in rest i got this error: ValueError: Cannot assign "<django.contrib.auth.models.AnonymousUser object at 0x109ead278>": "UploadFile.user" must be a "CustomUser" instance. i searched about it but i can't find what's going wrong do you have any idea?
Code9
def save(self, *args, **kwargs): self.user = CustomUser(user) return super.save(*args, **kwargs)
Code9
try casting your user? (haven't tested the code)
Anonymous
coz the user not authenticated yet
🤔yes but should i change AnonymousUser model to my custom user?
Anonymous
try casting your user? (haven't tested the code)
should i pass user to save function?
Code9
what's the custom user?
inchidi
🤔yes but should i change AnonymousUser model to my custom user?
AnonymousUser != User its a class that implement user interface you must authenticate your user to get user model in your request
Anonymous
coz the user not authenticated yet
i'm using django-rest-allauth and tring this: authentication_classes = (TokenAuthentication,) for my class and i sent token to it but it's not authenticated, why this happend?
Anonymous
what's the custom user?
🤔 wait i will send link of pastebin
Anonymous
what's the custom user?
https://pastebin.com/qvh0jHVS
Anonymous
Anonymous
inchidi
django-rest-auth :D sorry
where you put the token on your request? Authentication header right?
Anonymous
where you put the token on your request? Authentication header right?
🤔 i'm using postman and try token in authentication section by bearer token but i got that error again 😐
inchidi
what type bearer you are using? like this Authorization: Basic YWxhZGRpbjpvcGVuc2VzYW1l or Authorization: TOKEN YWxhZGRpbjpvcGVuc2VzYW1l or Authorization: JWT YWxhZGRpbjpvcGVuc2VzYW1l?
Anonymous
what type bearer you are using? like this Authorization: Basic YWxhZGRpbjpvcGVuc2VzYW1l or Authorization: TOKEN YWxhZGRpbjpvcGVuc2VzYW1l or Authorization: JWT YWxhZGRpbjpvcGVuc2VzYW1l?
🤔 i think i was using this wrong it's work ok when i just add TOKEN to it but i was saw that postman add this it self am i wrong?
inchidi
🤔 i think i was using this wrong it's work ok when i just add TOKEN to it but i was saw that postman add this it self am i wrong?
hmm i never use postman tbh but with curl your request should looks like this curl -i -X GET -H "Content-Type: application/json" -H "Authorization: TOKEN YWxhZGRpbjpvcGVuc2VzYW1l" -s http://localhost:8000/api/location
Anonymous
hmm i never use postman tbh but with curl your request should looks like this curl -i -X GET -H "Content-Type: application/json" -H "Authorization: TOKEN YWxhZGRpbjpvcGVuc2VzYW1l" -s http://localhost:8000/api/location
yes you are right thank you very much :) but i need to handle AnonymousUser by the way do you have any idea? when i use this self.request.user i got error so i can't check anonymous user like this way