diff --git a/README.md b/README.md index 7d19161..4be70bf 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ pip --version ```powershell python -m venv venv -# Активация (нужно делать каждый раз при работе с проектом) +# Активация venv\Scripts\activate ``` После активации в начале строки появится (venv) @@ -39,7 +39,7 @@ venv\Scripts\activate ### 3. Установка зависимостей ```powershell -# Обнови pip (рекомендуется) +# Обнови pip python -m pip install --upgrade pip # или .\venv\Scripts\python.exe -m pip install --upgrade pip @@ -54,7 +54,7 @@ pip install pip install Django==5.2.11 # Применить миграции (создать/обновить таблицы в базе) python manage.py migrate -# (Опционально) Создать суперпользователя для админки +# Создать суперпользователя для админки python manage.py createsuperuser # → введи username, email и пароль diff --git a/autoapp/__pycache__/forms.cpython-311.pyc b/autoapp/__pycache__/forms.cpython-311.pyc index 0902029..b01b559 100644 Binary files a/autoapp/__pycache__/forms.cpython-311.pyc and b/autoapp/__pycache__/forms.cpython-311.pyc differ diff --git a/autoapp/__pycache__/views.cpython-311.pyc b/autoapp/__pycache__/views.cpython-311.pyc index 69547d2..0b754c1 100644 Binary files a/autoapp/__pycache__/views.cpython-311.pyc and b/autoapp/__pycache__/views.cpython-311.pyc differ diff --git a/autoapp/forms.py b/autoapp/forms.py index 2262906..a9feacd 100644 --- a/autoapp/forms.py +++ b/autoapp/forms.py @@ -7,7 +7,7 @@ class AutoForm(forms.ModelForm): model = Auto fields = ['brand', 'model', 'year', 'color'] - # Настройка виджетов и стилей (опционально, но улучшает внешний вид) + # Настройка виджетов и стилей widgets = { 'brand': forms.TextInput(attrs={ 'class': 'form-control', @@ -29,7 +29,7 @@ class AutoForm(forms.ModelForm): }), } - # Дополнительная валидация (опционально) + # Дополнительная валидация def clean_year(self): year = self.cleaned_data.get('year') if year and (year < 1900 or year > 2100): diff --git a/autoapp/views.py b/autoapp/views.py index 91754b2..2ed69b7 100644 --- a/autoapp/views.py +++ b/autoapp/views.py @@ -9,7 +9,7 @@ class AutoCreateView(CreateView): model = Auto form_class = AutoForm template_name = 'autoapp/add_auto.html' - success_url = reverse_lazy('auto_list') # или другая страница + success_url = reverse_lazy('auto_list') def form_valid(self, form): response = super().form_valid(form)