Thank you for considering contributing! β€οΈ
Prerequisites: Python 3.12+ and Hatch
# Clone the repository
git clone https://github.com/matagus/django-generic-links.git
cd django-generic-links
# Install Hatch
pip install hatch
# Install pre-commit hooks
pip install pre-commit
pre-commit installThe example project demonstrates how to integrate django-generic-links with a music app (Artist and Album models).
# Run migrations
hatch run project:migrate
# Start the development server
hatch run project:serverVisit http://127.0.0.1:8000/admin/ to test the app with a populated admin.
hatch run project:shellThis uses django-extensions shell_plus for an enhanced interactive experience.
# All Python + Django combinations
hatch run test:test
# Specific version
hatch run test.py3.14-5.2:test
# With coverage
hatch run test:covAvailable test environments:
- Python 3.12 with Django 4.2
- Python 3.12-3.13 with Django 5.0
- Python 3.12-3.14 with Django 5.1, 5.2, 6.0
View all environments: hatch env show test
We use Ruff for linting and Black for formatting. Pre-commit hooks will automatically format your code.
Line length: 120 characters
Install pre-commit:
pip install pre-commit
# Set up git hooks
pre-commit install
# Run hooks manually on all files
pre-commit run --all-filesPre-commit checks include:
- Ruff (linting with auto-fix)
- Black (formatting)
- Standard checks (trailing whitespace, YAML validation, etc.)
- Codespell
- Pyupgrade (Python 3.12+ syntax)
- Fork and branch: Create a feature branch from
main - Write tests: Add tests for new features or bug fixes
- Update docs: Update README.md and docs/ if adding features
- Keep it focused: One feature/fix per PR
- Test thoroughly: Ensure tests pass for all Python/Django versions
- Follow code style: Pre-commit hooks will help with this
generic_links/ # Main app package
βββ models.py # GenericLink model
βββ managers.py # Custom QuerySet
βββ admin.py # Admin classes and inlines
βββ forms.py # Forms (if needed)
βββ utils.py # Helper functions
βββ templatetags/ # Template tag library
β βββ generic_links_tags.py
βββ migrations/ # Database migrations
βββ urls.py # URL patterns (if any)
tests/ # Test suite
βββ settings.py # Test settings
βββ test_models.py # Model tests
βββ test_managers.py # Manager/QuerySet tests
βββ test_forms.py # Form tests
βββ test_templatetags.py # Template tag tests
example_project/ # Working example
βββ music_app/ # Example integration (Artist/Album models)
docs/ # MkDocs documentation
βββ *.md # Documentation pages
- Repository: https://github.com/matagus/django-generic-links
- Issues: https://github.com/matagus/django-generic-links/issues
- PyPI: https://pypi.org/project/django-generic-links/
Open an issue for discussion before starting major changes. We're here to help!