diff --git a/docs/ref/contrib/gis/tutorial.txt b/docs/ref/contrib/gis/tutorial.txt
index 12c4768..bdcaae6 100644
|
a
|
b
|
Run ``migrate``
|
| 265 | 265 | --------------- |
| 266 | 266 | |
| 267 | 267 | After defining your model, you need to sync it with the database. First, |
| 268 | | let's look at the SQL that will generate the table for the |
| 269 | | ``WorldBorder`` model:: |
| | 268 | create a database migration: |
| 270 | 269 | |
| 271 | | $ python manage.py sqlall world |
| | 270 | .. code-block:: bash |
| | 271 | |
| | 272 | $ python manage.py makemigrations |
| | 273 | Migrations for 'world': |
| | 274 | 0001_initial.py: |
| | 275 | - Create model WorldBorder |
| | 276 | |
| | 277 | Let's look at the SQL that will generate the table for the ``WorldBorder`` |
| | 278 | model: |
| | 279 | |
| | 280 | .. code-block:: bash |
| | 281 | |
| | 282 | $ python manage.py sqlmigrate world 0001 |
| 272 | 283 | |
| 273 | 284 | This command should produce the following output: |
| 274 | 285 | |
| 275 | 286 | .. code-block:: sql |
| 276 | 287 | |
| 277 | | BEGIN; |
| 278 | 288 | CREATE TABLE "world_worldborder" ( |
| 279 | 289 | "id" serial NOT NULL PRIMARY KEY, |
| 280 | 290 | "name" varchar(50) NOT NULL, |
| … |
… |
This command should produce the following output:
|
| 292 | 302 | ) |
| 293 | 303 | ; |
| 294 | 304 | CREATE INDEX "world_worldborder_mpoly_id" ON "world_worldborder" USING GIST ( "mpoly" ); |
| 295 | | COMMIT; |
| 296 | 305 | |
| 297 | 306 | .. note:: |
| 298 | 307 | |
| … |
… |
This command should produce the following output:
|
| 300 | 309 | column is added through a separate ``SELECT AddGeometryColumn(...)`` |
| 301 | 310 | statement. |
| 302 | 311 | |
| 303 | | If this looks correct, run :djadmin:`migrate` to create this table in the database:: |
| | 312 | If this looks correct, run :djadmin:`migrate` to create this table in the |
| | 313 | database: |
| 304 | 314 | |
| 305 | | $ python manage.py migrate |
| 306 | | Creating table world_worldborder |
| 307 | | Installing custom SQL for world.WorldBorder model |
| | 315 | .. code-block:: bash |
| 308 | 316 | |
| 309 | | The :djadmin:`migrate` command may also prompt you to create an admin user. |
| 310 | | Either do so now, or later by running ``django-admin.py createsuperuser``. |
| | 317 | $ python manage.py migrate |
| | 318 | Operations to perform: |
| | 319 | Apply all migrations: admin, world, contenttypes, auth, sessions |
| | 320 | Running migrations: |
| | 321 | ... |
| | 322 | Applying world.0001_initial... OK |
| 311 | 323 | |
| 312 | 324 | Importing Spatial Data |
| 313 | 325 | ====================== |
| … |
… |
Next, edit your ``urls.py`` in the ``geodjango`` application folder as follows::
|
| 737 | 749 | url(r'^admin/', include(admin.site.urls)), |
| 738 | 750 | ] |
| 739 | 751 | |
| 740 | | Start up the Django development server: |
| | 752 | Create an admin user: |
| | 753 | |
| | 754 | .. code-block:: bash |
| | 755 | |
| | 756 | $ python manage.py createsuperuser |
| | 757 | |
| | 758 | Next, start up the Django development server: |
| 741 | 759 | |
| 742 | 760 | .. code-block:: bash |
| 743 | 761 | |
| 744 | 762 | $ python manage.py runserver |
| 745 | 763 | |
| 746 | | Finally, browse to ``http://localhost:8000/admin/``, and log in with the admin |
| 747 | | user created after running :djadmin:`migrate`. Browse to any of the ``WorldBorder`` |
| 748 | | entries -- the borders may be edited by clicking on a polygon and dragging |
| 749 | | the vertexes to the desired position. |
| | 764 | Finally, browse to ``http://localhost:8000/admin/``, and log in with the user |
| | 765 | you just created. Browse to any of the ``WorldBorder`` entries -- the borders |
| | 766 | may be edited by clicking on a polygon and dragging the vertexes to the desired |
| | 767 | position. |
| 750 | 768 | |
| 751 | 769 | .. _OpenLayers: http://openlayers.org/ |
| 752 | 770 | .. _Open Street Map: http://www.openstreetmap.org/ |