[Django] #35634: Add Detailed Steps for Setting Up MySQL in Django Tutorials

9 views
Skip to first unread message

Django

unread,
Jul 26, 2024, 3:25:11 PM7/26/24
to django-...@googlegroups.com
#35634: Add Detailed Steps for Setting Up MySQL in Django Tutorials
-------------------------------+-----------------------------------------
Reporter: Jerome Cagado | Type: New feature
Status: new | Component: Documentation
Version: 5.0 | Severity: Normal
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+-----------------------------------------
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
```
2. 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).
--
Ticket URL: <https://code.djangoproject.com/ticket/35634>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jul 26, 2024, 3:34:19 PM7/26/24
to django-...@googlegroups.com
#35634: Add Detailed Steps for Setting Up MySQL in Django Tutorials
-------------------------------+--------------------------------------
Reporter: Jerome Cagado | Owner: (none)
Type: New feature | Status: closed
Component: Documentation | Version: 5.0
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Natalia Bidart):

* resolution: => wontfix
* status: new => closed

Comment:

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 [https://diataxis.fr/ 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
[https://docs.djangoproject.com/en/dev/intro/tutorial02/#database-setup 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!
--
Ticket URL: <https://code.djangoproject.com/ticket/35634#comment:1>
Reply all
Reply to author
Forward
0 new messages