|
|
|
|
|
by cjohnson318
1288 days ago
|
|
Not really, no. But it is pretty straightforward. My projects have:
- apis.py - the "external" surface of the app
- views.py - DRF layer on top of apis.py
- services.py - the layer that writes to the Django ORM
- selectors.py - provides "read-only" views or filters of data
- serializers.py - serialized outputs, using DRF
- schemas.py - pydantic classes that control incoming JSON types
- models.py - Django model declaration
- urls.py - url endpoints, pointing to views.py
- core.py - maybe another file with more business logic, used by apis.py I have had trouble using Django API Domains interfaces.py, so I left them out. The main point is, figure out the right balance of concise code and separation of concerns for your taste, and your stack. Good luck! |
|