Skip to content

ParadoxicalPilgrim/Hangman-Game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hangman Game - Local Setup Guide

Follow these steps to run the project on your local machine: All commands are on CLI unless specified


Step 1: Clone the Repository

git clone https://github.com/BIJJUDAMA/Hangman-Game

Step 2: Navigate to the Project Directory

cd Hangman-Game

Step 3: Enter the Django Project Root

cd hangman_project

Step 4: Create a Virtual Environment

python -m venv venv

Step 5: Activate the Virtual Environment

On Windows:

venv\Scripts\activate

On macOS/Linux:

source venv/bin/activate

Step 6: Install Dependencies

pip install -r requirements.txt

Step 7: Create a MySQL Database

Open MySQL and run:

CREATE DATABASE hangman_db_local;

Step 8: Configure Database Settings

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'",
        },
    }
}

Step 9: Apply Migrations and Run the Server

python manage.py migrate
python manage.py runserver

You’re now ready to play the Hangman Game in your browser at:
http://127.0.0.1:8000/

About

Simple Hangman-Game app made with JS and Django

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors