<div dir="ltr">I've used the following on a few projects with success:<div><br></div><div><div style="font-family:arial,sans-serif;font-size:13px">api</div><div style="font-family:arial,sans-serif;font-size:13px">|-----urls.py</div>
<div style="font-family:arial,sans-serif;font-size:13px">|-----models.py</div><div style="font-family:arial,sans-serif;font-size:13px">|</div></div><div><div class="gmail_extra"><span style="font-family:arial,sans-serif;font-size:13px">----resources</span><br>
</div><div class="gmail_extra"><span style="font-family:arial,sans-serif;font-size:13px">    |-----users.py</span><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div class="gmail_extra"><span style="font-family:arial,sans-serif;font-size:13px">    |-----things.py</span></div>
<div class="gmail_extra"><span style="font-family:arial,sans-serif;font-size:13px">    |-----...</span></div><div class="gmail_extra"><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div class="gmail_extra">
<font face="arial, sans-serif">One resource module that contains serializers and views per top-level api resource. Most resource modules end up being under 50-100 lines of code. I prefer this approach over api modules in my apps as I find my rest resources don't always fit cleanly one-to-one with my app structure.</font></div>
<div class="gmail_extra"><font face="arial, sans-serif"><br></font></div><div class="gmail_extra"><font face="arial, sans-serif">- Sean</font></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, May 1, 2014 at 11:18 AM, Adam "Cezar" Jenkins <span dir="ltr"><<a href="mailto:emperorcezar@gmail.com" target="_blank">emperorcezar@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div>This is also on Stackoverflow: <a href="http://stackoverflow.com/questions/23411571/structuring-a-large-api-in-a-django-project" target="_blank">http://stackoverflow.com/questions/23411571/structuring-a-large-api-in-a-django-project</a></div>

<div><br></div><div>Right now I have a large project with an equally large API (done using django rest framework). The current structure is something like this:</div><div><br></div><div>api</div><div>|-----urls.py</div><div>

|-----models.py</div><div>|</div><div>----v1</div><div>    |-----views.py</div><div>    |-----serializers.py</div><div>    |-----permissions.py</div><div>    |-----tests.py</div><div><br></div><div>etc</div><div><br></div>

<div>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.</div>

<div><br></div><div>Does anyone have any experience with this and could provide guidance?</div></div>
<br>_______________________________________________<br>
Chicago mailing list<br>
<a href="mailto:Chicago@python.org">Chicago@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/chicago" target="_blank">https://mail.python.org/mailman/listinfo/chicago</a><br>
<br></blockquote></div><br></div></div></div>