<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Kerim Yıldırım</title>
    <description>The latest articles on DEV Community by Kerim Yıldırım (@kerimy).</description>
    <link>https://dev.to/kerimy</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3821121%2F6e8f3139-aa5f-4f65-99ad-c1cfbe51cd25.jpg</url>
      <title>DEV Community: Kerim Yıldırım</title>
      <link>https://dev.to/kerimy</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kerimy"/>
    <language>en</language>
    <item>
      <title>I Built a Django Package to Generate llms.txt Files Automatically</title>
      <dc:creator>Kerim Yıldırım</dc:creator>
      <pubDate>Thu, 12 Mar 2026 22:23:10 +0000</pubDate>
      <link>https://dev.to/kerimy/i-built-a-django-package-to-generate-llmstxt-files-automatically-4lbc</link>
      <guid>https://dev.to/kerimy/i-built-a-django-package-to-generate-llmstxt-files-automatically-4lbc</guid>
      <description>&lt;p&gt;If you're running a Django website, you probably want AI assistants like ChatGPT, Claude, and Perplexity to understand and reference your content accurately. That's exactly what &lt;a href="https://llmstxt.org/" rel="noopener noreferrer"&gt;https://llmstxt.org/&lt;/a&gt; does — it's an open standard that tells LLMs&lt;br&gt;
   what your site is about.&lt;/p&gt;

&lt;p&gt;I built django-llms-txt to automate this for Django projects.&lt;/p&gt;

&lt;p&gt;The Problem&lt;/p&gt;

&lt;p&gt;Manually maintaining an llms.txt file is tedious. Every time you add a blog post, a docs page, or a product page, you have to update the file. Forget once, and AI assistants miss your new content.&lt;/p&gt;

&lt;p&gt;The Solution&lt;/p&gt;

&lt;p&gt;pip install django-llms-txt&lt;/p&gt;

&lt;p&gt;Add it to your settings and define your sections — either manually or by pointing it at your Django models:&lt;/p&gt;

&lt;p&gt;# settings.py&lt;br&gt;
  INSTALLED_APPS = [&lt;br&gt;
      # ...&lt;br&gt;
      "django_llms_txt",&lt;br&gt;
  ]&lt;/p&gt;

&lt;p&gt;LLMS_TXT = {&lt;br&gt;
      "SITE_NAME": "My Django Project",&lt;br&gt;
      "SITE_URL": "&lt;a href="https://example.com" rel="noopener noreferrer"&gt;https://example.com&lt;/a&gt;",&lt;br&gt;
      "DESCRIPTION": "A brief description of your website.",&lt;br&gt;
      "SECTIONS": [&lt;br&gt;
          {&lt;br&gt;
              "title": "Documentation",&lt;br&gt;
              "links": [&lt;br&gt;
                  {&lt;br&gt;
                      "name": "Getting Started",&lt;br&gt;
                      "url": "/docs/start/",&lt;br&gt;
                      "description": "Quick start guide",&lt;br&gt;
                  },&lt;br&gt;
              ],&lt;br&gt;
          },&lt;br&gt;
      ],&lt;br&gt;
  }&lt;/p&gt;

&lt;p&gt;Then include the URL patterns:&lt;/p&gt;

&lt;p&gt;# urls.py&lt;br&gt;
  from django_llms_txt.urls import urlpatterns as llms_patterns&lt;/p&gt;

&lt;p&gt;urlpatterns = [&lt;br&gt;
      # ...&lt;br&gt;
  ] + llms_patterns&lt;/p&gt;

&lt;p&gt;That's it. Your site now serves /llms.txt dynamically.&lt;/p&gt;

&lt;p&gt;Auto-Generate from Models&lt;/p&gt;

&lt;p&gt;The real power is auto-generating sections from your Django models. Have a blog? A product catalog? Documentation pages? Point the package at your models and it builds the llms.txt automatically:&lt;/p&gt;

&lt;p&gt;LLMS_TXT = {&lt;br&gt;
      "SITE_NAME": "My Blog",&lt;br&gt;
      "SITE_URL": "&lt;a href="https://example.com" rel="noopener noreferrer"&gt;https://example.com&lt;/a&gt;",&lt;br&gt;
      "DESCRIPTION": "A blog about Django.",&lt;br&gt;
      "AUTO_SECTIONS": [&lt;br&gt;
          {&lt;br&gt;
              "title": "Blog Posts",&lt;br&gt;
              "model": "blog.Post",&lt;br&gt;
              "filter": {"status": "published"},&lt;br&gt;
              "ordering": ["-published_date"],&lt;br&gt;
              "name_field": "title",&lt;br&gt;
              "url_method": "get_absolute_url",&lt;br&gt;
              "description_field": "excerpt",&lt;br&gt;
              "limit": 50,&lt;br&gt;
          },&lt;br&gt;
      ],&lt;br&gt;
  }&lt;/p&gt;

&lt;p&gt;Every time a new post is published, it shows up in your llms.txt — no manual updates needed.&lt;/p&gt;

&lt;p&gt;Static File Generation&lt;/p&gt;

&lt;p&gt;Prefer serving a static file instead of a dynamic view? Use the management command:&lt;/p&gt;

&lt;p&gt;python manage.py generate_llms_txt --output static/&lt;/p&gt;

&lt;p&gt;Output Format&lt;/p&gt;

&lt;p&gt;The generated file follows the &lt;a href="https://llmstxt.org/:" rel="noopener noreferrer"&gt;https://llmstxt.org/:&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;# My Django Project&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A brief description of your website.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;## Documentation&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://example.com/docs/start/" rel="noopener noreferrer"&gt;Getting Started&lt;/a&gt;: Quick start guide&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;## Blog Posts&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://example.com/blog/django-tips/" rel="noopener noreferrer"&gt;Django Tips for 2026&lt;/a&gt;: Practical tips for Django developers&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://example.com/blog/querysets/" rel="noopener noreferrer"&gt;Understanding Querysets&lt;/a&gt;: Deep dive into Django querysets&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Links&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/rapitek/django-llms-txt" rel="noopener noreferrer"&gt;https://github.com/rapitek/django-llms-txt&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;PyPI: &lt;a href="https://pypi.org/project/django-llms-txt/" rel="noopener noreferrer"&gt;https://pypi.org/project/django-llms-txt/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Live example: &lt;a href="https://rapitek.com/llms.txt" rel="noopener noreferrer"&gt;https://rapitek.com/llms.txt&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Built by &lt;a href="https://rapitek.com" rel="noopener noreferrer"&gt;https://rapitek.com&lt;/a&gt; — we use this in production on our own site. Contributions and feedback welcome.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>django</category>
      <category>python</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
