This commit is contained in:
2024-05-10 09:38:31 +03:00
parent 9a5f895b93
commit 49cc44027d
81 changed files with 6093 additions and 28 deletions

0
main/__init__.py Normal file
View File

3
main/admin.py Normal file
View File

@@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

6
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 = 'main'

View File

View File

@@ -0,0 +1,29 @@
# Generated by Django 4.2.13 on 2024-05-09 19:08
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='ThemeConfiguration',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('theme', models.BooleanField(default=True, verbose_name='theme')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
migrations.AddConstraint(
model_name='themeconfiguration',
constraint=models.UniqueConstraint(fields=('user',), name='One Entry Per User'),
),
]

View File

@@ -0,0 +1,16 @@
# Generated by Django 4.2.13 on 2024-05-09 19:13
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('main', '0001_initial'),
]
operations = [
migrations.DeleteModel(
name='ThemeConfiguration',
),
]

View File

1
main/models.py Normal file
View File

@@ -0,0 +1 @@
from django.db import models

3
main/tests.py Normal file
View File

@@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

13
main/urls.py Normal file
View File

@@ -0,0 +1,13 @@
from django.urls import path, include
from rest_framework.routers import DefaultRouter
#
from main import views
from .views import MainView
#
#main_router = DefaultRouter(trailing_slash=False)
#main_router.register('main', views.MainView)
#
urlpatterns = [
path('', MainView.as_view(), name='main'),
#path('', include(main_router.urls)),
]

14
main/views.py Normal file
View File

@@ -0,0 +1,14 @@
from django.shortcuts import render
from django.views.generic import View, TemplateView
# Простое отображение страницы заглушки.
class MainView(TemplateView):
template_name = 'index.html'
def get(self, request, *args, **kwargs):
context = {
'title': 'Объявления',
"message_hello": "Тут какой-то мессадж."
}
return render(request, 'index.html', context)