-
Notifications
You must be signed in to change notification settings - Fork 671
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to authenticate token from a regular view #273
Comments
You're definitely in the wrong repository, but if you go to their README, you can see instructions: https://pypi.org/project/django-easy-pdf/ Following that, add it to your url patterns and you should be good to go. Validating the session is dependent on what frontend you're using. If you're using regular HTML and JS, you definitely should not be using this repository and should be using the Django built-in session. If you are using something like Angular JS or react, you'll have to build something yourself. We have an example Angular repository, but it uses a PR for the moment. |
Thanks for your respknse. I'm using react and this auth method for DRF. Now
I have a link that takes to the backend to download a PDF.
What options do I have to authenticate the user that is already
authenticated using simple jwt, but now in the backend? I don't want to ask
the user credentials again.
…On Wed, Jul 15, 2020, 7:41 PM Andrew Chen Wang ***@***.***> wrote:
You're definitely in the wrong repository, but if you go to their README,
you can see instructions: https://pypi.org/project/django-easy-pdf/
Following that, add it to your url patterns and you should be good to go.
Validating the session is dependent on what frontend you're using. If
you're using regular HTML and JS, you definitely should not be using this
repository and should be using the Django built-in session.
If you are using something like Angular JS or react, you'll have to build
something yourself. We have an example Angular repository, but it uses a PR
for the moment.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#273 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAQK5U5XRMYGVUJSDDLOON3R3YWAVANCNFSM4O3COFHQ>
.
|
Seems like the PDF view is using Django templates (mixin)? I guess that doesn't really matter, because the person's code is two lines long: https://github.com/nigma/django-easy-pdf/blob/master/easy_pdf/views.py#L81 I suggest you try to figure this out using a regular DRF view instead of their view. Just copy and paste some of their code. Like figure out how to manually code it into the DRF view. I don't have much time to help much further, so I'll have to close this. TL;DR figure out how to copy-paste the package's view's code into a DRF view (e.g. APIView or ViewSet). |
I want the user to be able to download a PDF using easy_pdf
which has a :
from easy_pdf.views import PDFTemplateView
How can I do to validate the session from the obtained token in my view?
The text was updated successfully, but these errors were encountered: