A click-to-install solution has been provided for convenience (Windows only). Assuming you have MySQL installed correctly (open a terminal and run mysql -V to verify), the installation process can be simplified to the following steps:
git clone https://github.com/miksingsoju/barhop.gitCreate a .env file (it should be beside manage.py in the barhop folder) with the following details.
# Django secret key
SECRET_KEY='your_secret_key_here'
# Django admin
DJANGO_SUPERUSER_USERNAME = 'afterhoursco'
DJANGO_SUPERUSER_EMAIL = 'admin@afterhoursco.com'
DJANGO_SUPERUSER_PASSWORD = 'password'
# Database connection
DB_NAME = 'barhop'
DB_USER = 'afterhoursco'
DB_PASSWORD = 'password'
DB_HOST = 'localhost'
DB_PORT = '3306'
# Debug mode (True for development, False for production)
DEBUG='True'- Inside the repository folder, there should be a file
install.bat. Simply double-click to automatically install the project. - A terminal will pop up to prompt you for your MySQL root password.
- Note: the terminal will exit if you enter the wrong password. If this happens, you can double-click
install.batagain to retry. - Installation should begin after entering the correct password.
- Note: the terminal will exit if you enter the wrong password. If this happens, you can double-click
- If the terminal exits at any point in time, something has likely gone wrong. Contact me (Adara) for troubleshooting or proceed with Manual Installation instead.
git clone https://github.com/miksingsoju/barhop.git
cd barhopNote: for Unix-based systems, use python3 instead for all python commands.
python -m venv venv
venv\scripts\activatepip install -r requirements.txtCreate a .env file (it should be beside manage.py in the barhop folder) with the following details.
# Django secret key
SECRET_KEY='your_secret_key_here'
# Django admin
DJANGO_SUPERUSER_USERNAME = 'afterhoursco'
DJANGO_SUPERUSER_EMAIL = 'admin@afterhoursco.com'
DJANGO_SUPERUSER_PASSWORD = 'password'
# Database connection
DB_NAME = 'barhop'
DB_USER = 'afterhoursco'
DB_PASSWORD = 'password'
DB_HOST = 'localhost'
DB_PORT = '3306'
# Debug mode (True for development, False for production)
DEBUG='True'For this section, we assume you have MySQL installed, running and that you know the credentials for your root user. In a separate terminal, execute the following:
mysql -u root -p -e "CREATE USER 'afterhoursco'@'%' IDENTIFIED BY 'password';
CREATE DATABASE barhop; GRANT ALL PRIVILEGES ON barhop.* TO 'afterhoursco'@'%';"MySQL should prompt you for your root password. Should there be no errors, you may exit this terminal.
On the original terminal (with venv running), execute the following. If the .env file was created properly, the following command should also automatically create a Django superuser with no input.
python manage.py makemigrations
python manage.py migrate
python manage.py createsuperuser --no-inputAssuming the virtual environment has already been activated, the server can be started with the following:
python manage.py runserverOtherwise, a simple click-to-run solution has been been provided in the form of a batch file (Windows only). Simply double-click run.bat to start the server.
Another additional batch file to reset the database and migrations has been provided for convenience (Windows only). Simply click reset-database.bat to rebuild an empty database from scratch. Note that when entering the password, use the one for the afterhoursco user.
TBA