Skip to content

janusnic/ecommerce

 
 

Repository files navigation

edX E-Commerce Service Travis_ Coveralls_

This repository contains the edX E-Commerce Service, which relies heavily on django-oscar, as well as all frontend and backend code used to manage edX's product catalog and handle orders for those products.

Prerequisites

  • Python 2.7.x (not tested with Python 3.x)
  • gettext
  • npm

Getting Started

Most commands necessary to run and develop the ecommerce service can be found in the included Makefile.

  1. Install the Python/Node/Bower requirements for local development:

    $ make requirements

Note: If you want to install only the production requirements run pip install -r requirements/production.txt.

  1. Setup the database:

    $ make migrate
  2. Populate the countries tables (used for storing addresses):

    $ python manage.py oscar_populate_countries
  3. Run the development server:

    $ make serve

Django Debug Toolbar is disabled by default. Enable it by setting the environment variable ENABLE_DJANGO_TOOLBAR.

Alternatively, you can launch the server using:

$ ENABLE_DJANGO_TOOLBAR=1 make serve

Asset Pipeline

Static files are managed via django-compressor and RequireJS (and r.js) are used to manage JavaScript dependencies. django-compressor compiles SASS, minifies JavaScript, and handles naming files to facilitate cache busting during deployment.

Both tools should operate seamlessly in a local development environment. When deploying to production, call make static to compile all static assets and move them to the proper location to be served.

When creating new pages that utilize RequireJS dependencies, remember new modules to build.js.

NOTE: The static file directories are setup such that the build output directory of r.js is read before checking for assets in ecommerce\static\. If you run make static or r.js locally (which you should not need to), make sure you delete ecommerce/static/build or run make static before continuing with development. If you do not all changes made to static files will be ignored.

Feature Switches

This app uses Waffle to manage feature gating/switching. Switches can be managed via Django admin. The following switches exist:

+--------------------------------+---------------------------------------------------------------------------+ | Name | Functionality | +================================+=======================+===================================================+ | user_enrollments_on_dashboard | Display a user's current enrollments on the dashboard user detail page | +--------------------------------+---------------------------------------------------------------------------+ | publish_course_modes_to_lms | Publish prices and SKUs to the LMS after every course modification | +--------------------------------+---------------------------------------------------------------------------+ | ENABLE_CREDIT_APP | Enable the credit checkout page from where student's can purchase credit | | | courses. | +--------------------------------+---------------------------------------------------------------------------+

Analytics

To use google analytics for specific events e.g., button clicks, you need to add the segment key into the settings file:

SEGMENT_KEY = 'your segment key'

Credit

To enable custom credit checkout page, please add the following waffle switch:

ENABLE_CREDIT_APP

Testing

To run the unit test suite followed by quality checks, run:

$ make validate

Acceptance Testing

For instructions on how to run the acceptance tests, please consult the README file located in the acceptance tests README.

Documentation ReadtheDocs_

License

The code in this repository is licensed under the AGPL unless otherwise noted. Please see LICENSE.txt for details.

How To Contribute

Contributions are welcome. Please read How To Contribute for details. Even though it was written with edx-platform in mind, these guidelines should be followed for Open edX code in general.

Reporting Security Issues

Please do not report security issues in public. Please email security@edx.org.

Mailing List and IRC Channel

You can discuss this code on the edx-code Google Group or in the #edx-code IRC channel on Freenode.

About

Django application used to manage edX's product catalog and handle orders for those products

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 79.7%
  • HTML 14.8%
  • JavaScript 3.9%
  • CSS 1.1%
  • Makefile 0.5%