Как исправить ошибку.Django
Вот такая ошибка:
File "C:\Project django\password_generator\password_generator\urls.py", line 24, in <module>
path('about', about.home, name ='about'),
NameError: name 'about' is not defined
URL
from django.contrib import admin
from django.urls import path, include
from generator import views
path('', views.home, name = 'home'),
path('about', about.home, name ='about'),
path('password/', views.password),
VIEWS
from django.shortcuts import render
from django.http import HttpResponse
import random
def home(request):
return render(request, 'generator/home.html')
def about(request):
return render(request, 'generator/about.html')
def password(request):
characters = list('qwertyuiopasdfghjklzxcvbnm')
if request.GET.get('uppercase'):
characters.extend(list('QWERTYUIOPASDFGHJKLZXCVBNM'))
if request.GET.get('special'):
characters.extend(list('!@#$%^&*_+'))
if request.GET.get('numbers'):
characters.extend(list('1234567890'))
length = int(request.GET.get('length'))
thepassword = ''
for x in range(length):
thepassword += random.choice(characters)
return render(request, 'generator/password.html', {'password':thepassword} )