I am very New to Python web development ,so got confuse while learning ,when we create new Project with the command --django-admin startProject 'ProjectName'
It Created a project folder in my drive and then we create application in it suppose with the name of "calculator", we start working in it ,
but after some more requirement we have to create a new different Project with the Name of the Hrms so the question arise for this again we have to run the same command django-admin startProject 'ProjectName' and then we have to create application in it or we can create in it?
-
After some more requirements you would create another app not projectArjun Shahi– Arjun Shahi2019年10月16日 12:59:54 +00:00Commented Oct 16, 2019 at 12:59
4 Answers 4
One project may have many application in it & you can create app using below code.
django-admin startapp my_new_app.
Also you can reuse same app in multiple projects.
For Hrm you should create new app instead of new project.
Example : One ERP projects may have many apps like hrm, sales, purchase, inventory etc.. & we can reuse same apps into another ERP projects also if needed.
Hope above clarifications works for you.
3 Comments
Project and apps and different see this
django-admin startproject mydjangoproject creates the project for you,
What you want to do is to create an app hrms and caculator can be apps living under umbrella of one project that is mydjangoproject
You should create apps here by django-admin startapp hrms and django-admin startapp calculator and add it to settings.py in your project folder
INSTALLED_APPS = [ #otherapps here
'hrms',
'calculator']
Comments
Start project and start app are very different commands. With the first one you create a project which will have a base structure to work on. The second command is used to create apps which you could classify as controllers. Each app will live in a folder where you will program the business logic and bind endpoints.
Comments
The app would be a new module in your project, let's say it would be a management system with human resources, financial modules, etc., so you would create an app for each of them to better organize, but nothing prevents creating everything in one app.Create a project only if it is something different.