Skip to content

mitrofun/simple_shop

Repository files navigation

Simple shop

Example of a store with a catalog and shopping cart

Build Status

Installation

git clone https://github.com/mitrofun/simple_shop.git

Run

Local develop

Install requirements for backend

cd simple_shop
pip3 install -r requirements.txt

Install requirements for frontend

WARNING to run the application locally, you must install it on your system yarn and gulp and after run command for download library for frontend

yarn install
gulp copy

WARNING By default, sqlite is used for local startup, which creates database file located at the root of the project, to override this behavior, set the path of the variable in environment variable DATABASE_URL, for example sqlite.

export DATABASE_URL='sqlite:////full/path/to/your/database/file.sqlite'

For more information on how to set up a database connection, see here

Migration

After roll migration

python3 manage.py migrate

or use command

make migrate

Create admin

Create administrator with username admin and password admin

python3 manage.py createdefaultuser

or use command

make user

Run develop server

After run develop server

python3 manage.py runserver

Fixtures

To demonstrate the project, it has fixtures with categories and products. To load fixtures, use the following commands

mkdir -p media/products && cp -rf fixtures/products media
python3 manage.py loaddata fixtures/category.json

Custom commands

createdefaultuser

Run command

python3 manage.py createdefaultuser

create user admin with admin permission and simple password admin

Quick run

The project has a quick start script that does all the operations described above. To run it, run the following command

./quick_start.sh

Run in docker

docker-compose up --build

Requirements

  • python 3.6+
  • Django 2.1+
  • see all requirements in base.txt

Tests

For run test use the following commands

pip3 install -r requirements/dev.txt
pytest

Contributors

License

simple_shop is released under the MIT License. See the LICENSE file for more details.

About

Example of a store with a catalog and shopping cart on Django

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published