| | 1 | {{{ |
| | 2 | #!rst |
| | 3 | |
| | 4 | .. |
| | 5 | ===================== |
| | 6 | How to install Django |
| | 7 | ===================== |
| | 8 | |
| | 9 | .. sidebar:: Come installare Django |
| | 10 | :subtitle: traduzione in lingua italiana. |
| | 11 | |
| | 12 | Documento originale: `How to install Django`_ |
| | 13 | |
| | 14 | Traduzione: paolo `<paolo@php3.it>` |
| | 15 | |
| | 16 | Aggiornato alla revisione: 2930 |
| | 17 | |
| | 18 | .. _How to install Django: http://www.djangoproject.com/documentation/install/ |
| | 19 | |
| | 20 | .. contents:: **Contenuti del capitolo** |
| | 21 | |
| | 22 | ====================== |
| | 23 | Come installare Django |
| | 24 | ====================== |
| | 25 | |
| | 26 | .. This document will get you up and running with Django. |
| | 27 | |
| | 28 | Questo documento ti renderà operativo con Django. |
| | 29 | |
| | 30 | .. |
| | 31 | Install Python |
| | 32 | ============== |
| | 33 | |
| | 34 | Installare Python |
| | 35 | ================= |
| | 36 | |
| | 37 | .. Being a Python Web framework, Django requires Python. |
| | 38 | |
| | 39 | Django è un framework Web scritto in Python, perciò richiede Python. |
| | 40 | |
| | 41 | .. It works with any Python version 2.3 and higher. |
| | 42 | |
| | 43 | E' in grado di funzionare con qualsiasi versione di Python dalla 2.3 in poi. |
| | 44 | |
| | 45 | .. |
| | 46 | Get Python at www.python.org. If you're running Linux or Mac OS X, you probably |
| | 47 | already have it installed. |
| | 48 | |
| | 49 | Puoi ottenere Python dal sito www.python.org. Se stai usando Linux o Mac OS X, |
| | 50 | probabilmente lo trovi già installato. |
| | 51 | |
| | 52 | .. |
| | 53 | Install Apache and mod_python |
| | 54 | ============================= |
| | 55 | |
| | 56 | Installare Apache e mod_python |
| | 57 | ============================== |
| | 58 | |
| | 59 | .. |
| | 60 | If you just want to experiment with Django, skip this step. Django comes with |
| | 61 | its own Web server for development purposes. |
| | 62 | |
| | 63 | Se vuoi soltanto fare qualche esperimento con Django puoi tralasciare questa parte |
| | 64 | di installazione. Django infatti viene fornito con un proprio Web server |
| | 65 | adatto a funzionare in ambienti di sviluppo e test. |
| | 66 | |
| | 67 | .. |
| | 68 | If you want to use Django on a production site, use Apache with `mod_python`_. |
| | 69 | mod_python is similar to mod_perl -- it embeds Python within Apache and loads |
| | 70 | Python code into memory when the server starts. Code stays in memory throughout |
| | 71 | the life of an Apache process, which leads to significant performance gains |
| | 72 | over other server arrangements. Make sure you have Apache installed, with the |
| | 73 | mod_python module activated. Django requires Apache 2.x and mod_python 3.x. |
| | 74 | |
| | 75 | Nel caso in cui sia previsto l'utilizzo in ambienti di produzione usa Apache |
| | 76 | assieme a `mod_python`_. mod_python è simile a mod_perl -- integra Python |
| | 77 | all'interno di Apache e carica il codice in memoria quando il server viene |
| | 78 | avviato. Il codice risiede in memoria per tutta la durata di un processo di |
| | 79 | Apache, e ciò offre - rispetto ad altre configurazioni - un guadagno di prestazioni |
| | 80 | significativo. Assicurati che Apache sia installato e che mod_python sia |
| | 81 | attivo. Django richiede Apache 2.x e mod_python 3.x. |
| | 82 | |
| | 83 | .. |
| | 84 | See `How to use Django with mod_python`_ for information on how to configure |
| | 85 | mod_python once you have it installed. |
| | 86 | |
| | 87 | Per informazioni su come configurare mod_python dopo averlo installato consulta |
| | 88 | `Come usare Django con mod_python`_. |
| | 89 | |
| | 90 | .. |
| | 91 | If you can't use mod_python for some reason, fear not: Django follows the WSGI_ |
| | 92 | spec, which allows it to run on a variety of server platforms. See the |
| | 93 | `server-arrangements wiki page`_ for specific installation instructions for |
| | 94 | each platform. |
| | 95 | |
| | 96 | Se per qualche ragione non puoi usare mod_python, non temere: Django segue le |
| | 97 | specifiche WSGI_, perciò può funzionare assieme ad altre piattaforme server. |
| | 98 | Vedi la `pagina del wiki sulle configurazioni dei server`_. |
| | 99 | |
| | 100 | .. _Apache: http://httpd.apache.org/ |
| | 101 | .. _mod_python: http://www.modpython.org/ |
| | 102 | .. _WSGI: http://www.python.org/peps/pep-0333.html |
| | 103 | .. _Come usare Django con mod_python: http://www.djangoproject.com/documentation/modpython/ |
| | 104 | .. _pagina del wiki sulle configurazioni dei server: http://code.djangoproject.com/wiki/ServerArrangements |
| | 105 | |
| | 106 | .. |
| | 107 | Get your database running |
| | 108 | ========================= |
| | 109 | |
| | 110 | Metti in funzione il database |
| | 111 | ============================= |
| | 112 | |
| | 113 | .. |
| | 114 | If you plan to use Django's database API functionality, you'll need to |
| | 115 | make sure a database server is running. Django works with PostgreSQL_ |
| | 116 | (recommended), MySQL_ and SQLite_. |
| | 117 | |
| | 118 | Se pensi di usare le funzionalità messe a disposizione dalle API di Django per |
| | 119 | i database, devi essere sicuro che sia in funzione un database server. |
| | 120 | Django funziona con PostgreSQL_ (soluzione raccomandata), MySQL_ e SQLite_. |
| | 121 | |
| | 122 | .. |
| | 123 | Additionally, you'll need to make sure your Python database bindings are |
| | 124 | installed. |
| | 125 | |
| | 126 | * If you're using PostgreSQL, you'll need the psycopg_ package (version 1.1 -- |
| | 127 | not version 1.0 or version 2, which is still in beta). If you're on Windows, |
| | 128 | check out the unofficial `compiled Windows version`_. |
| | 129 | * If you're using MySQL, you'll need MySQLdb_. |
| | 130 | * If you're using SQLite, you'll need pysqlite_. Use version 2.0.3 or higher. |
| | 131 | |
| | 132 | Devi anche accertarti che i binding Python per l'interfacciamento ai database |
| | 133 | siano installati. |
| | 134 | |
| | 135 | * Se usi PostgreSQL ti serve il pacchetto psycopg_ (la versione 1.1 -- non la |
| | 136 | 2.0 che ancora non è considerata stabile). Se usi Windows procurati la |
| | 137 | `versione compilata`_. |
| | 138 | * Se usi MySQL ti serve MySQLdb_. |
| | 139 | * Se usi SQLite ti serve la versione 2.0.3 o successiva di pysqlite_. |
| | 140 | |
| | 141 | .. _PostgreSQL: http://www.postgresql.org/ |
| | 142 | .. _MySQL: http://www.mysql.com/ |
| | 143 | .. _Django's ticket system: http://code.djangoproject.com/report/1 |
| | 144 | .. _psycopg: http://initd.org/projects/psycopg1 |
| | 145 | .. _versione compilata: http://stickpeople.com/projects/python/win-psycopg/ |
| | 146 | .. _MySQLdb: http://sourceforge.net/projects/mysql-python |
| | 147 | .. _SQLite: http://www.sqlite.org/ |
| | 148 | .. _pysqlite: http://initd.org/tracker/pysqlite |
| | 149 | |
| | 150 | .. |
| | 151 | Install the Django code |
| | 152 | ======================= |
| | 153 | |
| | 154 | Installare il codice di Django |
| | 155 | ============================== |
| | 156 | |
| | 157 | .. |
| | 158 | Installation instructions are slightly different depending on whether you're |
| | 159 | using the latest official version or the latest development version. |
| | 160 | |
| | 161 | Le istruzioni di installazione sono leggermente differenti se usi l'ultima |
| | 162 | versione ufficiale o l'ultima versione in sviluppo. |
| | 163 | |
| | 164 | .. It's easy either way. |
| | 165 | |
| | 166 | In un caso o nell'altro la procedura è semplice. |
| | 167 | |
| | 168 | .. |
| | 169 | Installing the official version |
| | 170 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| | 171 | |
| | 172 | Installare la versione ufficiale |
| | 173 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| | 174 | |
| | 175 | .. |
| | 176 | 1. Download Django-0.91.tar.gz from our `download page`_. |
| | 177 | 2. ``tar xzvf Django-0.91.tar.gz`` |
| | 178 | 3. ``cd Django-0.91`` |
| | 179 | 4. ``sudo python setup.py install`` |
| | 180 | |
| | 181 | 1. Scarica Django-0.91.tar.gz dalla `pagina dei download`_. |
| | 182 | 2. ``tar xzvf Django-0.91.tar.gz`` |
| | 183 | 3. ``cd Django-0.91`` |
| | 184 | 4. ``sudo python setup.py install`` |
| | 185 | |
| | 186 | .. |
| | 187 | Note that the last command will automatically download and install setuptools_ |
| | 188 | if you don't already have it installed. This requires a working Internet |
| | 189 | connection. |
| | 190 | |
| | 191 | Nota che, se setuptools_ non fa ancora parte del tuo setup, l'ultimo comando |
| | 192 | dell'elenco lo scaricherà e lo installerà automaticamente. Perciò ti |
| | 193 | servirà una connessione ad Internet funzionante. |
| | 194 | |
| | 195 | .. |
| | 196 | This will install Django in your Python installation's ``site-packages`` |
| | 197 | directory. |
| | 198 | |
| | 199 | In questo modo Django verrà posizionato nella directory ``site-packages`` |
| | 200 | dell'installazione Python. |
| | 201 | |
| | 202 | .. |
| | 203 | .. note:: |
| | 204 | |
| | 205 | Due to recent backwards-incompatible changes, it is strongly recommended |
| | 206 | that you use the development version (below) for any new applications or |
| | 207 | if you are just starting to work with Django. The 0.91 release is a |
| | 208 | dead-end branch that is primarily of use for supporting legacy Django |
| | 209 | applications. |
| | 210 | |
| | 211 | .. note:: |
| | 212 | |
| | 213 | A causa di recenti modifiche, sono state introdotte alcune |
| | 214 | incompatibilità con le precedenti versioni di Django. E' fortemente |
| | 215 | raccomandato l'utilizzo della versione di sviluppo (vedi oltre) se stai |
| | 216 | comincindo lo sviluppo di qualsiasi nuova applicazione o se stai muovendo i |
| | 217 | primi passi con Django. La versione 0.91 non sarà più mantenuta, ed il suo |
| | 218 | scopo primario è quello di supportare applicazioni Django preesistenti. |
| | 219 | |
| | 220 | .. _setuptools: http://peak.telecommunity.com/DevCenter/setuptools |
| | 221 | |
| | 222 | .. |
| | 223 | Installing the development version |
| | 224 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| | 225 | |
| | 226 | Installare la versione di sviluppo |
| | 227 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| | 228 | |
| | 229 | .. |
| | 230 | 1. Make sure you have Subversion_ installed. |
| | 231 | 2. ``svn co http://code.djangoproject.com/svn/django/trunk/ django_src`` |
| | 232 | 3. Symlink ``django_src/django`` so that ``django`` is within your Python |
| | 233 | ``site-packages`` directory: |
| | 234 | |
| | 235 | ``ln -s `pwd`/django_src/django /usr/lib/python2.3/site-packages/django`` |
| | 236 | |
| | 237 | (In the above line, change ``python2.3`` to match your current Python version.) |
| | 238 | |
| | 239 | 1. Assicurati che Subversion_ sia installato. |
| | 240 | 2. ``svn co http://code.djangoproject.com/svn/django/trunk/ django_src`` |
| | 241 | 3. Crea un link simbolico a ``django_src/django`` in modo che ``django`` sia nella |
| | 242 | directory ``site-packages`` dell'installazione Python: |
| | 243 | |
| | 244 | ``ln -s `pwd`/django_src/django /usr/lib/python2.3/site-packages/django`` |
| | 245 | |
| | 246 | (Nella riga sopra modifica ``python2.3`` facendolo coincidere con la versione |
| | 247 | di Python che stai utilizzando correntemente.) |
| | 248 | |
| | 249 | .. You don't have to run ``python setup.py install``. |
| | 250 | |
| | 251 | Non devi eseguire ``python setup.py install``. |
| | 252 | |
| | 253 | .. |
| | 254 | When you want to update your code, just run the command ``svn update`` from |
| | 255 | within the ``django_src`` directory. |
| | 256 | |
| | 257 | Quando vuoi aggiornare il codice, scrivi semplicemente il comando ``svn |
| | 258 | update`` stando nella directory ``django_src``. |
| | 259 | |
| | 260 | .. |
| | 261 | .. _`download page`: http://www.djangoproject.com/download/ |
| | 262 | .. _Subversion: http://subversion.tigris.org/ |
| | 263 | |
| | 264 | .. _`pagina dei download`: http://www.djangoproject.com/download/ |
| | 265 | .. _Subversion: http://subversion.tigris.org/ |
| | 266 | }}} |
| | 267 | |