English | Ting Vit
Clone project v my
git clone https://github.com/sownt/TheOctoFood.git && cd TheOctoFood
Bn c th trin khai project ny bng docker-compose (khuyn khch) hoc trin khai trc tip bng python
Bn c th ci t Docker Desktop cho Windows/macOS hoc ci t Engine v compose cho Linux.
Trc tin bn cn to file .env
trong th mc /src/TheOctoFood/ ci bin mi trng cho project.
SECRET_KEY= # Django secret key
DATABASE_ENGINE=django.db.backends.mysql
DATABASE_NAME=theoctofood
DATABASE_USER= # MariaDB/MySQL username
DATABASE_PASSWORD= # MariaDB/MySQL password
DATABASE_HOST= # MariaDB/MySQL host
DATABASE_PORT=3306
LANGUAGE_CODE=en-us
TIME_ZONE=Asia/Ho_Chi_Minh
EMAIL_HOST= # SMTP host
EMAIL_HOST_USER= # SMTP username
EMAIL_HOST_PASSWORD= # SMTP password
EMAIL_PORT= # SMTP port
Sau chy lnh di Docker thc hin cc cng vic cn li
docker-compose up
Bn c th to n bng lnh
CREATE DATABASE IF NOT EXISTS `theoctofood` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
To mi trng o cho project
python -m venv .
Kch hot mi trng
Scripts\activate.bat # Windows
source bin/activate # Linux
Ci t cc packages ca project
pip install -r requirements.txt
To file .env
trong th mc /src/TheOctoFood/ ci bin mi trng cho project.
SECRET_KEY= # Django secret key
DATABASE_ENGINE=django.db.backends.mysql
DATABASE_NAME=theoctofood
DATABASE_USER= # MariaDB/MySQL username
DATABASE_PASSWORD= # MariaDB/MySQL password
DATABASE_HOST= # MariaDB/MySQL host
DATABASE_PORT=3306
LANGUAGE_CODE=en-us
TIME_ZONE=Asia/Ho_Chi_Minh
EMAIL_HOST= # SMTP host
EMAIL_HOST_USER= # SMTP username
EMAIL_HOST_PASSWORD= # SMTP password
EMAIL_PORT= # SMTP port
Bn c th nhp d liu mu t file /src/TheOctoFood/theoctofood.sql
vo database nu mun.
Cui cng l tch hp v chy project bng lnh di y
python manage.py migrate && python manage.py runserver 0.0.0.0:8000