Django Simple Captcha
Django form field with simple captcha. Using django-simple-captcha library.
django-simple-captcha official docs here.
Step 1: Preparation, Create Django Project
create virtualenv: virtualenv venv
start virtualenv: venv/Scripts/activate
install Django and Django simple captcha in virtualenv: pip install django==3.2 django-simple-captcha
Create Django: django-admin startproject myproject
Go to myproject folder: cd myproject
Step 2: Create Django Apps and Add Captcha Module
Create apps: python manage.py startapp myapp
Add myapp and captcha module to INSTALLED_APPS in myproject/settings.py
Step 3: Run Migrations: python manage.py migrate
Step 4: Setup Templates
Create folder templates in myapp
Add template directory in TEMPLATES parameter in myproject/settings.py
Path(BASE_DIR , 'myapp', 'templates'),
Step 5: Create HTML Files in myapp/templates Folder
Create myapp/templates/home.html
Step 6: Create Form
Create forms.py in myapp
Step 7: Update views in myapp/views
Step 8: Setup URL
Create myapp/urls.py
Update myproject/urls.py
Step 9: Run Server and Testing
Run Server: python manage.py runserver
Testing: http://127.0.0.1:8000