Django: best practice for splitting up project into apps [closed]

You just need to make sure your structure makes sense to you.

There’s no requirement to create a new app for every feature that is bound to another part of the project’s logic.

Reusable apps are a whole different story, their code should be unaware of the implementation to some extent.

Take a look at Django’s structure for inspiration

A possible layout for your example:

project_root/
    project/
        __init__.py
        settings.py
        urls.py
        templates/
            app1/  # override stuff
        static/
        media/
    app1/
        __init__.py
        admin/  # as a package
            __init__.py
            subjects.py
            resources.py
            # etc
        models/  # as a package
            subjects.py
            resources.py
            # etc
        managers/
            __init__.py
            subjects.py
            resources.py
            # etc
        services/
            __init__.py
            audio.py  # upload handler etc
        views/
            __init__.py
            subjects.py
        urls/
            __init__.py
            subjects.py
        templates/
            app1/
                subject_list.html  # override at project level
        static/
            app1/
                css/
                    subject.css  # override at project level
    app2/
        __init__.py
        models.py  # holds a Member model or whatever you require
    manage.py

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)