[Django] #28426: Starting a project from a template with Django 1.11 and Python 3

47 views
Skip to first unread message

Django

unread,
Jul 21, 2017, 1:12:04 PM7/21/17
to django-...@googlegroups.com
#28426: Starting a project from a template with Django 1.11 and Python 3
-------------------------------------+-------------------------------------
Reporter: Elena | Owner: nobody
Georgiou Strouthos |
Type: Bug | Status: new
Component: | Version: 1.11
Uncategorized |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
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

--
Ticket URL: <https://code.djangoproject.com/ticket/28426>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jul 21, 2017, 2:28:13 PM7/21/17
to django-...@googlegroups.com
#28426: startproject with a remote template gives an authentication prompt on
Python 2 but 401: Unauthorized on Python 3
-------------------------------------+-------------------------------------
Reporter: Elena Georgiou | Owner: nobody

Strouthos |
Type: Bug | Status: new
Component: Core (Management | Version: 1.11
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* 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>

Django

unread,
Jul 23, 2017, 2:03:13 AM7/23/17
to django-...@googlegroups.com
#28426: startproject with a remote template gives an authentication prompt on
Python 2 but 401: Unauthorized on Python 3
-------------------------------------+-------------------------------------
Reporter: Elena Georgiou | Owner: nobody

Strouthos |
Type: Bug | Status: new
Component: Core (Management | Version: 1.11
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Elena Georgiou Strouthos:

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>

Django

unread,
Jul 23, 2017, 2:28:40 AM7/23/17
to django-...@googlegroups.com
#28426: startproject with a remote template gives an authentication prompt on
Python 2 but 401: Unauthorized on Python 3
-------------------------------------+-------------------------------------
Reporter: Elena Georgiou | Owner: nobody

Strouthos |
Type: Bug | Status: new
Component: Core (Management | Version: 1.11
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

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>

Django

unread,
Jul 25, 2017, 2:14:50 AM7/25/17
to django-...@googlegroups.com
#28426: startproject with a remote template gives an authentication prompt on
Python 2 but 401: Unauthorized on Python 3
-------------------------------------+-------------------------------------
Reporter: Elena Georgiou | Owner: Irindu
Strouthos | Indeera
Type: Bug | Status: assigned

Component: Core (Management | Version: 1.11
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Irindu Indeera ):

* status: new => assigned
* owner: nobody => Irindu Indeera


--
Ticket URL: <https://code.djangoproject.com/ticket/28426#comment:4>

Django

unread,
Apr 27, 2018, 8:29:03 AM4/27/18
to django-...@googlegroups.com
#28426: Add HTTP authentication support to startproject --template
-------------------------------------+-------------------------------------
Reporter: Elena Georgiou | Owner: (none)
Strouthos |
Type: New feature | Status: new

Component: Core (Management | Version: 1.11
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* 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>

Django

unread,
Apr 27, 2018, 8:36:25 AM4/27/18
to django-...@googlegroups.com
#28426: Add HTTP authentication support to startproject --template
-------------------------------------+-------------------------------------
Reporter: Elena Georgiou | Owner: (none)
Strouthos |
Type: New feature | Status: new
Component: Core (Management | Version: 1.11
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Nahuel):

* cc: Nahuel (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/28426#comment:6>

Django

unread,
Mar 4, 2021, 5:44:10 PM3/4/21
to django-...@googlegroups.com
#28426: Add HTTP authentication support to startproject --template
-------------------------------------+-------------------------------------
Reporter: Elena Georgiou | Owner: (none)
Strouthos |
Type: New feature | Status: closed

Component: Core (Management | Version: 1.11
commands) |
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* 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>

Reply all
Reply to author
Forward
0 new messages