Follow these steps to run the project on your local machine: All commands are on CLI unless specified
git clone https://github.com/BIJJUDAMA/Hangman-Gamecd Hangman-Gamecd hangman_projectpython -m venv venvvenv\Scripts\activatesource venv/bin/activatepip install -r requirements.txtOpen MySQL and run:
CREATE DATABASE hangman_db_local;Create a new user if you are not going to use root in MySQL:
CREATE USER 'hangman_user'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON hangman_db_local.* TO 'hangman_user'@'localhost';
FLUSH PRIVILEGES;Open the file:
Hangman-Game/hangman_project/hangman_project/settings.py
Update the DATABASES configuration:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'hangman_db_local', #The name of the database you created and gave privileges to while creating new user
'USER': 'hangman_user', # Replace with your MySQL username that you created
'PASSWORD': 'your_secure_password', # Replace with your MySQL password
'HOST': 'localhost',
'PORT': '3306',
'OPTIONS': {
'init_command': "SET sql_mode='STRICT_TRANS_TABLES'",
},
}
}python manage.py migrate
python manage.py runserverYou’re now ready to play the Hangman Game in your browser at:
http://127.0.0.1:8000/