Check out the post.
-
Fork/Clone
-
Create and activate a virtual environment:
$ python3 -m venv venv && source venv/bin/activate
-
Install the requirements:
(venv)$ pip install -r requirements.txt
-
Apply the migrations:
(venv)$ python manage.py migrate
-
Populate the database with randomly generated data (amount = number of purchases):
(venv)$ python manage.py populate_db --amount 2500
-
Create a superuser, and run the server:
(venv)$ python manage.py createsuperuser (venv)$ python manage.py runserver
-
You can then see the charts here:
- http://127.0.0.1:8000/shop/statistics/ - stats view
- http://127.0.0.1:8000/admin/statistics/ - new admin view
- http://127.0.0.1:8000/admin/shop/ - extended admin view