[PYTHON] Create initial settings and staff apps in Django

Now that you have created the project, set it to Setteing.

setting.py


TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [[os.path.join(BASE_DIR, 'templates')],

I will create a folder for templates and use the templates as a storage location.

image.png

Set the language to Japanese and set the time zone to Asia Tokyo.

image.png

At this point, the basic settings have been completed. I would like to create an app from here.

First, create an app that manages your employees.

django-admin startapp staff

Now that you've created your app, don't forget to add it to your setting.py.

setting.py


INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'staff'
]

Staff django will now recognize the newly created app.

Next, add the settings to the staff app to the urls

python:config.urls.py


from django.contrib import admin
from django.urls import path, include

urlpatterns = [
    path('staff/',include('staff.urls') ),
    path('admin/', admin.site.urls),
]

Now, if the first URL is staff, it should be passed to the staff app's urls.

Next, I would like to register staff and create screens. It takes a lot of time to create an app, but I'm 40 years old and I'm growing up, dreaming of being impressed when I move and saying that it's amazing.

Recommended Posts

Create initial settings and staff apps in Django
Create and deploy Flask apps in PTVS
Django beginners create simple apps 2
django timezone and language settings
Create and list Django models
Django beginners create simple apps 5
Create an authentication feature with django-allauth and CustomUser in Django
Network settings and confirmation in CentOS7
Create and read messagepacks in Python
Create a LINE Bot in Django
WEB application development using Django [Initial settings]
Create and run embulk config in Jupyter
Udemy "Master the basics of Django and create three apps! The results of doing it"
Create a Python image in Django without a dummy image file and test the image upload
Create a Django project and application in a Python virtual environment and start the server
Automatically create word and excel reports in python
Designing URL schemes and creating templates in Django
Code often used in Python / Django apps [prefectures]
[Django3] Environment construction and various settings summary [Python3]
How to create a Rest Api in Django
Until you create a new app in Django
Flask initial settings
Models in Django
django default settings
Create a flag in settings that will be True only when testing with Django
Django + MySQL settings
Forms in Django
Django URL settings
Initial settings for using Python3.8 and pip on CentOS8
Initial settings when using the foursquare API in python
Create Amazon Linux with AWS EC2 and log in
Easy HTTP server and Systemd autostart settings in Go
Dynamically create tables in schema with Django, dynamically generate models
Get stock prices and create candlestick charts in Python
How to use Decorator in Django and how to make it
Small and nifty Vim Plugins useful in Python / Django
Daemonize and persist Python web apps in Systemd-Ubuntu 18.04.3 LTS