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 Elena Georgiou Strouthos)

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 Tim Graham, 7 years ago

Component: UncategorizedCore (Management commands)
Summary: Starting a project from a template with Django 1.11 and Python 3startproject with a remote template gives an authentication prompt on Python 2 but 401: Unauthorized on Python 3
Triage Stage: UnreviewedAccepted

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?

comment:2 by Elena Georgiou Strouthos, 7 years ago

Description: modified (diff)

comment:3 by Elena Georgiou Strouthos, 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 why with in Python 2 you get a prompt but not in Python 3

Last edited 7 years ago by Elena Georgiou Strouthos (previous) (diff)

comment:5 by Tim Graham, 7 years ago

Owner: nobody removed
Summary: startproject with a remote template gives an authentication prompt on Python 2 but 401: Unauthorized on Python 3Add HTTP authentication support to startproject --template
Type: BugNew feature

#29366 is a duplicate.

comment:6 by Nahuel, 7 years ago

Cc: Nahuel added

comment:7 by Tim Graham, 4 years ago

Resolution: wontfix
Status: newclosed

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.

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