Opened 7 years ago
Closed 4 years ago
#28426 closed New feature (wontfix)
Add HTTP authentication support to startproject --template
Reported by: | Elena Georgiou Strouthos | Owned by: | |
---|---|---|---|
Component: | Core (Management commands) | Version: | 1.11 |
Severity: | Normal | Keywords: | |
Cc: | Nahuel | Triage Stage: | Accepted |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
We have a Django template hosted in a private repository.
When we run
django-admin.py startproject --template=https://bitbucket.org/<team>/simple_template/get/master.zip --name=Procfile myproject .
with Python 2.7 we get a prompt for username and password.
However the same command using Python 3.6 returns the following error:
CommandError: couldn't download URL https://bitbucket.org/<team>/simple_template/get/master.zip to master.zip: HTTP Error 401: Unauthorized
Change History (6)
comment:1 by , 7 years ago
Component: | Uncategorized → Core (Management commands) |
---|---|
Summary: | Starting a project from a template with Django 1.11 and Python 3 → startproject with a remote template gives an authentication prompt on Python 2 but 401: Unauthorized on Python 3 |
Triage Stage: | Unreviewed → Accepted |
comment:2 by , 7 years ago
Description: | modified (diff) |
---|
comment:3 by , 7 years ago
I can see from the documentation that urlretrieve is a legacy interface that will be deprecated in the future (https://docs.python.org/3/library/urllib.request.html#urllib.request.urlretrieve) but other than that I don't see anything that would explain with in Python 2 you get a prompt but not in Python 3
comment:5 by , 7 years ago
Owner: | removed |
---|---|
Summary: | startproject with a remote template gives an authentication prompt on Python 2 but 401: Unauthorized on Python 3 → Add HTTP authentication support to startproject --template |
Type: | Bug → New feature |
#29366 is a duplicate.
comment:6 by , 7 years ago
Cc: | added |
---|
comment:7 by , 4 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
After some exploration as discussed on django-developers, this seems more complicated than it's worth as Python's behavior has changed to remove prompting for the credentials. You can add the username and password to the URL or use some other method to download it.
Perhaps there's a difference in urlretrieve() between Python 2 and 3. I'm not sure if there's anything Django can do about it. Do you want to investigate?