[Python] Working directory structure for a Django-Python project used as an API backend only

Discussão em 'Python' iniciado por Stack, Março 1, 2025.

  1. Stack

    Stack Membro Participativo

    I'm a newbie in Django Python and I need to create an API backend for a frontend done in React. I'm forced by the customer to use Django Python, no options on this!

    The project is very simple: it needs to expose ~15 endpoints, use Django ORM to connect to a PostgreSQL database, and have basic business logic. I must have a minimum of 80% unit tests coverage of the code and expose a swagger UI.

    My problem is to create a "standard", well-defined, wisely organized structure of the working directory structure as defined by the best practice.

    In .NET I put my endpoints in the controllers, then I create the business logic with interfaces and the data layer where I have the model and the entities, so everything is all well organized and separated.

    How can I achieve a similar organization in Django?

    I've seen that some people use DRF (Django RESTful framework), is it good for my purpose? is it a best practice for projects like mine?

    Continue reading...

Compartilhe esta Página