CML is a reusable Django app for data exchange in CommerceML 2 standard.
This packet is available here: https://pypi.org/project/django-cml2
- Python 3.3, 3.4, 3.5, 3.6
- Django 3.2
Install using pip:
pip install django-cml2
or clone the repo and add to your virtual environment venv:
# cd <your_project> # source venv/bin/activate git clone https://github.com/sergey-gru/django-cml2.git pip install --editable django-cml2
Add 'cml' to your settings.py like this:
INSTALLED_APPS = [ ... 'cml', ]
Include the cml URLconf in your project urls.py like this:
urlpatterns = [ ... path('cml', include('cml.urls')), ]
To create cml models run:
python manage.py migrate cml
Create a template of cml_delegate.py:
python manage.py cml_init
Register it to settings.py file like this:
CML_USER_DELEGATE = 'cml_delegate' # CML_USER_DELEGATE = 'app.cml_delegate'
Modify methods to stack new cml packet with your django models.
Add logger settings to your settings.py:
LOGGING = { 'version': 1, ... 'handlers': { 'console': {...}, 'log_debug': {...}, 'log_info': {...}, }, 'loggers': { ... # Logging important change process 'cml': { 'handlers': ['console', 'log_debug', 'log_info'] if DEBUG else ['log_info'], 'level': 'DEBUG', 'propagate': False, }, } }
- 1.0.0 This version was forked from https://github.com/ArtemiusUA/django-cml