How to create 'terms & conditions check box' in django?

Viewed 1730

enter image description here

I want to make a registration form like this, where user would type username,email,password,confirm password and check the terms and condition box to register his/herself. But i dont know how to create a model row for check box so that according to its input i would allow or disallow user to register.

models.py

class registeration(models.Model):
    username = models.CharField(max_length=100)
    email = models.EmailField()
    password = models.CharField(max_length=100)
    confirm_pasword = models.CharField(max_length=100)


    def __str__(self):
        return self.username
1 Answers

You can use BooleanField for this:

terms_confirmed = models.BooleanField()
Related