Sunday, May 30, 2021

Re: Business logic constants

There are many types of constants. We have a 'utils' directory (at same level as 'apps') and under that 'constants' sub-directory - with different files for different types of constants that are generally applicable across all apps.  But because we have lots of client-specific constants and coding of their business rules, those sit under their own structure elsewhere.  Using imports though, makes it relatively easier to reorganise over time if you need to.

The Django settings file is really only for constants related to starting up the program itself (and in our case a single flag to track who the client is). 

On Sunday, 30 May 2021 at 13:17:10 UTC+2 ypolo...@gmail.com wrote:
When working with business logic implementation code and you do not want use magic numbers in the code - where is the best place to put all those CONSTANTS ? Django settings file ?

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/0ea0826a-e313-43f5-b65b-e488cfd194b3n%40googlegroups.com.

No comments:

Post a Comment