Стартавая модель авторизации в приложении

This commit is contained in:
adm
2024-02-22 15:16:15 +03:00
parent bbe3fd7892
commit 645bddb07f
22 changed files with 744 additions and 1 deletions

10
system/main/admin.py Normal file
View File

@@ -0,0 +1,10 @@
from django.apps import apps
from django.contrib import admin
#
models = apps.get_models()
# код что отображает все модели всех apps
for model in models:
try:
admin.site.register(model)
except admin.sites.AlreadyRegistered:
pass

6
system/main/apps.py Normal file
View File

@@ -0,0 +1,6 @@
from django.apps import AppConfig
class MainConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'system.main'
verbose_name = 'Главное приложение'

2
system/main/models.py Normal file
View File

@@ -0,0 +1,2 @@
from django.db import models
# Создайте первую модель

2
system/main/tests.py Normal file
View File

@@ -0,0 +1,2 @@
from django.test import TestCase
# Создайте первуый тест

0
system/main/urls.py Normal file
View File

8
system/main/views.py Normal file
View File

@@ -0,0 +1,8 @@
from django.shortcuts import render
from django.views.generic import View
# Простое отображение страницы заглушки.
class MainView(View):
template_name = 'index.html'
def get(self, request):
return render(request, self.template_name)