Opened 16 years ago
Closed 16 years ago
#11643 closed (invalid)
URLField can't recognise a well-formed URL
| Reported by: | 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: | no | UI/UX: | no |
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".
Note:
See TracTickets
for help on using tickets.
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.