Thursday, May 1, 2014

Structuring an API in a large project

Right now I have a large project with an equally large API (done using django rest framework). The current structure is something like this:

api
|-----urls.py
|-----models.py
|
----v1
    |-----views.py
    |-----serializers.py
    |-----permissions.py
    |-----tests.py

etc

As you can guess, the views.py file is pretty big and I want to refactor this out. Currently I have a few options in front of me, the one I'm leaning towards is to put an 'api/v1' package into each app and use the api app to tie all the urls together and hold views that don't fall into an app.

Does anyone have any experience with this and could provide guidance?

--
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 django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/defbe442-be5f-48d2-a402-fe984a7c4638%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment