├── blog ├── __init__.py ├── __pycache__ │ ├── urls.cpython-37.pyc │ ├── wsgi.cpython-37.pyc │ ├── __init__.cpython-37.pyc │ └── settings.cpython-37.pyc ├── urls.py ├── asgi.py ├── wsgi.py └── settings.py ├── core ├── __init__.py ├── migrations │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-37.pyc │ │ ├── 0001_initial.cpython-37.pyc │ │ └── 0002_osimlik.cpython-37.pyc │ ├── 0002_osimlik.py │ └── 0001_initial.py ├── tests.py ├── __pycache__ │ ├── apps.cpython-37.pyc │ ├── urls.cpython-37.pyc │ ├── admin.cpython-37.pyc │ ├── models.cpython-37.pyc │ ├── views.cpython-37.pyc │ └── __init__.cpython-37.pyc ├── admin.py ├── urls.py ├── apps.py ├── views.py └── models.py ├── db.sqlite3 ├── manage.py └── frontend └── index.html /blog/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /core/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /core/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /db.sqlite3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shahnozahaydarova/Django/HEAD/db.sqlite3 -------------------------------------------------------------------------------- /core/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /blog/__pycache__/urls.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shahnozahaydarova/Django/HEAD/blog/__pycache__/urls.cpython-37.pyc -------------------------------------------------------------------------------- /blog/__pycache__/wsgi.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shahnozahaydarova/Django/HEAD/blog/__pycache__/wsgi.cpython-37.pyc -------------------------------------------------------------------------------- /core/__pycache__/apps.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shahnozahaydarova/Django/HEAD/core/__pycache__/apps.cpython-37.pyc -------------------------------------------------------------------------------- /core/__pycache__/urls.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shahnozahaydarova/Django/HEAD/core/__pycache__/urls.cpython-37.pyc -------------------------------------------------------------------------------- /core/__pycache__/admin.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shahnozahaydarova/Django/HEAD/core/__pycache__/admin.cpython-37.pyc -------------------------------------------------------------------------------- /core/__pycache__/models.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shahnozahaydarova/Django/HEAD/core/__pycache__/models.cpython-37.pyc -------------------------------------------------------------------------------- /core/__pycache__/views.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shahnozahaydarova/Django/HEAD/core/__pycache__/views.cpython-37.pyc -------------------------------------------------------------------------------- /core/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from .models import * 3 | 4 | admin.site.register((Gul, Rang, Osimlik)) 5 | 6 | 7 | -------------------------------------------------------------------------------- /blog/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shahnozahaydarova/Django/HEAD/blog/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /blog/__pycache__/settings.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shahnozahaydarova/Django/HEAD/blog/__pycache__/settings.cpython-37.pyc -------------------------------------------------------------------------------- /core/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shahnozahaydarova/Django/HEAD/core/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /core/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | from .views import HomeView 3 | 4 | urlpatterns = [ 5 | path('',HomeView.as_view()) 6 | ] 7 | -------------------------------------------------------------------------------- /core/migrations/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shahnozahaydarova/Django/HEAD/core/migrations/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /core/migrations/__pycache__/0001_initial.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shahnozahaydarova/Django/HEAD/core/migrations/__pycache__/0001_initial.cpython-37.pyc -------------------------------------------------------------------------------- /core/migrations/__pycache__/0002_osimlik.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shahnozahaydarova/Django/HEAD/core/migrations/__pycache__/0002_osimlik.cpython-37.pyc -------------------------------------------------------------------------------- /core/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class CoreConfig(AppConfig): 5 | default_auto_field = 'django.db.models.BigAutoField' 6 | name = 'core' 7 | -------------------------------------------------------------------------------- /core/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | from django.views.generic import TemplateView 3 | 4 | class HomeView(TemplateView): 5 | template_name = 'index.html' 6 | -------------------------------------------------------------------------------- /blog/urls.py: -------------------------------------------------------------------------------- 1 | 2 | from django.contrib import admin 3 | from django.urls import path,include 4 | 5 | urlpatterns = [ 6 | path('admin/', admin.site.urls), 7 | path('',include('core.urls')) 8 | ] 9 | -------------------------------------------------------------------------------- /blog/asgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | ASGI config for blog project. 3 | 4 | It exposes the ASGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.2/howto/deployment/asgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.asgi import get_asgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'blog.settings') 15 | 16 | application = get_asgi_application() 17 | -------------------------------------------------------------------------------- /blog/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for blog project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'blog.settings') 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /core/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | class Rang(models.Model): 4 | nomi = models.CharField(max_length=20) 5 | 6 | def __str__(self) -> str: 7 | return self.nomi 8 | 9 | class Gul(models.Model): 10 | nomi = models.CharField(max_length=20) 11 | rangi = models.ForeignKey(Rang, on_delete=models.SET_NULL, null=True) 12 | 13 | def __str__(self) -> str: 14 | return self.nomi 15 | 16 | class Osimlik(models.Model): 17 | nomi = models.CharField(max_length=20) 18 | rangi = models.ForeignKey(Rang, on_delete=models.CASCADE) 19 | 20 | def __str__(self) -> str: 21 | return self.nomi -------------------------------------------------------------------------------- /manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """Django's command-line utility for administrative tasks.""" 3 | import os 4 | import sys 5 | 6 | 7 | def main(): 8 | """Run administrative tasks.""" 9 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'blog.settings') 10 | try: 11 | from django.core.management import execute_from_command_line 12 | except ImportError as exc: 13 | raise ImportError( 14 | "Couldn't import Django. Are you sure it's installed and " 15 | "available on your PYTHONPATH environment variable? Did you " 16 | "forget to activate a virtual environment?" 17 | ) from exc 18 | execute_from_command_line(sys.argv) 19 | 20 | 21 | if __name__ == '__main__': 22 | main() 23 | -------------------------------------------------------------------------------- /core/migrations/0002_osimlik.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.16 on 2022-12-14 14:43 2 | 3 | from django.db import migrations, models 4 | import django.db.models.deletion 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | dependencies = [ 10 | ('core', '0001_initial'), 11 | ] 12 | 13 | operations = [ 14 | migrations.CreateModel( 15 | name='Osimlik', 16 | fields=[ 17 | ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 18 | ('nomi', models.CharField(max_length=20)), 19 | ('rangi', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.rang')), 20 | ], 21 | ), 22 | ] 23 | -------------------------------------------------------------------------------- /core/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.16 on 2022-12-14 14:34 2 | 3 | from django.db import migrations, models 4 | import django.db.models.deletion 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | initial = True 10 | 11 | dependencies = [ 12 | ] 13 | 14 | operations = [ 15 | migrations.CreateModel( 16 | name='Rang', 17 | fields=[ 18 | ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 19 | ('nomi', models.CharField(max_length=20)), 20 | ], 21 | ), 22 | migrations.CreateModel( 23 | name='Gul', 24 | fields=[ 25 | ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 26 | ('nomi', models.CharField(max_length=20)), 27 | ('rangi', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='core.rang')), 28 | ], 29 | ), 30 | ] 31 | -------------------------------------------------------------------------------- /frontend/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 |