Opened 3 months ago

Closed 3 months ago

#35634 closed New feature (wontfix)

Add Detailed Steps for Setting Up MySQL in Django Tutorials

Reported by: Jerome Cagado Owned by:
Component: Documentation Version: 5.0
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The current tutorial in "Writing your first Django app, part 2" lacks detailed, step-by-step instructions for setting up Django with a MySQL database. Specifically, there are missing steps for installing MySQL dependencies and configuring the DATABASES setting in settings.py.

Steps to Reproduce:

  1. Follow the tutorial in "Writing your first Django app, part 2".
  2. Notice that detailed instructions for setting up MySQL, such as installing dependencies and configuring the DATABASES setting in settings.py, are not provided.

Expected Behavior:
The tutorial should include:

  • Detailed steps for installing MySQL dependencies.
  • Clear instructions for configuring the DATABASES setting in settings.py for MySQL.

Actual Behavior:
The tutorial currently lacks these steps, making it challenging for users who want to set up Django with MySQL.

Proposed Solution:
Update the tutorial to include the following steps:

  1. Install MySQL and mysqlclient:

`bash
pip install mysqlclient
`

  1. Configure the DATABASES setting in settings.py:

`python
DATABASES = {

'default': {

'ENGINE': 'django.db.backends.mysql',
'NAME': 'mydatabase',
'USER': 'mydatabaseuser',
'PASSWORD': 'mypassword',
'HOST': 'localhost',
'PORT': '3306',

}

}
`

Additional Information:
I followed the contributing guidelines as outlined in the [CONTRIBUTING.rst file](https://github.com/django/django/blob/main/CONTRIBUTING.rst).

Change History (1)

comment:1 by Natalia Bidart, 3 months ago

Resolution: wontfix
Status: newclosed

Hello Jerome, thank you for your interest in making the Django Tutorial better!

Despite we understand how some people would like to use MySQL with Django, the tutorial follows the diátaxis approach when writing docs. Specifically, a tutorial should be the smoother and simplest learning journey for someone that is not familiar with the topic being presented, and this is why the simplest setup with sqlite is used.

The tutorial has a clear reference to visit more specific docs for using/installing other DB backends (see sentence If you wish to use another database, see details to customize and get your database running. Because of this, we won't be accepting this ticket at this time. But thanks again for the time you invested in this!

Note: See TracTickets for help on using tickets.
Back to Top