OceanWP

Django create app

Estimated reading: 2 minutes

What is a Django app?

A Django app is a self-contained package that contains all the code necessary for a specific feature or functionality of a web application. Django apps are designed to be pluggable, so you can use them in multiple projects and reuse them across projects.

For example, you might create a Django app for handling user authentication, or for managing a blog. You can then include this app in any Django project by adding it to the INSTALLED_APPS list in the project’s settings file.

The main advantage of using Django apps is that they allow you to modularize your code, making it easier to maintain and reuse. This can save a lot of time and effort when building large web applications.

How to create a Django app?

You can create a new app by running the following command:


python manage.py startapp myapp

This will create a new directory called myapp with the following structure:


myapp/
├── __init__.py
├── admin.py
├── apps.py
├── migrations/
│   └── __init__.py
├── models.py
├── tests.py
└── views.py

After creating an app on Django next step is to add your created app name in the INSTALLED_APPS lists in your project’s settings.py file


INSTALLED_APPS = [    ...    'myapp',]

That’s it! You have created a Django app and next tutorial we can look how to create Django views

Publisher
Share this tutorial