Skip to content
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

Custom confirm template #127

Open
Sunno opened this issue Nov 25, 2015 · 5 comments
Open

Custom confirm template #127

Sunno opened this issue Nov 25, 2015 · 5 comments

Comments

@Sunno
Copy link

Sunno commented Nov 25, 2015

Hi! I'd like to know if there's a way to set a custom template, since I've been reading docs but I don't find anything related.

@blag
Copy link

blag commented Nov 26, 2015

You should be able to override provider/authorize.html template with the vanilla Django template override mechanisms. IIRC, the rest of the views simply return redirects or HTTP error codes, so there isn't much point in customizing those templates.

Please note that this project is dead - use Django OAuth Toolkit if you can. I am on mobile so please forbive me for any spelling errors and for not linking to DOT.

@Sunno
Copy link
Author

Sunno commented Nov 26, 2015

I found a way, overriding url and specifing my own template.

This line must be placed before oauth urls

url(r'^oauth2/authorize/confirm/?$', login_required(Authorize.as_view(template_name='oauth2/authorize.html'))),  # This one overrides template.
url(r'^oauth2/', include('provider.oauth2.urls', namespace='oauth2')),  # OAuth URLs

Actually I'm planning to switch to Oauth Toolkit since it has some options I need, I didn't know this project has dead. I'm using this since I found it in tastypie cookbook section.

@blag
Copy link

blag commented Nov 26, 2015

Yep, that is the vanilla Django template override mechanism. 👍

Do you remember which section of the Tastypie, cookbook section that linked here? Sounds like their documentation could use an update.

Also, the Tastypie author has expressed some concerns with the future of Tastypie, so you may want to consider using an alternative REST framework like DRF or Restless.

@Sunno
Copy link
Author

Sunno commented Nov 26, 2015

Oh, I didn't know it's called "vanilla Django template override mechanism", good to know 👍

And about cookbok, they refer to an old tutorial here

Actually we're planning to migrate to django rest framework. But I'm still making some changes using old libraries meanwhile since project owner needs to show a demo soon.

@blag
Copy link

blag commented Nov 26, 2015

It's not really called that, it's just the normal way to override templates with Django. I'll see what I can do about updating that documentation to point elsewhere. The fewer links to this (dead) project, the better.

And if anybody has the proper access, this issue can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants