I create this website for testing all skills that i've learned
I added a lot of useful tools to make this site better, These features include :
I separate all codes and files for use it on Development or Deployment
I used redis for caching system in my project
I reformat all codes depends on PEP8 rule with Flake8 and Black
I used Pytest for testing system and test various parts of site
I used reCAPTCHA for prevent from robots to enter the site .
Then why version 3 ?
reCAPTCHA v3 returns a score for each request without user friction. The score is based on interactions with your site and enables you to take an appropriate action for your site. Register reCAPTCHA v3 keys on the reCAPTCHA Admin console.
I leave a full documention about how the website works in Documents folder
This shop has 3 types of user :
Superuser can remove or add some stuff that admin couldn't
Each of them has a specific profile that has own properties
A sitemap is a file where you provide information about the pages, videos, and other files on your site, and the relationships between them
I used ZarinPal for my Payment Method
For setup this site and walk through it you need to have docker on you computer
Next step is cloning this project
git clone https://github.com/Benfoxyy/Django-Online-Shop.git
Docker is a powerful tool for run, deploying and transferring project, so i decided to use it .
As i said i separet my site, so for running it on development or deployment mode, you should follow one of these section :
docker-compose up --build -d
By running this command everything creat and run automaticlly, after everything is over you can oppen 127.0.0.1:8000 on your browser to see the resault
This version of website is for developers to testing and editting
This version has some tools that it is not exist in Deployment like :
django_debug_toolbar is an useful library for django to get reports of every single page and manage it better
pytest is the most powerful testing system for python, for using it enter this command :
docker-compose exec backend sh -c "pytest"
As i said Flake8 and Black are helping for reformat all codes by PEP8 rule, for using enter this command :
docker-comopose exec backend sh -c "black . -l 78 && flake8"
docker-compose -f docker-compose-deployment.yml up --build -d
By running this command everything creat and run automaticlly, after everything is over you can oppen 127.0.0.1 on your browser to see the resault
This version of website is for normal user to take a look to site
This version has some tools that it is not exist in Development like :
To set your project to deployment mode, you have to change DEBUG mode to False . This thing is a good way to make your site more secure but there is a disadvantages, statics and medias doesn't serve moreover django can't transfer requests on website so it's the time that Gunicorn and Nginx come .