Skip to content

Latest commit

 

History

History
94 lines (63 loc) · 1.6 KB

README.md

File metadata and controls

94 lines (63 loc) · 1.6 KB

django-sage-qrcode

Installation

Using pip with virtualenv

  1. Create a Virtual Environment:

    python -m venv .venv
  2. Activate the Virtual Environment:

    • On Windows:

      .venv\Scripts\activate
    • On macOS/Linux:

      source .venv/bin/activate
  3. Install django-sage-qrcode:

    pip install django-sage-qrcode

Using poetry

  1. Initialize Poetry (if not already initialized):

    poetry init
  2. Install Dependencies:

    poetry install
  3. Install django-sage-qrcode:

    poetry add django-sage-qrcode
  4. Apply Migrations:

    After installation, make sure to run the following commands to create the necessary database tables:

    poetry run python manage.py makemigrations
    poetry run python manage.py migrate

Django Settings Configuration

Installed Apps

To use django-sage-qrcode, add it to your INSTALLED_APPS in the Django settings:

INSTALLED_APPS = [
    ...
    "sage_qrcode",
    "sage_tools",
    "colorfield",
    "polymorphic",
    ...
]

Setup for Testing

Before running tests, ensure you set the DJANGO_SETTINGS_MODULE environment variable. This can be done in your terminal by running:

export DJANGO_SETTINGS_MODULE=your_project_name.settings

Alternatively, you can configure this in the tox.ini file under [testenv] like this:

[testenv]
passenv = DJANGO_SETTINGS_MODULE

This will ensure the correct settings module is used during testing.