A demo for hotel order booking system
Python: 3.8+
Django: 4.0+
MySQL
- clone source and cd to the project
git clone https://github.com/waketzheng/hotelbooksystem
cd hotelbooksystem
- create a virtual environment(use
poetry
: https://github.com/python-poetry/poetry)
poetry install --no-root
- activate it
poetry shell
- init database
(venv)$ python manage.py migrate
(venv)$ python manage.py loaddata fixtures/romanload_hotel.json
- run server
(venv)$ python manage.py runserver
-
open the url at webbrowser
- configure settings, database and email
echo '
DEBUG=0
DB_USER=your-database-user-name
DB_PASSWD=your-database-password
EMAIL=your-email
EMAIL_PASSWD=your-email-password
' > .env
Example of .env
:
DEBUG=0
DB_USER=root
DB_PASSWD=123456
EMAIL=waketzheng@gmail.com
EMAIL_PASSWD=123456
- create virtual environment and activate it
poetry install --no-root --no-dev
poetry shell
- create database for this project and migrate
./scripts/createdatabase.py
-
deploy as other django project
https://docs.djangoproject.com/en/4.0/howto/deployment/wsgi/gunicorn/