Am Dienstag, 2. Januar 2018 13:47:40 UTC+1 schrieb Jason:
>
> What you can do is split the backend into a REST API using 
> http://www.django-rest-framework.org/
>
> Refactor the views to share common logic, and you can have your template 
> renders bound to one view handler and an api call to another.   Configure 
> your urls.py to have a url like /api/{version}/{resource/{id} mapped to an 
> API endpoint.  Since the logic is shared between the different views, 
> you'll get the same results regardless of access method.
>
> The nice part with DRF views is you can customize the permissions and 
> authentications for specific resources.
>


Yes, this (customize the permissions and authentications for specific 
resources) sounds very good.

I have other applications where this could be needed. But up to now they 
don't use DRF.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/18deac16-b856-455d-b3e8-941fffd0dde2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to