Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 34c8ff5

Browse files
Merge pull request #42 from j-harishankar/master
Change default database backend from SQLite3 to MySQL in settings.py as mentioned in the readme.
2 parents 4cdc2da + 470312a commit 34c8ff5

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

‎README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
```
2929
1. git clone https://github.com/gowthamand/django-crud-ajax-login-register-fileupload
3030
31-
2. Change settings.py MYSQL CONFIGURATIONS (name, user, password)
31+
2. Change settings.py MYSQL CONFIGURATIONS (name, user, password) [Make sure to install mysqlclient: pip install mysqlclient]
3232
3333
3. cd django-crud-ajax-login-register-fileupload
3434

‎mysite/settings.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,18 @@
7373
# Database
7474
# https://docs.djangoproject.com/en/4.1/ref/settings/#databases
7575

76+
# Use MySQL as the database backend
77+
# Make sure to install mysqlclient: pip install mysqlclient
7678
DATABASES = {
7779
'default': {
78-
'ENGINE': 'django.db.backends.sqlite3',
79-
'NAME': BASE_DIR / 'db.sqlite3',
80+
'ENGINE': 'django.db.backends.mysql',
81+
'NAME': 'your_db_name', # Update this to your database name
82+
'USER': 'your_db_user', # Update this to your database user
83+
'PASSWORD': 'your_db_password', # Update this to your database password
84+
'HOST': 'localhost', # Set to your MySQL host, usually 'localhost'
85+
'PORT': '3306',
8086
}
8187
}
82-
8388
# Password validation
8489
# https://docs.djangoproject.com/en/4.1/ref/settings/#auth-password-validators
8590

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /