/hotelbooksystem

a simple book system for romanload hotel(virtual)

Primary LanguagePythonMIT LicenseMIT

hotelbooksystem

A demo for hotel order booking system

Base on

Python: 3.8+

Django: 4.0+

MySQL

Debug

  1. clone source and cd to the project
git clone https://github.com/waketzheng/hotelbooksystem
cd hotelbooksystem
  1. create a virtual environment(use poetry: https://github.com/python-poetry/poetry)
poetry install --no-root
  1. activate it
poetry shell
  1. init database
(venv)$ python manage.py migrate
(venv)$ python manage.py loaddata fixtures/romanload_hotel.json
  1. run server
(venv)$ python manage.py runserver
  1. open the url at webbrowser

    http://127.0.0.1:8000/

Production

  1. 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
  1. create virtual environment and activate it
poetry install --no-root --no-dev
poetry shell
  1. create database for this project and migrate
./scripts/createdatabase.py
  1. deploy as other django project

    https://docs.djangoproject.com/en/4.0/howto/deployment/wsgi/gunicorn/