Loading docs/howto/legacy-databases.txt +9 −9 Original line number Diff line number Diff line Loading @@ -36,11 +36,11 @@ Django comes with a utility called :djadmin:`inspectdb` that can create models by introspecting an existing database. You can view the output by running this command:: python manage.py inspectdb $ python manage.py inspectdb Save this as a file by using standard Unix output redirection:: python manage.py inspectdb > models.py $ python manage.py inspectdb > models.py This feature is meant as a shortcut, not as definitive model generation. See the :djadmin:`documentation of inspectdb <inspectdb>` for more information. Loading Loading @@ -84,7 +84,7 @@ Install the core Django tables Next, run the :djadmin:`migrate` command to install any extra needed database records such as admin permissions and content types:: python manage.py migrate $ python manage.py migrate Test and tweak ============== Loading docs/howto/static-files/index.txt +1 −1 Original line number Diff line number Diff line Loading @@ -174,7 +174,7 @@ for gathering static files in a single directory so you can serve them easily. 2. Run the :djadmin:`collectstatic` management command:: ./manage.py collectstatic $ python manage.py collectstatic This will copy all files from your static folders into the :setting:`STATIC_ROOT` directory. Loading docs/howto/upgrade-version.txt +1 −1 Original line number Diff line number Diff line Loading @@ -76,7 +76,7 @@ manually using ``manage.py runserver``): .. code-block:: bash python -Wall manage.py test $ python -Wall manage.py test After you have run the tests, fix any failures. While you have the release notes fresh in your mind, it may also be a good time to take advantage of new Loading docs/intro/overview.txt +1 −1 Original line number Diff line number Diff line Loading @@ -53,7 +53,7 @@ automatically: .. code-block:: bash manage.py migrate $ python manage.py migrate The :djadmin:`migrate` command looks at all your available models and creates tables in your database for whichever tables don't already exist, as well as Loading docs/intro/tutorial01.txt +7 −7 Original line number Diff line number Diff line Loading @@ -169,7 +169,7 @@ It worked! .. code-block:: bash python manage.py runserver 8080 $ python manage.py runserver 8080 If you want to change the server's IP, pass it along with the port. So to listen on all public IPs (useful if you want to show off your work on other Loading @@ -177,7 +177,7 @@ It worked! .. code-block:: bash python manage.py runserver 0.0.0.0:8000 $ python manage.py runserver 0.0.0.0:8000 Full docs for the development server can be found in the :djadmin:`runserver` reference. Loading Loading @@ -256,7 +256,7 @@ that, run the following command: .. code-block:: bash python manage.py syncdb $ python manage.py syncdb The :djadmin:`syncdb` command looks at the :setting:`INSTALLED_APPS` setting and creates any necessary database tables according to the database settings Loading Loading @@ -308,7 +308,7 @@ and type this command: .. code-block:: bash python manage.py startapp polls $ python manage.py startapp polls That'll create a directory :file:`polls`, which is laid out like this:: Loading Loading @@ -424,7 +424,7 @@ Now Django knows to include the ``polls`` app. Let's run another command: .. code-block:: bash python manage.py sql polls $ python manage.py sql polls You should see something similar to the following (the ``CREATE TABLE`` SQL statements for the polls app): Loading Loading @@ -501,7 +501,7 @@ Now, run :djadmin:`syncdb` again to create those model tables in your database: .. code-block:: bash python manage.py syncdb $ python manage.py syncdb The :djadmin:`syncdb` command runs the SQL from :djadmin:`sqlall` on your database for all apps in :setting:`INSTALLED_APPS` that don't already exist in Loading @@ -521,7 +521,7 @@ API Django gives you. To invoke the Python shell, use this command: .. code-block:: bash python manage.py shell $ python manage.py shell We're using this instead of simply typing "python", because :file:`manage.py` sets the ``DJANGO_SETTINGS_MODULE`` environment variable, which gives Django Loading Loading
docs/howto/legacy-databases.txt +9 −9 Original line number Diff line number Diff line Loading @@ -36,11 +36,11 @@ Django comes with a utility called :djadmin:`inspectdb` that can create models by introspecting an existing database. You can view the output by running this command:: python manage.py inspectdb $ python manage.py inspectdb Save this as a file by using standard Unix output redirection:: python manage.py inspectdb > models.py $ python manage.py inspectdb > models.py This feature is meant as a shortcut, not as definitive model generation. See the :djadmin:`documentation of inspectdb <inspectdb>` for more information. Loading Loading @@ -84,7 +84,7 @@ Install the core Django tables Next, run the :djadmin:`migrate` command to install any extra needed database records such as admin permissions and content types:: python manage.py migrate $ python manage.py migrate Test and tweak ============== Loading
docs/howto/static-files/index.txt +1 −1 Original line number Diff line number Diff line Loading @@ -174,7 +174,7 @@ for gathering static files in a single directory so you can serve them easily. 2. Run the :djadmin:`collectstatic` management command:: ./manage.py collectstatic $ python manage.py collectstatic This will copy all files from your static folders into the :setting:`STATIC_ROOT` directory. Loading
docs/howto/upgrade-version.txt +1 −1 Original line number Diff line number Diff line Loading @@ -76,7 +76,7 @@ manually using ``manage.py runserver``): .. code-block:: bash python -Wall manage.py test $ python -Wall manage.py test After you have run the tests, fix any failures. While you have the release notes fresh in your mind, it may also be a good time to take advantage of new Loading
docs/intro/overview.txt +1 −1 Original line number Diff line number Diff line Loading @@ -53,7 +53,7 @@ automatically: .. code-block:: bash manage.py migrate $ python manage.py migrate The :djadmin:`migrate` command looks at all your available models and creates tables in your database for whichever tables don't already exist, as well as Loading
docs/intro/tutorial01.txt +7 −7 Original line number Diff line number Diff line Loading @@ -169,7 +169,7 @@ It worked! .. code-block:: bash python manage.py runserver 8080 $ python manage.py runserver 8080 If you want to change the server's IP, pass it along with the port. So to listen on all public IPs (useful if you want to show off your work on other Loading @@ -177,7 +177,7 @@ It worked! .. code-block:: bash python manage.py runserver 0.0.0.0:8000 $ python manage.py runserver 0.0.0.0:8000 Full docs for the development server can be found in the :djadmin:`runserver` reference. Loading Loading @@ -256,7 +256,7 @@ that, run the following command: .. code-block:: bash python manage.py syncdb $ python manage.py syncdb The :djadmin:`syncdb` command looks at the :setting:`INSTALLED_APPS` setting and creates any necessary database tables according to the database settings Loading Loading @@ -308,7 +308,7 @@ and type this command: .. code-block:: bash python manage.py startapp polls $ python manage.py startapp polls That'll create a directory :file:`polls`, which is laid out like this:: Loading Loading @@ -424,7 +424,7 @@ Now Django knows to include the ``polls`` app. Let's run another command: .. code-block:: bash python manage.py sql polls $ python manage.py sql polls You should see something similar to the following (the ``CREATE TABLE`` SQL statements for the polls app): Loading Loading @@ -501,7 +501,7 @@ Now, run :djadmin:`syncdb` again to create those model tables in your database: .. code-block:: bash python manage.py syncdb $ python manage.py syncdb The :djadmin:`syncdb` command runs the SQL from :djadmin:`sqlall` on your database for all apps in :setting:`INSTALLED_APPS` that don't already exist in Loading @@ -521,7 +521,7 @@ API Django gives you. To invoke the Python shell, use this command: .. code-block:: bash python manage.py shell $ python manage.py shell We're using this instead of simply typing "python", because :file:`manage.py` sets the ``DJANGO_SETTINGS_MODULE`` environment variable, which gives Django Loading