Allow use of `file://` urls in repos during development.
@@ -62,9 +62,12 @@ class RepositoryURLValidator(object):
allow_private_repos = getattr(settings, 'ALLOW_PRIVATE_REPOS', False)
public_schemes = ['https', 'http', 'git', 'ftps', 'ftp']
private_schemes = ['ssh', 'ssh+git']
+ local_schemes = ['file']
valid_schemes = public_schemes
if allow_private_repos:
valid_schemes += private_schemes
+ if getattr(settings, 'DEBUG'): # allow `file://` urls in dev
+ valid_schemes += local_schemes
url = urlparse(value)
# Malicious characters go first
