Fixed redirect urls

This commit is contained in:
Kristofers Solo 2023-03-27 21:42:41 +03:00
parent 8df44c7ee9
commit 4351d5ca6d
3 changed files with 4 additions and 4 deletions

View File

@ -10,7 +10,7 @@ def sign_up(request):
if form.is_valid():
user = form.save()
login(request, user)
return redirect("/")
return redirect("")
else:
form = RegisterForm()
return render(request, "registration/sign_up.html", {"form": form})

View File

@ -19,7 +19,7 @@ def add_project(request):
post = project.save(commit=False)
post.author = request.user
post.save()
return redirect("")
return redirect("/")
else:
project = ProjectForm()
return render(request, "main/create_project.html", {"title": "Add project", "form": project})

View File

@ -134,5 +134,5 @@ MEDIA_ROOT = BASE_PATH.joinpath("media")
# https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
LOGIN_REDIRECT_URL = ""
LOGOUT_REDIRECT_URL = ""
LOGIN_REDIRECT_URL = "/"
LOGOUT_REDIRECT_URL = "/"