Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How can I increase size of item in form?

So I have captcha form in django project and it seems kinda small. I wan’t to make it bigger.
Forms.py

from django import forms
from captcha.fields import CaptchaField

class MyForm(forms.Form):
   captcha=CaptchaField()

views.py

from django.shortcuts import render
from .forms import MyForm

# Create your views here.

def home(request):
   if request.method=="POST":
      form=MyForm(request.POST)
      if form.is_valid():
         print("success")
      else:
         print("fail")
   form=MyForm()
   return render(request,"captcha_project/home.html",{"form":form})

home.html

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

<!DOCTYPE html>
<html>
   <head>
   </head>
   <body>
      <form method="POST" novalidate>
         {% csrf_token %}
         {{ form.captcha }}
         <input type="submit" value="submit">
      </form>
   </body>
</html>

So, basically I just want to make captcha form bigger

>Solution :

According to the documentation, you could use CAPTCHA_FONT_SIZE or CAPTCHA_IMAGE_SIZE by defining them in your settings.py.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading