{"id":23654,"library":"edx-milestones","title":"edx-milestones","description":"Provides models and utilities for tracking significant events (milestones) in Open edX courses, such as completion or certification eligibility. Current version 2.0.0, maintained under the Open edX organization. Release cadence is sporadic, with major version bumps tied to Python/Django support drops.","status":"active","version":"2.0.0","language":"python","source_language":"en","source_url":"https://github.com/openedx/edx-milestones","tags":["open-edx","milestones","django","education"],"install":[{"cmd":"pip install edx-milestones","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Core dependency for model definitions and migrations.","package":"django","optional":false},{"reason":"Used for caching and request utilities in milestone queries.","package":"edx-django-utils","optional":false}],"imports":[{"note":"Direct model import after app setup.","symbol":"Milestone","correct":"from milestones.models import Milestone"},{"note":"Used to link milestones to courses or users.","symbol":"MilestoneRelationship","correct":"from milestones.models import MilestoneRelationship"},{"note":"API functions live in milestones.api, not top-level.","wrong":"from milestones import get_milestones_with_names","symbol":"get_milestones_with_names","correct":"from milestones.api import get_milestones_with_names"}],"quickstart":{"code":"import django\nfrom django.conf import settings\nsettings.configure(\n    DATABASES={'default': {'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:'}},\n    INSTALLED_APPS=['milestones'],\n    USE_TZ=True,\n)\ndjango.setup()\n\nfrom milestones.models import Milestone\nm = Milestone.objects.create(\n    namespace='test',\n    name='middle_section',\n    display_name='Middle Section',\n    description='Complete the middle section of the course'\n)\nprint(f'Created milestone: {m.id}')","lang":"python","description":"Minimal Django setup to create a milestone record."},"warnings":[{"fix":"Pin edx-milestones==1.1.0 in your requirements, or upgrade Python to 3.12+.","message":"Dropped Python 3.11 support in v2.0.0. If your environment uses Python 3.11, do not upgrade beyond v1.1.0.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Use Milestone.objects.filter(active=True) instead of .filter(active=1) or .filter(active__exact=True).","message":"The milestone 'active' field is deprecated in favor of using queries based on literal values (True/False) instead of boolean field lookups to avoid table scans on Django 3.2+.","severity":"deprecated","affected_versions":">=0.3.3"},{"fix":"Use Milestone.objects.get(namespace='my_ns', name='milestone_name') instead of just name.","message":"Milestone names are not unique by namespace: you can have multiple milestones with the same name in different namespaces. Always filter by both namespace and name to avoid unexpected duplicates.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'python manage.py migrate milestones' or include 'milestones' in INSTALLED_APPS and run 'python manage.py migrate'.","cause":"Missing migration. The milestones app must be included in INSTALLED_APPS and migrations must be run before using models.","error":"django.db.utils.OperationalError: no such table: milestones_milestone"},{"fix":"Use correct import: from milestones.api import get_milestones_with_names","cause":"Common mistake: importing api functions from the top-level package instead of milestones.api.","error":"AttributeError: module 'milestones' has no attribute 'api'"},{"fix":"Install with 'pip install edx-milestones' and ensure it's added to INSTALLED_APPS as 'milestones'.","cause":"The package is not installed or not in the Python path. Also, the Django app label is 'milestones' (plural), not 'milestone'.","error":"ModuleNotFoundError: No module named 'milestones'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}