090500
This commit is contained in:
0
main/__init__.py
Normal file
0
main/__init__.py
Normal file
3
main/admin.py
Normal file
3
main/admin.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
||||
6
main/apps.py
Normal file
6
main/apps.py
Normal file
@@ -0,0 +1,6 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class MainConfig(AppConfig):
|
||||
default_auto_field = 'django.db.models.BigAutoField'
|
||||
name = 'main'
|
||||
0
main/context_processors.py
Normal file
0
main/context_processors.py
Normal file
29
main/migrations/0001_initial.py
Normal file
29
main/migrations/0001_initial.py
Normal 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'),
|
||||
),
|
||||
]
|
||||
16
main/migrations/0002_delete_themeconfiguration.py
Normal file
16
main/migrations/0002_delete_themeconfiguration.py
Normal 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',
|
||||
),
|
||||
]
|
||||
0
main/migrations/__init__.py
Normal file
0
main/migrations/__init__.py
Normal file
1
main/models.py
Normal file
1
main/models.py
Normal file
@@ -0,0 +1 @@
|
||||
from django.db import models
|
||||
3
main/tests.py
Normal file
3
main/tests.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
13
main/urls.py
Normal file
13
main/urls.py
Normal 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
14
main/views.py
Normal 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)
|
||||
Reference in New Issue
Block a user