{"id":23589,"library":"django-oscar","title":"django-oscar","description":"A domain-driven e-commerce framework for Django (current version 4.1). Designed for extensible, modular e-commerce sites. Release cadence: irregular, major versions every 1-2 years.","status":"active","version":"4.1","language":"python","source_language":"en","source_url":"https://github.com/django-oscar/django-oscar","tags":["e-commerce","django","framework","domain-driven"],"install":[{"cmd":"pip install django-oscar","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Required runtime dependency","package":"django","optional":false},{"reason":"REST API extension (optional)","package":"django-oscar-api","optional":true},{"reason":"Image thumbnail support (optional but commonly used)","package":"sorl-thumbnail","optional":true}],"imports":[{"note":"","wrong":"","symbol":"OscarConfig","correct":"from oscar import OscarConfig"},{"note":"Common mistake: users import Django's version, but Oscar's version handles custom user models correctly.","wrong":"from django.contrib.auth import get_user_model","symbol":"get_user_model","correct":"from oscar.core.loading import get_user_model"},{"note":"","wrong":"","symbol":"get_class","correct":"from oscar.core.loading import get_class"}],"quickstart":{"code":"import os\nos.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myproject.settings')\nimport django\ndjango.setup()\n\nfrom oscar import OscarConfig\nOscarConfig.default_app_config = 'oscar.apps.OscarConfig'\n# For a full project, use `oscar startproject myproject`","lang":"python","description":"Initialize Oscar in a Django project (requires existing Django project with django-oscar installed). See official docs for full setup."},"warnings":[{"fix":"Upgrade Django to >=3.2 and Python >=3.8.","message":"Oscar 4.x dropped support for Django < 3.2 and Python < 3.8.","severity":"breaking","affected_versions":"<4.0"},{"fix":"Change INSTALLED_APPS from 'oscar.apps.OscarConfig' to 'oscar.OscarConfig'.","message":"Oscar 4.x removed the old 'oscar.apps.OscarConfig' direct module path; use 'oscar.OscarConfig'.","severity":"breaking","affected_versions":"<4.0"},{"fix":"Use `from oscar.core.loading import get_user_model` instead of Django's default.","message":"Oscar uses its own user model and registration. Custom user models must conform to Oscar's expectations or use the `oscar.core.loading` utilities.","severity":"gotcha","affected_versions":"all"},{"fix":"Monitor Oscar changelog and consider using external admin packages.","message":"The dashboard feature is being gradually replaced with newer admin interfaces. Some dashboard views may become deprecated in future releases.","severity":"deprecated","affected_versions":">=4.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run `pip install django-oscar` and ensure you are in the correct environment.","cause":"django-oscar is not installed or not in the same virtual environment.","error":"ModuleNotFoundError: No module named 'oscar'"},{"fix":"Ensure only one Oscar app config is listed, e.g., `'oscar.OscarConfig'`.","cause":"Multiple Oscar configs added to INSTALLED_APPS or using both old and new app config paths.","error":"django.core.exceptions.ImproperlyConfigured: Application labels aren't unique, duplicates: oscar"},{"fix":"Change the import to `from oscar import OscarConfig`.","cause":"Using an old import path that was removed in Oscar 4.x.","error":"ImportError: cannot import name 'OscarConfig' from 'oscar.apps'"},{"fix":"Move `'oscar.OscarConfig'` to the first position in INSTALLED_APPS.","cause":"Oscar must be loaded before other apps that depend on it.","error":"django.core.exceptions.ImproperlyConfigured: The Oscar app must be listed first in INSTALLED_APPS"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}