A django app to change robots.txt from the admin panel without using the database.
Project description
🤖 Django CS Robots
A simple, database-free Django app to manage your robots.txt file directly from the admin interface.
✨ Introduction
This package provides a straightforward solution for allowing site administrators to edit the robots.txt file without developer intervention. Instead of storing the content in a database model, this app reads from and writes directly to a physical file on your server. The file's path is fully configurable in your project's settings.py.
🌟 Key Features
- Edit in the Admin: ✏️ Provides a simple and intuitive form within the Django admin to modify your
robots.txtcontent. - Database-Free: 💾 Directly reads from and writes to a file on the filesystem, avoiding database overhead and migrations.
- Configurable Path: ⚙️ You can specify the exact location of your
robots.txtfile in yoursettings.pyfor full control. - Dynamic Serving: 🌐 Includes a view that serves the
robots.txtfile dynamically, ensuring that any changes made in the admin are live immediately. - Easy Integration: 🔌 Designed to be a plug-and-play addition to any Django project.
🛠️ Installation & Setup
1. Installation
Install the package from PyPI:
pip install django-cs-robots
2. settings.py Configuration
Add the app to your INSTALLED_APPS in settings.py. For the admin index page link to appear, place 'cs_robots' before 'django.contrib.admin'.
# settings.py
import os
INSTALLED_APPS = [
'cs_robots', # 👈 Place before admin
'django.contrib.admin',
# ... other apps
]
# Define the absolute path to your robots.txt file
# (e.g., inside your project's static directory)
ROBOTS_TXT_PATH = os.path.join(BASE_DIR, 'static', 'robots.txt')
3. URL Configuration
Add the cs_robots paths to your project's urls.py.
# your_project/urls.py
from django.contrib import admin
from django.urls import path, include
from cs_robots.views import serve_robots_txt # 👈 Import the serving view
urlpatterns = [
path('admin/', admin.site.urls),
# 1. Add the URL for the admin editor
path('admin/tools/', include('cs_robots.urls')),
# 2. Add the URL to serve the robots.txt file publicly
path('robots.txt', serve_robots_txt, name='robots_txt'),
# ... other project urls
]
💖 Contributions
Bug reports and feature requests are welcome!
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_cs_robots-1.0.2.tar.gz.
File metadata
- Download URL: django_cs_robots-1.0.2.tar.gz
- Upload date:
- Size: 9.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d669300142f93fdcc16496bb750daa8104499d41cea5fe0666473ea77136f8f
|
|
| MD5 |
20f0a8859bfeb2c8668b6da832f97c58
|
|
| BLAKE2b-256 |
c9ce87f366624822f73ae9518253990e0acfcaadfae5e55dd5e6cead2010315a
|
Provenance
The following attestation bundles were made for django_cs_robots-1.0.2.tar.gz:
Publisher:
python-publish.yml on codesyntax/django-cs-robots
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_cs_robots-1.0.2.tar.gz -
Subject digest:
5d669300142f93fdcc16496bb750daa8104499d41cea5fe0666473ea77136f8f - Sigstore transparency entry: 767457169
- Sigstore integration time:
-
Permalink:
codesyntax/django-cs-robots@55340a524f890fbcf1886622da980b45f0f13960 -
Branch / Tag:
refs/tags/1.0.2 - Owner: https://github.com/codesyntax
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@55340a524f890fbcf1886622da980b45f0f13960 -
Trigger Event:
release
-
Statement type:
File details
Details for the file django_cs_robots-1.0.2-py3-none-any.whl.
File metadata
- Download URL: django_cs_robots-1.0.2-py3-none-any.whl
- Upload date:
- Size: 10.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d46db9c33cc2ae5c5d8bb93b85748dc581de4a38b7102a619a099938332ac190
|
|
| MD5 |
1ae408e5f129ff11bf2ccde56e61c653
|
|
| BLAKE2b-256 |
858f1b4055c66d621af49196979f93feeb8811db5992be31ba88e9dd80e6a10c
|
Provenance
The following attestation bundles were made for django_cs_robots-1.0.2-py3-none-any.whl:
Publisher:
python-publish.yml on codesyntax/django-cs-robots
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_cs_robots-1.0.2-py3-none-any.whl -
Subject digest:
d46db9c33cc2ae5c5d8bb93b85748dc581de4a38b7102a619a099938332ac190 - Sigstore transparency entry: 767457174
- Sigstore integration time:
-
Permalink:
codesyntax/django-cs-robots@55340a524f890fbcf1886622da980b45f0f13960 -
Branch / Tag:
refs/tags/1.0.2 - Owner: https://github.com/codesyntax
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@55340a524f890fbcf1886622da980b45f0f13960 -
Trigger Event:
release
-
Statement type: