Metadata-Version: 2.4
Name: csstweaks-client
Version: 0.1.0
Summary: Django debug helper for the csstweaks browser extension
Author: Vasudeva Server
License-Expression: MIT
Project-URL: Homepage, https://vasudevaserver.org
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: Django
Classifier: Framework :: Django :: 5.2
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: Django<6.0,>=5.2
Dynamic: license-file

# csstweaks-client

`csstweaks-client` is the Django companion to the csstweaks browser extension.
It shortens the feedback loop for local CSS work: the extension reads the
stylesheet currently served by Django, lets you adjust it in the browser, and
writes the result back to the source file that Django's static-file finders
resolve.

This is a development helper, not a production editing API. Every view returns
404 unless Django's `DEBUG` setting is enabled, and projects should mount its
URLs only inside the same `DEBUG` check.

## Install

```sh
pip install csstweaks-client
```

Add `csstweaks_client` to `INSTALLED_APPS`, then mount it in the project's root
URL configuration:

```python
if settings.DEBUG:
    urlpatterns += [path("__csstweaks__/", include("csstweaks_client.urls"))]
```

Start Django normally and connect the csstweaks extension to the development
site. The client works with stylesheets found in a `STATICFILES_DIRS` directory
or an installed app's `static/` directory.

## Endpoints

- `GET /__csstweaks__/ping` — the extension uses this to find the helper.
- `GET /__csstweaks__/read?path=<STATIC_URL-relative path>` — returns raw CSS.
- `POST /__csstweaks__/write` — `{"path": "...", "content": "..."}` overwrites the source file.

For development of the client itself, install this checkout in editable mode:

```sh
pip install -e .
```

[Vasudeva Server](https://vasudevaserver.org)
