.. _installation: ############ Installation ############ A guide on how to install Salesman. .. raw:: html

1. Install using pip

.. code:: bash pip install django-salesman .. note:: Optionally install the `Pygments `_ library for a nicer code display in admin. You can use the command ``pip install django-salesman[pygments]`` .. raw:: html

2. Add to your settings.py

.. code:: python INSTALLED_APPS = [ ... 'salesman.core', 'salesman.basket', 'salesman.checkout', 'salesman.orders', 'salesman.admin', 'rest_framework', ] .. raw:: html

3. Add necessary urls in urls.py

.. code:: python from django.urls import include, path urlpatterns = [ ... path('api/', include('salesman.urls')), ] .. raw:: html

4. Run the migrations and start server

.. code:: bash python manage.py migrate python manage.py runserver .. tip:: It is recommended to configure and setup all Salesman models as swappable even if it's not necessary at the beginning. This will future-proof your application in case you wish to add it later. This has to be done before the initial migrations are created. See :ref:`swappable_models`. **Done!** Salesman is installed and you can navigate the API by going to ``http://localhost:8000/api/``. But since no product types are configured there is nothing to be added to the basket yet.