1
0
mirror of https://github.com/django/django.git synced 2025-07-04 17:59:13 +00:00

magic-removal: Started reworking docs/tutorial01.txt

git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2637 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2006-04-09 23:17:00 +00:00
parent 25b712819d
commit 90ed9fc917

View File

@ -6,13 +6,13 @@ By Adrian Holovaty <holovaty@gmail.com>
Let's learn by example. Let's learn by example.
Throughout this tutorial, we'll walk you through the creation of a simple Web Throughout this tutorial, we'll walk you through the creation of a basic
poll application. blogging application.
It'll consist of two parts: It'll consist of two parts:
* A public site that lets people vote in polls and view poll results. * A public site that lets people read your blog entries and submit comments.
* An admin site that lets you add, change and delete polls behind the scenes. * An admin site that lets you add, change and delete entries and comments.
We'll assume you have `Django installed`_ already. We'll assume you have `Django installed`_ already.
@ -65,9 +65,9 @@ These files are:
The development server The development server
---------------------- ----------------------
Change into the ``myproject`` directory, if you haven't already, and run the Let's verify this worked. Change into the ``myproject`` directory, if you
command ``python manage.py runserver``. You'll see the following output on the haven't already, and run the command ``python manage.py runserver``. You'll see
command line:: the following output on the command line::
Validating models... Validating models...
0 errors found. 0 errors found.
@ -76,31 +76,30 @@ command line::
Development server is running at http://127.0.0.1:8000/ Development server is running at http://127.0.0.1:8000/
Quit the server with CONTROL-C (Unix) or CTRL-BREAK (Windows). Quit the server with CONTROL-C (Unix) or CTRL-BREAK (Windows).
(If you get an error about ``DATABASE_ENGINE``, edit your ``settings.py`` file
to change the ``DATABASE_ENGINE`` setting to point to the correct database, and
make sure you have the right database libraries installed -- such as PostgreSQL's
psycopg or MySQL's MySQLdb.)
You've started the Django development server, a lightweight, pure-Python Web You've started the Django development server, a lightweight, pure-Python Web
server that builds on the BaseHTTPServer included in Python's standard library. server. We've included this with Django so you can develop things rapidly,
We've included this with Django so you can develop things rapidly, without without having to deal with configuring Apache until you're ready for
having to deal with configuring Apache until you're ready for production. production.
DON'T use this server in anything resembling a production environment. It's Now's a good time to note: DON'T use this server in anything resembling a
intended only for use while developing. production environment. It's intended only for use while developing.
.. admonition:: Changing the port .. admonition:: Changing the port
By default, the ``runserver`` command starts the development server on port By default, the ``runserver`` command starts the development server on port
8000. If you want to change the server's port, pass it as a command-line 8000. If you want to change the server's port, pass it as a command-line
argument:: argument. For instance, this command starts the server on port 8080::
python manage.py runserver 8080 python manage.py runserver 8080
Full docs for the development server are at `django-admin documentation`_.
Now that the server's running, visit http://127.0.0.1:8000/ with your Web Now that the server's running, visit http://127.0.0.1:8000/ with your Web
browser. You'll see a "Welcome to Django" page, in pleasant, light-blue pastel. browser. You'll see a "Welcome to Django" page, in pleasant, light-blue pastel.
It worked! It worked!
.. django-admin documentation: http://www.djangoproject.com/documentation/django_admin/
Database setup Database setup
-------------- --------------