1

I am currently starting work on a existing Django Project, and I need to make changes to the existing APIs. However, I can't change the existing code since old apps and sites have been using it, which might take a lot of time to change the structure, and might break current dependencies for those. So, for now, as asked, I need to maintain separate directories to change/review the existing code and achieve a versioning-like structure for Django apps. What might be the best way/structure to achieve this?

The current structure is simple as given by django-admin startproject

project_dir
|___project_name_dir
    |___settings.py
    ...
|___app_1_dir
    |___ __init__.py
    |___ views.py, serializers.py
    ...
|___app_2_dir
    ...

So, I need to like create versioning type structure for app_1 here. What might be the best approach to do that?

1 Answers1

1

You can create a new app, called api_v2.
But generally i put all applications inside an application folder in the project_name_dir:

project_dir
|___project_name_dir
    |___settings.py
    |___applications
        |___api
            |___ __init__.py
            |___ views.py, serializers.py
        |___api_v2
            |___ __init__.py
            |___ views.py, serializers.py
        |___other_apps
            |___ __init__.py
            |___ views.py, serializers.py
Lorenzo Prodon
  • 343
  • 1
  • 8