Giter VIP home page Giter VIP logo

Comments (5)

blag avatar blag commented on August 31, 2024

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.

from django-oauth2-provider.

Sunno avatar Sunno commented on August 31, 2024

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.

from django-oauth2-provider.

blag avatar blag commented on August 31, 2024

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.

from django-oauth2-provider.

Sunno avatar Sunno commented on August 31, 2024

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.

from django-oauth2-provider.

blag avatar blag commented on August 31, 2024

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.

from django-oauth2-provider.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.