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.
Set the language to Japanese and set the time zone to Asia Tokyo.
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