0

How do I register a user with a specific email address?

def register(request):
if request.method == "POST":
    username = request.POST["username"]
    email = request.POST["mail"]

    # Ensure password matches confirmation
    password = request.POST["password"]
    confirmation = request.POST["confirmation"]
    if password != confirmation:
        return render(request, "auctions/register.html", {
            "message": "Passwords must match."
        })
mila kohen
  • 15
  • 10

1 Answers1

0

"allowlist¶ Allowlist of email domains. By default, a regular expression (the domain_regex attribute) is used to validate whatever appears after the @ sign. However, if that string appears in the allowlist, this validation is bypassed. If not provided, the default allowlist is ['localhost']. Other domains that don’t contain a dot won’t pass validation, so you’d need to add them to the allowlist as necessary" .

DOCUMENTATION DOCUMENTATION validators

and a "dirty way" is =>

<input id="email" type="email" pattern="[a-z.]*[@]\bfoo.com" required>
mila kohen
  • 15
  • 10