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
rest_auth_integration.zip: HTTP Error 401: Unauthorized
--
Ticket URL: <https://code.djangoproject.com/ticket/28426>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* component: Uncategorized => Core (Management commands)
* stage: Unreviewed => Accepted
Comment:
Perhaps there's a difference in
[https://github.com/django/django/blob/99d5059d766a18f80bb24a44023f9e653a08c803/django/core/management/templates.py#L260
urlretrieve()] between Python 2 and 3. I'm not sure if there's anything
Django can do about it. Do you want to investigate?
--
Ticket URL: <https://code.djangoproject.com/ticket/28426#comment:1>
Old description:
> 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
> rest_auth_integration.zip: HTTP Error 401: Unauthorized
New description:
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
--
--
Ticket URL: <https://code.djangoproject.com/ticket/28426#comment:2>
Comment (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 with in Python
2 you get a prompt but not in Python 3
--
Ticket URL: <https://code.djangoproject.com/ticket/28426#comment:3>
* status: new => assigned
* owner: nobody => Irindu Indeera
--
Ticket URL: <https://code.djangoproject.com/ticket/28426#comment:4>
* status: assigned => new
* owner: Irindu Indeera => (none)
* type: Bug => New feature
Comment:
#29366 is a duplicate.
--
Ticket URL: <https://code.djangoproject.com/ticket/28426#comment:5>
* cc: Nahuel (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/28426#comment:6>
* status: new => closed
* resolution: => wontfix
Comment:
After some exploration [https://groups.google.com/g/django-
developers/c/vlxd_MK2kYo/m/b20jsCSqAAAJ 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.
--
Ticket URL: <https://code.djangoproject.com/ticket/28426#comment:7>