3

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?

1
  • After some more requirements you would create another app not project Commented Oct 16, 2019 at 12:59

4 Answers 4

6

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.

answered Oct 16, 2019 at 13:08
Sign up to request clarification or add additional context in comments.

3 Comments

Yes i am getting little bit ,but suppose its not erp project it is different Project like ...restaurants Management...there is relation between them ... then it also come under same umberella,... or again new project will be there then a new application will be there
You can reuse app only if requirement satisfy. With restaurant project you do not need sales,purchase kind of app but if any core app you have created like for authentication you can reuse them in restaurant project.
Can we create Same Rest Api Project which is not inter Linked with each Other inside the project Folder or new project need to Created
1

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']
answered Oct 16, 2019 at 13:05

Comments

0

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.

answered Oct 16, 2019 at 13:07

Comments

0

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.

answered Oct 16, 2019 at 13:13

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.