TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [[os.path.join(BASE_DIR, 'templates')]],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
"django.core.context_processors.i18n",
"django.core.context_processors.media",
'django.contrib.messages.context_processors.messages',
'django.core.context_processors.request',
],
},
},
]
<h1>About</h1>
<p></strong>.</p>
class VacForm(forms.ModelForm):
vac_name=forms.CharField(widget=forms.TextInput(attrs={'class':'supername'}))
class Meta:
model = Vacancies
fields = ('vac_name', 'vac_req','vac_obz', 'vac_usl','vac_salary', 'vac_comp','vac_zan', 'vac_locat', 'vac_exp','vac_cat', )
class VacForm(forms.ModelForm):
vac_name.widget = forms.TextInput(attrs={'size': 10, 'title': 'Search', 'class':'supername''})
.....
def clean(self):
form_data = self.cleaned_data
if form_data['password'] != form_data['password_repeat']:
self._errors["password"] = ["Password do not match"] # Will raise a error message
del form_data['password']
return form_data
ValueError: The database backend does not accept 0 as a value for AutoField.