How to Create a Django Application inside a Django Project in Microsoft Windows

Posted on

Introduction

So, this article will focus on how to create a Django application. Literally, it is a starter application as a foundation for further steps. So, in order to develop the application further, it need an initial template as a starter. It will contain necessary folder and files to develop the application further. So, before going on to the process for creating a Django application, actually there are several necessary steps to achieve it as a preparation. This article will display on how to create it within a local device running using Microsoft Windows. Below are those preparation steps :

  1. First step, python is the foremost important requirement. So, install python as the first step. Read How to Install Python in Microsoft Windows, How to Install Python 3.10 in Microsoft Windows or How to Install Python in Microsoft Windows 11

  2. Successfully getting python exist in the local device, install ‘pip’ tool in the following after. For an information along that subject, just access How to Install pip in Microsoft Windows or How to Install pip in Microsoft Windows 11 in order to be able to do it.

  3. Following after where it is an optional step is creating a python virtual environment. It is also possible to just continue on without it. But for the sake of being in order and in a specific containment exist in a specific location, just create it. It is an environment where it will store and place all the necessary python libraries as a preparation. The step for performing it exist in How to Create Python Virtual Environment from Anaconda in Microsoft Windows, How to Create a Python Virtual Environment with a specific version of Python in Microsoft Windows or How to Specify Specific Python Version for Creating a Virtual Python Environment in Microsoft Windows.

  4. Next, install the Django library. As a reference, look in How to Install Django in Microsoft Windows.
  5. Continue on the process, create a Django project where the process exist in How to Create Django Project in Microsoft Windows using Command Line.

How to Create a Django Application inside a Django Project in Microsoft Windows

Finally, getting in to the important part for creating Django application. Below is the situation Since it is using Microsoft Windows where the process will be using a Command Line Interface, it will use Command Prompt in this context. Below is the current situation after finishing the preparation steps as exist above. It is the continuation of the article How to Create Django Project in Microsoft Windows using Command Line. The appearance exist in the Command Line below continuing by creating a Django application :

(env) C:\django\myproject>django-admin startapp myapp

(env) C:\django\myproject>

As in the above output, the process for creating Django application is by typing ‘django-admin startapp application_name’. Where in the above example, the application_name is ‘myapp’.

Continue on further, just get into the project folder for diving in into the new created Django application in order to make sure as follows :

(env) C:\django\myproject>dir
Volume in drive C is Windows-SSD
Volume Serial Number is CA30-19A4

Directory of C:\django\myproject

10/22/2022 06:59 AM <DIR> .
10/21/2022 10:51 PM <DIR> ..
10/21/2022 10:51 PM 687 manage.py
10/22/2022 06:59 AM <DIR> myapp
10/21/2022 10:51 PM <DIR> myproject
1 File(s) 687 bytes
4 Dir(s) 545,316,864 bytes free

(env) C:\django\myproject>cd myapp

Finally, since the folder representing the Django application exist as in the output above in the folder with the name ‘myapp’, just get into that folder further for more checking process :

(env) C:\django\myproject\myapp>dir
Volume in drive C is Windows-SSD
Volume Serial Number is CA30-19A4

Directory of C:\django\myproject\myapp

10/22/2022 06:59 AM <DIR> .
10/22/2022 06:59 AM <DIR> ..
10/22/2022 06:59 AM 66 admin.py
10/22/2022 06:59 AM 148 apps.py
10/22/2022 06:59 AM <DIR> migrations
10/22/2022 06:59 AM 60 models.py
10/22/2022 06:59 AM 63 tests.py
10/22/2022 06:59 AM 66 views.py
10/22/2022 06:59 AM 0 __init__.py
6 File(s) 403 bytes
3 Dir(s) 545,251,328 bytes free

(env) C:\django\myproject\myapp>

Leave a Reply