From 737fad975edb9ca80eb7aa5fc12df7e504ad85b6 Mon Sep 17 00:00:00 2001 From: Yeva Date: Fri, 22 Sep 2023 18:19:18 +0300 Subject: [PATCH 1/6] Solution --- db.sqlite3 | Bin 0 -> 176128 bytes taxi/models.py | 4 ---- taxi/urls.py | 2 +- taxi/views.py | 17 +++++++++++------ taxi_service/settings.py | 1 + taxi_service/urls.py | 1 + templates/includes/sidebar.html | 12 ++++++++++++ templates/registration/logged_out.html | 5 +++++ templates/registration/login.html | 16 ++++++++++++++++ templates/taxi/driver_list.html | 2 +- templates/taxi/index.html | 1 + 11 files changed, 49 insertions(+), 12 deletions(-) create mode 100644 db.sqlite3 create mode 100644 templates/registration/logged_out.html create mode 100644 templates/registration/login.html diff --git a/db.sqlite3 b/db.sqlite3 new file mode 100644 index 0000000000000000000000000000000000000000..66b8570a5e68c96b0f0883e60e6ecae471f40c70 GIT binary patch literal 176128 zcmeI53veUJd6;J~gZHDkd@OE{$K4@!sXZK*OAOxFtIHioV!2!r_c%U>Ift{~N>q`tUy%|BK;&JpR}Ck+idZ8_dnMyJjq9LVrbM$Iy4QowEu;J`ex` zKmZ5;0U!VbfB+Bx0zd!=00AKIeIRi08dfskb(7HXQw;iD^bgTIGI_q>d7mfh{!8~K z-5K{q*MD>Uq$}y_cYfXZF=yI&#qlNfIko%_s7S@xF7~^iJ@D8_{~r}5DmrV`muud zHWUQ9DX8q!luEgpk;?f@siJmQ7K;bOSg_B`42>qLa zv%O}a!ozVNcnsQ*8;1`Y!szJCbwBpa&on+s%ShCi6t&zRWnUh zflO1CDwisIaz?7xDnxB}6`^R*@9)7XMw=>5w?7gKhk_Fb6C7<2JflD`5Dnb%-~zb9 z_1Y!|)IeUZ;U4Lwm^&z@9NFrSKwT^W0ptg0254;ghd+2Eeqy>|qI(MWL0j5Rdcx_Pdk%_Ns3 zrFa(FpeROzcX+I%;k^Ea^R|5LTwW81#l-johc)4zMxFPJ6Gb2#h=uQ%%*^Oa!pNOq z#|=XJww|6L4R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A?TO<@$z{tJPImJ(ggdT23a?NgoKFfP z$MQ#n=SP(Mh@g~fazR#wg~hb6usT04+*_W-_W|p|TykAVtfm)d7qF&Oav^;~7|B)Y z<(hgpBJ4?O4nI@=d>|b5HH%__vQ&~!$Q4!>W|vlzK3t#P_Qp&EE#B1$mQnB{vIo`O zqEeGHQoUB8@ys#HGvcu%TUfMsXRn^BBCjfYvYH9d!dm2ou>ZWpv}0<;e6MCEtlq0v z+4q}UjiF^3lt1640W_f}Lcb$btNRrdw^)O{7>Kp8FG|%~rdTN`R0&aW$~N<90lrMQWVc!agHoM6K%UUQO&$a&oyUXUg?bmOyA=Y;)m; zlOFZow0c*3>`|OLVSY<07b=;mT&*gVaz;MbQB*lY4=IInkw7F8Y!|t%H~#Fxbn<~P z(w^D1{D`o)&?!h9#c-?<-;3iG@1pM{H}5!#*dBk+QRIfz>+`XXuT!sW&ux!gYxmvu zOk!1o#I|fW8H9{JV>pdq_ziiCOd1ht@Sw_h{WGB z#CBh}WAG~zpY{spTygH2lMZc?s-Ppjox zrgpd^Q`17(oE($0ou-YPVcJQ0PByWl#E9?JAN5(inIXW%qjF0LT>DP_U z>?b;RRkB-hu7)`@njT+guv6&Cs=QbOt za;4cpjRkZhK4F^3Ez|4m?80n%HZecHt|um^u@w#P5wZ$CNw<1H+W`z$kaH{6>r77g zUCw>Jql=^XWQLtpJDJfVxmbj@Hi%H>)c)U|&xZO=Vv%6@}9JEuA)JQuj IaR%T22k)|Spa1{> literal 0 HcmV?d00001 diff --git a/taxi/models.py b/taxi/models.py index 9061de82..14d8749a 100644 --- a/taxi/models.py +++ b/taxi/models.py @@ -16,10 +16,6 @@ def __str__(self): class Driver(AbstractUser): license_number = models.CharField(max_length=255, unique=True) - class Meta: - verbose_name = "driver" - verbose_name_plural = "drivers" - def __str__(self): return f"{self.username} ({self.first_name} {self.last_name})" diff --git a/taxi/urls.py b/taxi/urls.py index c663d6e2..bbb16a09 100644 --- a/taxi/urls.py +++ b/taxi/urls.py @@ -1,4 +1,4 @@ -from django.urls import path +from django.urls import path, include from .views import ( index, diff --git a/taxi/views.py b/taxi/views.py index 82ad312f..e44b800f 100644 --- a/taxi/views.py +++ b/taxi/views.py @@ -1,47 +1,52 @@ +from django.contrib.auth.decorators import login_required +from django.contrib.auth.mixins import LoginRequiredMixin from django.shortcuts import render from django.views import generic from .models import Driver, Car, Manufacturer +@login_required def index(request): """View function for the home page of the site.""" - num_drivers = Driver.objects.count() num_cars = Car.objects.count() num_manufacturers = Manufacturer.objects.count() + num_visits = request.session.get("num_visits", 1) + request.session["num_visits"] = num_visits + 1 context = { "num_drivers": num_drivers, "num_cars": num_cars, "num_manufacturers": num_manufacturers, + "num_visits": num_visits } return render(request, "taxi/index.html", context=context) -class ManufacturerListView(generic.ListView): +class ManufacturerListView(LoginRequiredMixin, generic.ListView): model = Manufacturer context_object_name = "manufacturer_list" template_name = "taxi/manufacturer_list.html" paginate_by = 5 -class CarListView(generic.ListView): +class CarListView(LoginRequiredMixin, generic.ListView): model = Car paginate_by = 5 queryset = Car.objects.select_related("manufacturer") -class CarDetailView(generic.DetailView): +class CarDetailView(LoginRequiredMixin, generic.DetailView): model = Car -class DriverListView(generic.ListView): +class DriverListView(LoginRequiredMixin, generic.ListView): model = Driver paginate_by = 5 -class DriverDetailView(generic.DetailView): +class DriverDetailView(LoginRequiredMixin, generic.DetailView): model = Driver queryset = Driver.objects.prefetch_related("cars__manufacturer") diff --git a/taxi_service/settings.py b/taxi_service/settings.py index b6c0cf19..050808a8 100644 --- a/taxi_service/settings.py +++ b/taxi_service/settings.py @@ -107,6 +107,7 @@ ] AUTH_USER_MODEL = "taxi.Driver" +LOGIN_REDIRECT_URL = "/" # Internationalization # https://docs.djangoproject.com/en/4.0/topics/i18n/ diff --git a/taxi_service/urls.py b/taxi_service/urls.py index 8b94449f..0facf5ec 100644 --- a/taxi_service/urls.py +++ b/taxi_service/urls.py @@ -22,4 +22,5 @@ urlpatterns = [ path("admin/", admin.site.urls), path("", include("taxi.urls", namespace="taxi")), + path("accounts/", include("django.contrib.auth.urls",)) ] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) diff --git a/templates/includes/sidebar.html b/templates/includes/sidebar.html index b7cd72dc..b13623ca 100644 --- a/templates/includes/sidebar.html +++ b/templates/includes/sidebar.html @@ -1,4 +1,16 @@ diff --git a/templates/taxi/index.html b/templates/taxi/index.html index 13c59aa8..549801ae 100644 --- a/templates/taxi/index.html +++ b/templates/taxi/index.html @@ -10,4 +10,5 @@

Dynamic content

  • Drivers: {{ num_drivers }}
  • Manufacturers: {{ num_manufacturers }}
  • +

    You have visited this page {{ num_visits }} time{{ num_visits|pluralize }}

    {% endblock %} From 9b828c9e0072c4db19fb66d213fbf13d8f24f1dc Mon Sep 17 00:00:00 2001 From: Yeva Date: Fri, 22 Sep 2023 18:22:42 +0300 Subject: [PATCH 2/6] Added db in gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index b26d6116..b9b230d8 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ venv/ .pytest_cache/ **__pycache__/ +db.sqlite3 From 44bea059258cf8e9dfb54e95694e85ba3130e0ad Mon Sep 17 00:00:00 2001 From: Yeva Date: Fri, 22 Sep 2023 18:23:30 +0300 Subject: [PATCH 3/6] Added db in gitignore --- db.sqlite3 | Bin 176128 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 db.sqlite3 diff --git a/db.sqlite3 b/db.sqlite3 deleted file mode 100644 index 66b8570a5e68c96b0f0883e60e6ecae471f40c70..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 176128 zcmeI53veUJd6;J~gZHDkd@OE{$K4@!sXZK*OAOxFtIHioV!2!r_c%U>Ift{~N>q`tUy%|BK;&JpR}Ck+idZ8_dnMyJjq9LVrbM$Iy4QowEu;J`ex` zKmZ5;0U!VbfB+Bx0zd!=00AKIeIRi08dfskb(7HXQw;iD^bgTIGI_q>d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3Ez|4m?80n%HZecHt|um^u@w#P5wZ$CNw<1H+W`z$kaH{6>r77g zUCw>Jql=^XWQLtpJDJfVxmbj@Hi%H>)c)U|&xZO=Vv%6@}9JEuA)JQuj IaR%T22k)|Spa1{> From af5dd2e73b0055b7cfda203bc3b595ed13963a4c Mon Sep 17 00:00:00 2001 From: Yeva Date: Fri, 22 Sep 2023 18:24:39 +0300 Subject: [PATCH 4/6] Added blank line in html --- templates/registration/logged_out.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/registration/logged_out.html b/templates/registration/logged_out.html index 69afc196..a0990e53 100644 --- a/templates/registration/logged_out.html +++ b/templates/registration/logged_out.html @@ -2,4 +2,4 @@ {% block content %}

    Logged out

    Click here to log in again -{% endblock %} \ No newline at end of file +{% endblock %} From ea5c81f339297d0fdf848ab35d9badbb72865b31 Mon Sep 17 00:00:00 2001 From: Yeva Date: Fri, 22 Sep 2023 19:37:15 +0300 Subject: [PATCH 5/6] Fixed num of visits --- ...ons_alter_manufacturer_options_and_more.py | 31 +++++++++++++++++++ ...002_alter_manufacturer_options_and_more.py | 22 ------------- .../0003_alter_manufacturer_name.py | 18 ----------- taxi/views.py | 4 +-- 4 files changed, 33 insertions(+), 42 deletions(-) create mode 100644 taxi/migrations/0002_alter_driver_options_alter_manufacturer_options_and_more.py delete mode 100644 taxi/migrations/0002_alter_manufacturer_options_and_more.py delete mode 100644 taxi/migrations/0003_alter_manufacturer_name.py diff --git a/taxi/migrations/0002_alter_driver_options_alter_manufacturer_options_and_more.py b/taxi/migrations/0002_alter_driver_options_alter_manufacturer_options_and_more.py new file mode 100644 index 00000000..f88f8f3d --- /dev/null +++ b/taxi/migrations/0002_alter_driver_options_alter_manufacturer_options_and_more.py @@ -0,0 +1,31 @@ +# Generated by Django 4.1 on 2023-09-22 16:36 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("taxi", "0001_initial"), + ] + + operations = [ + migrations.AlterModelOptions( + name="driver", + options={"verbose_name": "user", "verbose_name_plural": "users"}, + ), + migrations.AlterModelOptions( + name="manufacturer", + options={"ordering": ["name"]}, + ), + migrations.AlterField( + model_name="driver", + name="license_number", + field=models.CharField(max_length=255, unique=True), + ), + migrations.AlterField( + model_name="manufacturer", + name="name", + field=models.CharField(max_length=255, unique=True), + ), + ] diff --git a/taxi/migrations/0002_alter_manufacturer_options_and_more.py b/taxi/migrations/0002_alter_manufacturer_options_and_more.py deleted file mode 100644 index a056822c..00000000 --- a/taxi/migrations/0002_alter_manufacturer_options_and_more.py +++ /dev/null @@ -1,22 +0,0 @@ -# Generated by Django 4.0.2 on 2022-04-12 06:44 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('taxi', '0001_initial'), - ] - - operations = [ - migrations.AlterModelOptions( - name='manufacturer', - options={'ordering': ['name']}, - ), - migrations.AlterField( - model_name='driver', - name='license_number', - field=models.CharField(max_length=255, unique=True), - ), - ] diff --git a/taxi/migrations/0003_alter_manufacturer_name.py b/taxi/migrations/0003_alter_manufacturer_name.py deleted file mode 100644 index 806cc0e6..00000000 --- a/taxi/migrations/0003_alter_manufacturer_name.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 4.0.2 on 2022-06-16 07:46 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('taxi', '0002_alter_manufacturer_options_and_more'), - ] - - operations = [ - migrations.AlterField( - model_name='manufacturer', - name='name', - field=models.CharField(max_length=255, unique=True), - ), - ] diff --git a/taxi/views.py b/taxi/views.py index e44b800f..4adabdff 100644 --- a/taxi/views.py +++ b/taxi/views.py @@ -12,14 +12,14 @@ def index(request): num_drivers = Driver.objects.count() num_cars = Car.objects.count() num_manufacturers = Manufacturer.objects.count() - num_visits = request.session.get("num_visits", 1) + num_visits = request.session.get("num_visits", 0) request.session["num_visits"] = num_visits + 1 context = { "num_drivers": num_drivers, "num_cars": num_cars, "num_manufacturers": num_manufacturers, - "num_visits": num_visits + "num_visits": request.session["num_visits"] } return render(request, "taxi/index.html", context=context) From 3e588991f52e38904a277d49e9fd38d19a55bdd5 Mon Sep 17 00:00:00 2001 From: Yeva Date: Fri, 22 Sep 2023 19:40:01 +0300 Subject: [PATCH 6/6] Removed redundant import --- taxi/urls.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/taxi/urls.py b/taxi/urls.py index bbb16a09..c663d6e2 100644 --- a/taxi/urls.py +++ b/taxi/urls.py @@ -1,4 +1,4 @@ -from django.urls import path, include +from django.urls import path from .views import ( index,