Code

Ticket #16205: 16205.diff

File 16205.diff, 4.4 KB (added by melinath, 3 years ago)
Line 
1diff --git a/docs/howto/index.txt b/docs/howto/index.txt
2index 49d0644..6743456 100644
3--- a/docs/howto/index.txt
4+++ b/docs/howto/index.txt
5@@ -24,6 +24,7 @@ you quickly accomplish common tasks.
6    outputting-csv
7    outputting-pdf
8    static-files
9+   windows
10 
11 .. seealso::
12 
13diff --git a/docs/howto/windows.txt b/docs/howto/windows.txt
14new file mode 100644
15index 0000000..8d593d4
16--- /dev/null
17+++ b/docs/howto/windows.txt
18@@ -0,0 +1,101 @@
19+================================
20+How to install Django on Windows
21+================================
22+
23+This document will guide you through installing Django and Python for
24+basic usage on Windows. This is meant as a beginners guide for users doing
25+development of Django projects and does not reflect how Django should be
26+installed for production environments.
27+
28+Install Python
29+==============
30+
31+Django is a Python web framework, thus requiring Python installed on your
32+machine.
33+
34+To install Python on your machine go to http://python.org/download/, and
35+download a Windows MSI installer for Python 2.x (eg. 2.7.1). Django does not
36+currently run on Python 3.x. lSee the :doc:`the Django FAQ </faq/install>`
37+for more information.
38+
39+Once downloaded, run the MSI installer and follow the on screen instructions.
40+
41+Install Setuptools
42+~~~~~~~~~~~~~~~~~~
43+
44+To install other python software on your computer, setuptools is needed.
45+Download the latest installer for your Python version from
46+http://pypi.python.org/pypi/setuptools#files. Run the installer and follow
47+the on screen instructions.
48+
49+Adding Python to PATH
50+~~~~~~~~~~~~~~~~~~~~~
51+
52+To be able to execute Python, and related scripts, the directory where
53+you installed Python, and the *Scripts* sub directory,
54+must be on PATH. Only the approach for Windows 7 will be explained,
55+but the other versions of Windows have similar approaches.
56+
57+* Click the Windows button.
58+
59+* Right click on *Computer* and choose *Properties*.
60+
61+* Click *Advanced System Settings* at the bottom of the list on the left side
62+  of the opened window.
63+
64+* Click *Environment Variables* at the bottom
65+
66+* Find the *Path* variable in the list of *System variables*,
67+  select it and click the *Edit...* button.
68+
69+* The *Variable value* is a semi colon separated list of directories. Make
70+  sure both the install directory and the *Scripts* directory is in this list.
71+  If not, add them to the end of the list (*C:\\Python27;
72+  C:\\Python27\\Scripts*)
73+
74+* Click *OK* to save the changes.
75+
76+Install PIP
77+===========
78+
79+`PIP <http://www.pip-installer.org/>`_ is a package manager for Python that
80+uses the `Python Package Index <http://pypi.python.org>`_ to install Python
81+packages. PIP will later be used to install Django from PYPI.
82+
83+* Open a command prompt. If you installed Python to a directory where only
84+  administrators have write access, the command prompt need to be run as an
85+  administrator user.
86+
87+* Execute the following command ``easy_install pip``
88+
89+PIP should now be installed.
90+
91+Database
92+========
93+
94+From Python version 2.5 SQLite is included in the package. This means that, for
95+local development, it is normally not needed to install other databases. If
96+you want to use another database, like PostgreSQL, MySQL etc.,
97+you are free to install it as well.
98+
99+Install Django
100+==============
101+
102+Finally Django can be installed quite easily with PIP.
103+
104+In the same command prompt that you used to install PIP,
105+execute the following command: ``pip install django``. This will download and
106+install Django.
107+
108+After the installation has completed, you can verify your Django installation
109+by execution ``django-admin.py --version`` in the command prompt.
110+
111+Common pitfalls
112+===============
113+
114+* If ``django-admin.py`` only displays the help text, no matter what arguments
115+  it is given, there are probably a problem with the file association in
116+  Windows. See the solution on `Stackoverflow <http://stackoverflow
117+  .com/questions/2640971/windows-is-not-passing-command-line-arguments-to-
118+  python-programs-executed-from-th>`_
119+
120diff --git a/docs/topics/install.txt b/docs/topics/install.txt
121index 46d6615..ae3c8d4 100644
122--- a/docs/topics/install.txt
123+++ b/docs/topics/install.txt
124@@ -24,6 +24,11 @@ probably already have it installed.
125 
126 .. _jython: http://jython.org/
127 
128+.. admonition:: Django on Windows
129+
130+    If you are just starting with Django and using Windows, you may find
131+    :doc:`/howto/windows` useful.
132+
133 Install Apache and mod_wsgi
134 =============================
135