장고 회원가입 링크 관련 오류
navbar.html에 회원가입 링크를 코딩해 주고 이하 signup.html까지 코딩을 해주었습니다.
아무리 봐도 오타는 없는 거 같은데 링크 오류가 발생합니다.
ValueError at /common/signup/
The view common.views.signup didn't return an HttpResponse object. It returned None instead.
Request Method: GET
Request URL:    http://127.0.0.1:8000/common/signup/
Django Version: 3.1.3
Exception Type: ValueError
Exception Value:  
The view common.views.signup didn't return an HttpResponse object. It returned None instead.
Exception Location: c:\venvs\cezips\lib\site-packages\django\core\handlers\base.py, line 307, in check_response
Python Executable:  c:\venvs\cezips\Scripts\python.exe
Python Version: 3.10.6
Python Path:  
['c:\projects\cezips',
 'C:\Program Files\Python310\python310.zip',
 'C:\Program Files\Python310\DLLs',
 'C:\Program Files\Python310\lib',
 'C:\Program Files\Python310',
 'c:\venvs\cezips',
 'c:\venvs\cezips\lib\site-packages']
Server time:    Mon, 02 Jan 2023 12:04:35 +0900
객체를 반환하지 못했다는데 뭐가 문제일까요?
cezips 님 699
2023년 1월 2일 12:13 오후
 박응용님,
            
            
            2023년 1월 2일 6:10 오후
            
        
        
            추천
        
        
        ,
        
        
            대댓글
            
            
            박응용님,
            
            
            2023년 1월 2일 6:10 오후
            
        
        
            추천
        
        
        ,
        
        
            대댓글
        
        
    1개의 답변이 있습니다. 1 / 1 Page
from django.contrib.auth import authenticate, login
from django.shortcuts import render, redirect
from common.forms import UserForm
def signup(request):
    if request.method == "POST":
        form = UserForm(request.POST)
        if form.is_valid():
            form.save()
            username = form.cleaned_data.get('username')
            raw_password = form.cleaned_data.get('password1')
            user = authenticate(username=username, password=raw_password)
            login(request, user)
            return redirect('index')
        else:
            form = UserForm()
        return render(request, 'common/signup.html', {'form': form})
cezips 님
M 2023년 1월 2일 10:18 오후