Creating Our First App - Step 4
In the last blog post we've successfully created Django project today we are going to create our first app.In Django each section is know as app such as Home,Contact etc which is part of your website.
To create an App we are going to use manage.py commands.I an using the same project which we have created in the last blog.
Steps
Happy coding and keep sharing !!!!
To create an App we are going to use manage.py commands.I an using the same project which we have created in the last blog.
Steps
- Its very easy go ahead and navigate to the Dir. and run
- python manage.py startapp MyFirstApp
- Now lets go and check our project and see the change above command has made in the project structure.
- We can see now we have new directory MyFirstApp and its come with bunch of files.
- Lets go through the files
- Whenever Django create an App it gave us files and a directory by default.
- Migrations folder:- Are is a way to connect website with Database
- Admin.py:- where you can do all admin tasks comes with admin section will see later.
- App.py:- Is your configuration file.
- Models.py:- We create blueprint of Database in model.py
- Test.py:- Is used to create test case.
- Views.py:- In views we create function which take user request and return response(HTLM).
Happy coding and keep sharing !!!!
Comments
Post a Comment