- Fork the repo and clone it.
- Go in the repo and setup virtualenvironment using
python -m venv env - Then activate the environment using
On Windowssource env\Scripts\activateOn MacOS/Linuxsource env/bin/actiavte - At the root of your project directory
pip install -r engbook/requirements.txt-
Rename
.env.exampleto.env -
Put the
.envfile in/engbookset secret key for your django project. -
You can use [https://djecrety.ir/] to generate your secret key
-
Set
DEBUG = Trueduring development in.envfile -
After the above setup, run
python engbook/manage.py makemigrationspython engbook/manage.py migrate -
Start the backend server (testing server)
python engbook/manage.py runserverRuns the backend server at default port8000.
Open http://localhost:8000 to view it in the browser.
The page will reload if you make edits.
- Start the production server (nginx)
sudo docker-compose up --buildRuns the backend server, bound to 0.0.0.0:80. This will NOT hot reload, and needs sudo permissions to run. Do not use this with debug=True in the .env file.
Open http://localhost to view it in the browser.
To spin down :
sudo docker-compose down --remove-orphans
- If you are adding any new requirements for the project, make sure that you are adding it to
requirements.txtin the engbook folder. - Use only
npm install package_nameto add new packages to the frontend part.