[PYTHON] WEB application development using Django [Application addition]

Continued from Initial Settings

Let's add an application

This time, I decided to add an application called "posts". (* It seems that it is customary to pluralize the application name.)

$ python3.6 manage.py startapp posts

Doing this will create a posts folder in the project1 folder.

Linking posts to projects

If you check the contents of apps.py created in the posts folder, it will be as follows.

apps.py



from django.apps import AppConfig


class PostsConfig(AppConfig):
    name = 'posts'

Set this PostConfig class so that it can be called from the project. Open settings.py and add it to "INSTALLED_APPS". Add it as "folder name.file name.class name".

settings.py


INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'posts.apps.PostsConfig', #Newly added line
]

(* At this time, it may be better to add ",".)

Recommended Posts

WEB application development using Django [Application addition]
WEB application development using Django [Template addition]
WEB application development using Django [Django startup]
WEB application development using Django [Model definition]
WEB application development using Django [Initial settings]
WEB application development using Django [Request processing]
WEB application development using django-Development 1-
WEB application development using Django [Admin screen creation]
WEB application development using django-Development environment construction-
Application development using SQLite with Django (PTVS)
Web application using Bottle (1)
Development of WEB application using Django [Add data from management screen]
Web application development with Flask
Web application creation with Django
(Python) Try to develop a web application using Django
Creating a web application using Flask ②
Web application development memo in python
Build a web application with Django
Creating a web application using Flask ①
Creating a web application using Flask ③
Creating a web application using Flask ④
Application development using Azure Machine Learning
Try using the web application framework Flask
Web application development in Go language_Hands-on day 1
About Cloud run + Firebase development [Web application development]
I made a WEB application with Django
First Django development
How to build an application from the cloud using the Django web framework
Until Django application creation by terminal (development environment)
Development digest with Django
Django python web framework
Build a Django development environment using pyenv-virtualenv on Mac
Django2 screen addition flow
Web application made with Python3.4 + Django (Part.1 Environment construction)
Try using Django templates.html
Tech-Circle Let's start application development using machine learning (self-study)
[Memo] Django development environment
Prepare Django development environment using homebrew on MacOSX Mavericks (10.9)
Try using the Python web framework Django (2) --Look at setting.py
Django development environment construction memo
[Django] Notes on using django-debug-toolbar
DEBUG settings when using Django
Django environment development on Windows 10
Web scraping using Selenium (Python)
Web scraping using AWS lambda
Rename an existing Django application
Web application with Python + Flask ② ③
Real-time web with Django Channels
[Remote development] Control application (Practice 2)
django project development environment construction
Web application with Python + Flask ④
Text development using Mac services
If you know Python, you can make a web application with Django
Web application created with Python + Flask (using VScode) # 1-Virtual environment construction-
Web App Development Practice: Create a Shift Creation Page with Django! (Shift creation page)
About HTTP cache when developing REST API-based web application [using GCP]
The road to web application development is a long way off
Launched a web application on AWS with django and changed jobs
Django development using virtualenv Procedures from virtual environment construction to new project / new application creation and initial settings