Skip to main content

Application for data exchange in CommerceML 2 standard. This is a new version with new architecture

Project description

CML is a reusable Django app for data exchange in CommerceML 2 standard.

This packet is available here: https://pypi.org/project/django-cml2

Requirements

  • Python 3.3, 3.4, 3.5, 3.6

  • Django 3.2

Quick start

  1. 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
  2. Add ‘cml’ to your settings.py like this:

    INSTALLED_APPS = [
        ...
        'cml',
    ]
  3. Include the cml URLconf in your project urls.py like this:

    urlpatterns = [
        ...
        path('cml', include('cml.urls')),
    ]
  4. To create cml models run:

    python manage.py migrate cml
  5. Create a template of cml_delegate.py:

    python manage.py cml_init
  6. Register it to settings.py file like this:

    CML_USER_DELEGATE = 'cml_delegate'
    # CML_USER_DELEGATE = 'app.cml_delegate'
  7. Modify methods to stack new cml packet with your django models.

  8. Add logger settings to your settings.py:

    LOGGING = {
        'version': 1,
        ...
    
        'handlers': {
            'console': {...},
            'log_debug': {...},
            'log_info': {...},
        },
    
        'loggers': {
            ...
    
            # Logging important change process
            'cml.views': {
                'handlers': ['console', 'log_debug', 'log_info'] if DEBUG else ['log_info'],
                'level': 'DEBUG',
                'propagate': False,
            },
            'cml.utils': {
                'handlers': ['console', 'log_debug', 'log_info'] if DEBUG else ['log_info'],
                'level': 'INFO',
                'propagate': False,
            },
        }
    }

Release notes

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-cml2-1.0.0.4.tar.gz (27.4 kB view details)

Uploaded Source

File details

Details for the file django-cml2-1.0.0.4.tar.gz.

File metadata

  • Download URL: django-cml2-1.0.0.4.tar.gz
  • Upload date:
  • Size: 27.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.12

File hashes

Hashes for django-cml2-1.0.0.4.tar.gz
Algorithm Hash digest
SHA256 205883209f42b3465bed57a5346a539513c55e2a153082ad29745f1022aa3ad7
MD5 cc58326e1db26feab275743231f3b06e
BLAKE2b-256 eb0bf2b50624ae6d3fb7ff6f3d2e6d74be262b6f5b0f54eb55fb375ab90515e1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page