Answer the question
In order to leave comments, you need to log in
Is it correct to modify sys.path to suit the Django project structure?
I want to change the structure of my project to a similar one ( https://github.com/rdegges/django-skel ), that is, where all the applications are in the "apps" package. But I don't want to have "apps.*.", "apps.model.*" imports everywhere in the code Is it
correct to add to settings.py? That is, modify the search paths?
sys.path.append(os.path.normpath(os.path.join(BASE_DIR, 'src/apps')))
Answer the question
In order to leave comments, you need to log in
In one of my projects, I ventured to do this, but a little differently:
├── src
│ ├── main_app_name
│ ├── first_app
│ ├── second_app
│ └── third_app
├── manage.py
├── requirements.txt
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question