diff options
| author | Kudz <kudzayibamhare@gmail.com> | 2024-04-24 16:31:10 +0200 |
|---|---|---|
| committer | nessita <124304+nessita@users.noreply.github.com> | 2024-07-04 15:30:52 -0300 |
| commit | 82c71f0168b1c132e499505609d285c6016ed4f2 (patch) | |
| tree | 808e8daf81bca38f5218b6717ad7c12fdf63e89e /docs/intro | |
| parent | 1005c2abd1ef0c156f449641e38c33e473989d37 (diff) | |
Relocated database setup details to install docs to simplify tutorial 2.
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
Diffstat (limited to 'docs/intro')
| -rw-r--r-- | docs/intro/tutorial02.txt | 49 |
1 files changed, 8 insertions, 41 deletions
diff --git a/docs/intro/tutorial02.txt b/docs/intro/tutorial02.txt index 3cda0d38d6..d43c82c5d2 100644 --- a/docs/intro/tutorial02.txt +++ b/docs/intro/tutorial02.txt @@ -17,48 +17,15 @@ Database setup Now, open up :file:`mysite/settings.py`. It's a normal Python module with module-level variables representing Django settings. -By default, the configuration uses SQLite. If you're new to databases, or -you're just interested in trying Django, this is the easiest choice. SQLite is -included in Python, so you won't need to install anything else to support your -database. When starting your first real project, however, you may want to use a -more scalable database like PostgreSQL, to avoid database-switching headaches -down the road. +By default, the :setting:`DATABASES` configuration uses SQLite. If you're new +to databases, or you're just interested in trying Django, this is the easiest +choice. SQLite is included in Python, so you won't need to install anything +else to support your database. When starting your first real project, however, +you may want to use a more scalable database like PostgreSQL, to avoid +database-switching headaches down the road. -If you wish to use another database, install the appropriate :ref:`database -bindings <database-installation>` and change the following keys in the -:setting:`DATABASES` ``'default'`` item to match your database connection -settings: - -* :setting:`ENGINE <DATABASE-ENGINE>` -- Either - ``'django.db.backends.sqlite3'``, - ``'django.db.backends.postgresql'``, - ``'django.db.backends.mysql'``, or - ``'django.db.backends.oracle'``. Other backends are :ref:`also available - <third-party-notes>`. - -* :setting:`NAME` -- The name of your database. If you're using SQLite, the - database will be a file on your computer; in that case, :setting:`NAME` - should be the full absolute path, including filename, of that file. The - default value, ``BASE_DIR / 'db.sqlite3'``, will store the file in your - project directory. - -If you are not using SQLite as your database, additional settings such as -:setting:`USER`, :setting:`PASSWORD`, and :setting:`HOST` must be added. -For more details, see the reference documentation for :setting:`DATABASES`. - -.. admonition:: For databases other than SQLite - - If you're using a database besides SQLite, make sure you've created a - database by this point. Do that with "``CREATE DATABASE database_name;``" - within your database's interactive prompt. - - Also make sure that the database user provided in :file:`mysite/settings.py` - has "create database" privileges. This allows automatic creation of a - :ref:`test database <the-test-database>` which will be needed in a later - tutorial. - - If you're using SQLite, you don't need to create anything beforehand - the - database file will be created automatically when it is needed. +If you wish to use another database, see :ref:`details to customize and get +your database running <database-installation>`. While you're editing :file:`mysite/settings.py`, set :setting:`TIME_ZONE` to your time zone. |
