Opened 16 months ago

Last modified 7 months ago

#28426 new New feature

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 Changed 16 months ago by Tim Graham

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 Changed 16 months ago by Elena Georgiou Strouthos

Description: modified (diff)

comment:3 Changed 16 months ago by Elena Georgiou Strouthos

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 16 months ago by Elena Georgiou Strouthos (previous) (diff)

comment:4 Changed 16 months ago by Irindu Indeera

Owner: changed from nobody to Irindu Indeera
Status: newassigned

comment:5 Changed 7 months ago by Tim Graham

Owner: Irindu Indeera deleted
Status: assignednew
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 Changed 7 months ago by Nahuel

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