- Install Python 3.10.4.
- Install Redis and start it using
redis-server
use default port of 6379 - Clone repo to somewhere sensible on machine
git clone https://github.com/coliin8/book_explorer.git
cd book_explorer
- Setup Virtual Env
python -m venv .
- Activate venv
1. Windows:
Scripts\activate.bat
2. Linux/Mac:source bin/activate
- Run
pip install -f requirements.txt
- Setup Environmental Variables
- AWS_ACCESS_KEY_ID=Your_Key_id
- AWS_SECRET_ACCESS_KEY=Your_Secret_Token
- Run
python manage.py migrate
to run migration and generate database - Run
python manage.py runserver
- Run
celery --app book_explorer worker -l info
- Assume you have checked out repo from git
cd book_explorer
- Open docker-compose.yml file
- Update Environment Variables with your details:
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- Update Environment Variables with your details:
docker-compose up -d
- Web App on http://localhost:8000/books
- Flower on http://localhost:5555
- Redis exposed on redis://localhost:6379
pytest
First we’ll need to create a user who can login to the admin site. Run the following command:
python manage.py createsuperuser
Enter your desired username and press enter.
Username: admin
You will then be prompted for your desired email address:
Email address: [email protected]
The final step is to enter your password. You will be asked to enter your password twice, the second time as a confirmation of the first.
Password: **********
Password (again): *********
Superuser created successfully.
python manage.py runserver
You can login with admin user credentials