-
Create a Virtual Environment:
python -m venv .venv
-
Activate the Virtual Environment:
-
On Windows:
.venv\Scripts\activate
-
On macOS/Linux:
source .venv/bin/activate
-
-
Install
django-sage-qrcode
:pip install django-sage-qrcode
-
Initialize Poetry (if not already initialized):
poetry init
-
Install Dependencies:
poetry install
-
Install
django-sage-qrcode
:poetry add django-sage-qrcode
-
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
To use django-sage-qrcode
, add it to your INSTALLED_APPS
in the Django settings:
INSTALLED_APPS = [
...
"sage_qrcode",
"sage_tools",
"colorfield",
"polymorphic",
...
]
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.