Hi all,

Tim Graham suggested to post this to this mailing list.

Currently, users of Django on Windows have a less than ideal experience hen
using the command line. The users mailing list still see posts of new users
suffering problems like:

- I run django-admin.py startproject and I get an error message stating
django-admin.py isn't a known command

(This is usually because the <Python install dir>\Scripts\ path isn't
listed in the PATH environment variable.)

- I run django-admin.py startproject as directed and a text editor window
opens containing  Python code (source code of django-admin.py).

(This is usually because the user somehow had the .py extension associated
to such editor in their OS-maintained mapping DB of file extensions ->
Programs.)

- I run python django-admn.py startproject and I get an error message
stating Python isn't a known command

(This is because the directory containing python.exe hasn't been added to
the PATH environment variable.)

And similar issues.

As we know, versions of Python supported by the currently WIP  version of
Django [1]will be 3.5 or newer.

Also, since version 3.3, the official Windows Python installer [2]includes
an implementation of the 'Windows python launcher' proposed by [3]PEP 397.
This tool gets installed to a system directory always present in PATH and
can act a a pivot to get scripts like django-admin.py, manage.py and
runtests.py executed by the right Python interpreter binary, even when
running inside a virtual environment.

This led me to think it would be possible to simplify lives of our Windows
users because today, with a default installation of Python 3.5 o 3.6
(tested this with Python 3.5 on a Windows 7 system) Windows users can
simply write

django-admin.py startproject foo

And things Just work (TM). be it either using the global interpreter, or
using a virtual enviromnent.

Ticket is #28343: https://code.djangoproject.com/ticket/28343
PR is #8684: https://github.com/django/django/pull/8684

The PR also modifies the introductory document for contributors to Django
so it stops suggesting Windows users to use the alien Git Bash shell. At
first is seems like a good idea but considering facts like

- It forces users to type in "Unixisms" like `./manage.py` or `mkdir
~/.virtualenvs`

- Is incompatible with venv (another useful tool, also new in Python 3.3 as
part of the standard library) and forces the document to divert Windows
users so they install and use virtualenv, putting them in the strange
situation of having to do that because then they can activate the virtual
env by using the Unix shell-specific `source` builtin instead of using
native scripts activate.bat or activate.ps1

Another change proposed by the PR is the addition of a custom Sphinx
directive that modifies the UI of CLI example text boxes so they can show a
native prompt and native command line input as it should actually be typed
by the user either on Unix-based shells or the Windows command prompt
through a tabbed interface.

A small demo of the proposed change is here (as would be seen on the
docs.djangoproject.com website) is here:

http://imgur.com/3ce03UT

Feedback is welcome.

Regards,


1. https://docs.djangoproject.com/en/dev/faq/install/#what-pyth
on-version-can-i-use-with-django
2. https://docs.python.org/3.5/using/windows.html#python-launch
er-for-windows
3. https://www.python.org/dev/peps/pep-0397/

-- 
Ramiro Morales
@ramiromorales

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAO7PdF-JC%2BoWkSsDPL2E3msV3g%3DP7E2N4PO2%2B%3DRBMa29CrHXng%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to