Skip to main content
  1. All Posts/

django-ecommerce

eCommerce CSS

AN E-COMMERCE DJANGO PROJECT.

Django ecommerce website with full-fledged backend features like mailing order to customers, printing order pdfs and managing asynchronous tasks.
The templates used in the frontend is designed by https://boostrapious.com.
The templates are great for learning how to build an e-commerce website.

Follow the following steps to run this in your local machine

virtualenv env
source env/bin/activate
pip install -r requirements.txt
python manage.py makemigrations
python manage.py migrate
python manage.py runserver

Follow the following steps to run the asynchronous task manager (Celery + RabbitMQ)

  1. Install RabbitMQ on Linux by executing the command below from the shell

    apt-get install rabbitmq
    <p>
      If you&#8217;re using macOS or Windows, click <a rel="nofollow noopener" target="_blank" href="https://www.rabbitmq.com/download.html">here</a> to download the standalone version of RabbitMQ. </li> 
      
      <li>
        After installing, RabbitMQ, execute the following commmand to launch RabbitMQ</p> <pre>rabbitmq-server</pre>
      </li>
      
      <li>
        Open a new shell, change directory to your project directory and start your<br /> celery worker with the following command</p> <pre>celery -A myshop worker -l info</pre>
        
        <p>
          Note that celery has been installed when you ran &#8216;pip install -r requirements.txt&#8217; </li> 
          
          <li>
            To monitor asynchronous tasks with Flower &#8211; a web application for monitoring<br /> celery. Open a new shell and run the following command from your project directory.</p> <pre>celery -A myshop flower</pre>
          </li></ol> 
          
          <h2 dir="auto">
            <a rel="nofollow noopener" target="_blank" id="user-content-technologies-used" class="anchor" aria-hidden="true" href="#technologies-used"></a>Technologies used
          </h2>
          
          <ol dir="auto">
            <li>
              Weasyprint &#8211; To create pdf receipt for orders. Find implementation in<br /> views.py of orders app (line 44 &#8211; 52).
            </li>
            <li>
              Celery &#8211; To handle asynchronous tasks &#8211; Example: sending order mails<br /> to customers. Find implementation in celery.py of ecommmerce folder, tasks.py of orders app and line 28 of views.py
            </li>
            <li>
              RabbitMQ &#8211; Used as message broker for celery
            </li>
            <li>
              Flower &#8211; Used to monitor Celery
            </li>
          </ol>