Исправить ошибку
signupupser.html
<h1>Sign Up</h1>
<h2>{{ error }}</h2>
<form method="POST">
{% csrf_token %}
{{form.as_p}}
<button type="submit">Sign Up</button>
</form>
urls.py
from django.contrib import admin
from django.urls import path
from todo import views
urlpatterns = [
path('admin/', admin.site.urls),
path('signup/', views.signupuser, name='signupuser')
]
views.py
from django.shortcuts import render
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
from django.db import IntegrityError
def signupuser(request):
if request.method == 'GET':
return render(request, 'todo/signupuser.html', {'form': UserCreationForm()})
else:
if request.POST['password1'] == request.POST['password2']:
try:
user = User.objects.create_user(request.POST['username'], password=request.POST['password1'])
user.save()
except IntegrityError:
return render(request, 'todo/signupuser.html', {'form': UserCreationForm(), 'error': 'That Username has already been taken. Please choose a new username'})
else:
return render(request, 'todo/signupuser.html',
{'form': UserCreationForm(), 'error': 'Passwords did not match'})
Получается ошибка
The view todo.views.signupuser didn't return an HttpResponse object. It returned None instead.
-
127 Добрый вечер,
Я ознакомился с задачей, мне все понятно. Могу приступить к выполнению сегодня. Вся работа займет 15 мин.
-
461 41 1 Сделаю быстро, пишите в личные сообщения, буду рад помочь :)
-
389 15 3 Здравстуйте, отпишите в лс, опыт написания сайтов есть. Пишите, буду рад сотрудничеству!)
-
334 38 1 1 Готов выполнить, работа будет выполнена через 10 минут.
Так же могу объяснить что не так и дать некоторые советы
-
deleted by moderator
-
Current freelance projects in the category Python
Create a bot in Telegram (seller's cabinet)
16 USD
Hello everyone I need a user personal account in the format of a bot in Telegram After launching and completing the survey, a personal account is created for the user (which allows them to access the system for further buttons) so that each registered user is displayed in a… Python, Bot Development ∙ 4 hours 12 minutes back ∙ 66 proposals |
Find a product feed (Google Merchant XML) for a website on OpenCart
16 USD
It is necessary to find a direct link to the active product feed (XML) of a competitor for Google Merchant Center Platform (CMS): OpenCart / ocStore Find the original feedRequirements for the result: Working link to the XML file Python, Data Parsing ∙ 14 hours 16 minutes back ∙ 19 proposals |
Development of a TikTok farm (content factory)It is necessary to develop a system for centralized management of multiple TikTok accounts with automatic content publishing, using individual proxies and simulating natural account activity. Functional Requirements1. Account Management Adding and removing TikTok accounts.… Python, Bot Development ∙ 1 day 1 hour back ∙ 15 proposals |
Improve the performance of Claude Code and work on software development.I am currently developing CRM and Analytics software. I am using Claude Code, but I understand that the results are not the best in terms of changes. There are 2 tasks - Need help creating a preset for skills, MD, and so on to improve quality. Take verified ones that have been… AI & Machine Learning, Python ∙ 1 day 8 hours back ∙ 21 proposals |
OCR systemA system for recognizing text on postal envelopes (index for whom - only numbers). The text can sometimes be handwritten. Recognition of stamps (counting quantity and denomination) Python ∙ 1 day 11 hours back ∙ 24 proposals |