[Fixed]-Django – Determining how to split into apps based on functionality

1πŸ‘

βœ…

The concept of app in Django is that it does thing. For example if you are creating a website for school you have students as an app which manages students, an app for exams which only manages exams, grades etc. So your app should typically do one thing, if it does not break it down. The whole idea behind Django is having modular components which can act on their own.

In your case, what I would do is create an app called userapp. In userapp, I will have profile as a model containing username, password, fname, lname, picture, dob, hobbies etc.

On your home page, you can have separate flatpages for about us, how it works. These do not have to be app.

My project structure

β”œβ”€β”€β”€.idea
β”œβ”€β”€β”€firstapp
β”‚   β”œβ”€β”€β”€migrations
β”‚   β”‚   └───__pycache__
β”‚   └───__pycache__
β”œβ”€β”€β”€myproj
β”‚   └───__pycache__
β”œβ”€β”€β”€secondapp
β”‚   β”œβ”€β”€β”€migrations
β”‚   β”‚   └───__pycache__
β”‚   └───__pycache__
β”œβ”€β”€β”€static
β”‚   β”œβ”€β”€β”€admin
β”‚   β”‚   β”œβ”€β”€β”€css
β”‚   β”‚   β”œβ”€β”€β”€fonts
β”‚   β”‚   β”œβ”€β”€β”€img
β”‚   β”‚   β”‚   └───gis
β”‚   β”‚   └───js
β”‚   β”‚       β”œβ”€β”€β”€admin
β”‚   β”‚       └───vendor
β”‚   β”‚           β”œβ”€β”€β”€jquery
β”‚   β”‚           └───xregexp
β”‚   β”œβ”€β”€β”€css
β”‚   β”œβ”€β”€β”€fonts
β”‚   β”œβ”€β”€β”€img
β”‚   └───js
└───templates
    └───firstapp
πŸ‘€nomad

Leave a comment