{"id":22001465,"url":"https://github.com/islco/django-trix","last_synced_at":"2025-07-17T03:32:02.667Z","repository":{"id":57422447,"uuid":"44617706","full_name":"islco/django-trix","owner":"islco","description":"Basecamp's Trix rich text editor widget for Django","archived":false,"fork":false,"pushed_at":"2024-05-02T13:47:13.000Z","size":203,"stargazers_count":47,"open_issues_count":7,"forks_count":20,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-05-28T00:02:53.870Z","etag":null,"topics":["django","python","trix","trix-editor"],"latest_commit_sha":null,"homepage":null,"language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/islco.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-10-20T15:57:14.000Z","updated_at":"2023-05-08T00:48:46.000Z","dependencies_parsed_at":"2024-06-21T19:05:46.505Z","dependency_job_id":"d99235d8-abf0-47fd-b720-6833ab01d90f","html_url":"https://github.com/islco/django-trix","commit_stats":null,"previous_names":["istrategylabs/django-trix","apricotdotcool/django-trix"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/islco/django-trix","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/islco%2Fdjango-trix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/islco%2Fdjango-trix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/islco%2Fdjango-trix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/islco%2Fdjango-trix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/islco","download_url":"https://codeload.github.com/islco/django-trix/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/islco%2Fdjango-trix/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265563010,"owners_count":23788629,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["django","python","trix","trix-editor"],"created_at":"2024-11-29T23:13:55.657Z","updated_at":"2025-07-17T03:32:02.654Z","avatar_url":"https://github.com/islco.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"===========\ndjango-trix\n===========\n\n`Trix rich text editor \u003chttp://trix-editor.org\u003e`_ widget for Django, using Trix 0.10.1.\n\n.. image:: https://circleci.com/gh/istrategylabs/django-trix/tree/master.svg?style=shield\n    :target: https://circleci.com/gh/istrategylabs/django-trix/tree/master\n    \n\nUsing django-trix\n-----------------\n\ndjango-trix includes a form widget, a model field, and a model admin mixin that\nenables the rich text editor. You can use any of these methods, but you do not\nneed to use all.\n\nModel\n~~~~~\n\nTo enable the editor in the Django admin (or any form) via the model field, use\nthe Trix model field *TrixField* which inherits from\ndjango.db.models.TextField::\n\n    from django.db import models\n    from trix.fields import TrixField\n\n    class Post(models.Model):\n        content = TrixField('Content')\n\n\nAdmin\n~~~~~\n\nTo enable the editor in the Django admin, inherit from TrixAdmin and set\nthe *trix_fields* attribute to a list of the fields that use an editor::\n\n    from myawesomeblogapp.models import Post\n    from trix.admin import TrixAdmin\n\n    @admin.register(Post)\n    class PostAdmin(TrixAdmin, admin.ModelAdmin):\n        trix_fields = ('content',)\n\n\nForms and Templates\n~~~~~~~~~~~~~~~~~~~\n\nThe editor can be used in forms and templates by adding the *TrixEditor* widget\nto a form field::\n\n    from django import forms\n    from trix.widgets import TrixEditor\n\n    class EditorForm(forms.Form):\n        content = forms.CharField(widget=TrixEditor)\n\nIn the template, just use the form as you normally would, but be sure to\ninclude the associated media::\n\n    \u003c!doctype html\u003e\n    \u003chtml lang=\"en\"\u003e\n        \u003chead\u003e\n            \u003cmeta charset=\"utf-8\"\u003e\n            \u003ctitle\u003eTrix Editor Test\u003c/title\u003e\n            {{ form.media.css }}\n        \u003c/head\u003e\n        \u003cbody\u003e\n            \u003cform\u003e\n                {{ form }}\n            \u003c/form\u003e\n            {{ form.media.js }}\n        \u003c/body\u003e\n    \u003c/html\u003e\n\nCSS in head, JS at end of body, because you are a responsible developer.\n\n\nInstallation\n------------\n\nIt's on `PyPI \u003chttps://pypi.python.org/pypi/django-trix\u003e`_::\n\n    pip install django-trix\n\nAdd to *INSTALLED_APPS*::\n\n    INSTALLED_APPS = (\n        ...\n        'trix',\n        ...\n    )\n\nAdd route to *urls.py*::\n\n    urlpatterns = [\n        ...\n        url(r'^trixorwhateveryouwant/', include('trix.urls')),\n        ...\n    ]\n\n\nTODO\n----\n\n* A bunch of stuff!\n* Attachment uploads\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fislco%2Fdjango-trix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fislco%2Fdjango-trix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fislco%2Fdjango-trix/lists"}