License: | MIT |
---|
Hi, welcome to my eComerce website Project.
This project was developed with Python 3.9, Django 3.1.13, Postgresql 12.6, Wompi and CookieCutter.
In this project you can add items to the store as administrator, manage user accounts, make and edit orders of different quantities of products, make online payments with Wompi and manage refunds
This project can be used immediately with docker and docker compose.
- Docker; if you don’t have it yet, follow the installation instructions.
- Docker Compose; refer to the official documentation for the installation guide.
- Pre-commit (optional); refer to the official documentation for the installation guide.
This can take a while, especially the first time you run this particular command on your development system:
$ docker-compose -f local.yml build
This brings up both Django and PostgreSQL. The first time it is run it might take a while to get started, but subsequent runs will occur quickly.
Open a terminal at the project root and run the following for local development:
$ docker-compose -f local.yml up
As with any shell command that we wish to run in our container, this is done using the docker-compose -f local.yml run --rm command
:
$ docker-compose -f local.yml run --rm django python manage.py migrate $ docker-compose -f local.yml run --rm django python manage.py createsuperuser
- Python 3.9
- Postgresql 12.6
Create a virtual enviroment:
$ python3.9 -m venv <virtual env path>
Activate the virtual enviroment:
$ source <virtual env path>/bin/activate
Install development requirements:
$ cd <what you have entered as the project_slug at setup stage> $ pip install -r requirements/local.txt $ pip install -r requirements/base.txt $ pip install -r requirements/production.txt
Create a new PostgreSQL database using createdb, where shop is the database name and <password> is the password of your postgres account:
$ createdb shop -U postgres --password <password>
Apply migrations and create super user:
$ python manage.py migrate $ python manage.py createsuperuser
Run:
$ python manage.py runserver
To create a normal user account, just go to Sign Up and fill out the form. Once you submit it, you'll see a "Verify Your E-mail Address" page. Go to your console to see a simulated email verification message. Copy the link into your browser. Now the user's email should be verified and ready to go.
For convenience, you can keep your normal user logged in on Chrome and your superuser logged in on Firefox (or similar), so that you can see how the site behaves for both kinds of users.
you can add, delete and update store items. The sing in admin page is at the following link: https://localhost/admin/
Wompi is the payment method chosen for the project, it was configured in sandbox mode. To make payments choose any method offered by the documentation page.
The file with enviroment files was saved by default, if you need to config a enviroment variables go to .env/
. For more details : click-me.
Running type checks with mypy:
$ mypy shop
To run the tests, check your test coverage, and generate an HTML coverage report:
$ coverage run -m pytest $ coverage html $ open htmlcov/index.html
$ pytest
Moved to Live reloading and SASS compilation.
See detailed cookiecutter-django Docker documentation.