Opened 6 years ago

Closed 6 years ago

#11643 closed (invalid)

URLField can't recognise a well-formed URL

Reported by: tom@… Owned by: nobody
Component: Database layer (models, ORM) Version: 1.1
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

I tried to set a URLField (verify_exists=False), to "http://utena:8000/user/1", and it claimed it wasn't a valid URL. It also complained about "http://utena/user/1".

Change History (1)

comment:1 Changed 6 years ago by kmtracey

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

The URL regex is looking for a domain name, the string 'localhost' or a numeric IP address as the first component of the url (optionally followed by the port specification):

http://code.djangoproject.com/browser/django/tags/releases/1.1/django/forms/fields.py#L534

'utena' doesn't match any of these. Make it a valid domain name and it will pass validation, but as it is it is not valid.

Note: See TracTickets for help on using tickets.
Back to Top