Skip to content

It's my biggest peroject that i've ever done, I spent a lot of time on it

License

Notifications You must be signed in to change notification settings

Benfoxyy/Django-Online-Shop

Repository files navigation

Django Online Shop

It's my biggest peroject that i've ever done, I spent a lot of time on it

python django docker postgresql javascript jquery html5 css3 redis gunicorn nginx nginx






Guideline

Goal

I create this website for testing all skills that i've learned


Extera features

I added a lot of useful tools to make this site better, These features include :

Development & Deployment

I separate all codes and files for use it on Development or Deployment


Caching system

I used redis for caching system in my project


Reformatted code

I reformat all codes depends on PEP8 rule with Flake8 and Black


Testing system

I used Pytest for testing system and test various parts of site


reCAPTCHA V3

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.


Documents

I leave a full documention about how the website works in Documents folder


Various User

This shop has 3 types of user :

  • customer


  • admin


  • superuser

Superuser can remove or add some stuff that admin couldn't

Each of them has a specific profile that has own properties


Sitemap

A sitemap is a file where you provide information about the pages, videos, and other files on your site, and the relationships between them


Payment Method

I used ZarinPal for my Payment Method


Setup

First step

For setup this site and walk through it you need to have docker on you computer

Clone it

Next step is cloning this project

git clone https://github.com/Benfoxyy/Django-Online-Shop.git

Docker

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 :

Development

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

django_debug_toolbar is an useful library for django to get reports of every single page and manage it better


Pytest

pytest is the most powerful testing system for python, for using it enter this command :

docker-compose exec backend sh -c "pytest"

Flake8 and Black

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"

Deployment

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 :

Gunicorn and Nginx

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 .

DB schema

Thanks for visiting

I hope that you enjoy it, Let me know if you have any suggestion

About

It's my biggest peroject that i've ever done, I spent a lot of time on it

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published