Cookiecutter django-SHOP is a blueprint for an e-commerce site based on django-CMS.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.github Update @pydanny and @webyneter bios Jun 12, 2018
docs adopted cookiecutter-django for django-shop Aug 4, 2018
hooks add compatibility layer for Python-2 Sep 19, 2018
tests
{{cookiecutter.project_slug}}
.editorconfig adopted cookiecutter-django for django-shop Aug 4, 2018
.gitattributes Add .gitattributes file. Dec 12, 2013
.gitignore Remove entry from .gitignore causing compose/local to match Jun 15, 2018
.travis.yml Clean up .travis.yml Jun 5, 2018
Pipfile add support for Docker Sep 19, 2018
README.rst add support for Docker Sep 19, 2018
__main__.py migrated all 6 demos to a cookiecutter template Aug 13, 2018
cookiecutter.json add support for Docker Sep 19, 2018
pytest.ini Move pytest settings from setup.cfg to pytest.ini May 5, 2018

README.rst

Cookiecutter for django-SHOP

Powered by Cookiecutter, cookiecutter-django-shop is a set of templates for jumpstarting a django-SHOP project quickly.

Use this Cookiecutter to run one of the example shops, supplied with django-SHOP.

  • Use them to get a first impression on its features.
  • Select the example which is the most similar to your own requirements as a blueprint. There replace the product models with your own implementations.

Quick How-To

Install cookiecutter, pipenv and npm onto your operating system, for instance

on Ubuntu

sudo apt-get install python-cookiecutter pipenv nodejs npm

on MacOS

sudo brew install cookiecutter pipenv node

Note

If pipenv is not available through your package manager, try with pip install pipenv.

then change into your projects directory and invoke

cookiecutter --no-input https://github.com/awesto/cookiecutter-django-shop

This creates a directory named my-shop. Using this directory, either run the django-SHOP demo locally, or deploy it onto a Docker Machine.

Run django-SHOP demo locally

Running the django-SHOP demo locally is probably the best choice, when you want to experiment with alternative product models and hence want to edit the code generated by the Cookiecutter template.

cd my-shop
pipenv install --sequential
pipenv shell
pip install --no-deps https://github.com/jrief/django-cms/archive/fixes/load-fixture.zip
pip install --no-deps https://github.com/awesto/django-shop/archive/drafts/cms-3.5.zip
npm install
export DJANGO_DEBUG=1
./manage.py makemigrations myshop
./manage.py initialize_shop_demo
./manage.py runserver

Point a browser onto http://localhost:8000/ and start surfing. The first request takes a few seconds since all downloaded images must be thumbnailed beforehand.

This demo uses SQLite as its database. It does not neither support caching, nor full text searches.

In case you want to access the Django admin interface, log in as admin with password secret.

Run django-SHOP demo in Docker

Running the django-SHOP demo inside a Docker container, allows you to test all features such as full text search, proper caching, running asynchronous tasks and uses a Postgres database. Check that your Docker machine is running, if unsure invoke docker-machine ip.

cd my-shop
docker-compose up --build -d

Point a browser onto http://<docker-machine-ip>:9009/ and start surfing. Determine the IP address using docker-machine ip. The first request takes a few seconds since all downloaded images must be thumbnailed beforehand.

In case you want to access the Django admin interface, log in as admin with password secret.

Where to proceed from here?

Now that you have a simple working project, it usually is much easier to evolve into a real project for the merchant's needs. Remember that there are 6 different demos and depending on the requirements, use one of them as a blueprint.

Rerun the above cookiecutter command without the --no-input flag and answer the questions. Use the generated Django models as blueprint, rename them and replace their fields to whatever is approriate to the shop's specifications.