pythondjangoreactjsdatabaserest

Does Full-Stack Web Development Violate DRY?


I'm planning on using Django with ReactJS to build a GUI for a complicated database. In order to have features such as auto-completing searching for particular fields, etc, I suppose that using JavaScript is necessary. Is there a way to reuse the models that I made in Python so I don't have to repeat a bunch of code in writing the Django serializers for a REST API and in the models in ReactJS?


Solution

  • After talking with others who know more than I, I am letting the React frontend be fairly minimal: it will know how to display the data sent to it via Django Channels json packets. The Django backend will handle all the rest (including much of the logic of knowing which pages are accessible from various parts of the database). Thus, the frontend will need minimal knowledge of the structure of the database, and that will preserve the DRY principle.