dpaste.de -> dpaste.org
Signed-off-by: Darren <git@darrennathanael.com>
This commit is contained in:
parent
48b33477b1
commit
d57ce44548
17
docs/api.md
17
docs/api.md
|
@ -11,10 +11,10 @@ Create a new Snippet on this dpaste installation. It returns the full URL that s
|
|||
**Example request:**
|
||||
|
||||
```bash
|
||||
$ curl -X POST -F "format=url" -F "content=ABC" https:/dpaste.de/api/
|
||||
$ curl -X POST -F "format=url" -F "content=ABC" https:/dpaste.org/api/
|
||||
|
||||
Host: dpaste.de
|
||||
User-Agent: curl/7.54.0
|
||||
User-Agent: curl/7.82.0
|
||||
Accept: */*
|
||||
```
|
||||
|
||||
|
@ -23,7 +23,7 @@ Accept: */*
|
|||
```bash
|
||||
{
|
||||
"lexer": "python",
|
||||
"url": "https://dpaste.de/EBKU",
|
||||
"url": "https://dpaste.org/EBKU",
|
||||
"content": "ABC"
|
||||
}
|
||||
```
|
||||
|
@ -34,12 +34,12 @@ Accept: */*
|
|||
- **lexer** – (optional) The lexer string key used for highlighting. See the `CODE_FORMATTER` property in [Settings](https://docs.dpaste.org/settings/) for a full list of choices. Default: `_code`.
|
||||
- **format** -
|
||||
(optional) The format of the API response. Choices are:
|
||||
- `default` — Returns a full qualified URL wrapped in quotes. Example: `"https://dpaste.de/xsWd"`
|
||||
- `url` — Returns the full qualified URL to the snippet, without surrounding quotes, but with a line break. Example: `https://dpaste.de/xsWd\n`
|
||||
- `default` — Returns a full qualified URL wrapped in quotes. Example: `"https://dpaste.org/xsWd"`
|
||||
- `url` — Returns the full qualified URL to the snippet, without surrounding quotes, but with a line break. Example: `https://dpaste.org/xsWd\n`
|
||||
- `json` — Returns a JSON object containing the URL, lexer and content of the the snippet. Example:
|
||||
|
||||
{
|
||||
"url": "https://dpaste.de/xsWd",
|
||||
"url": "https://dpaste.org/xsWd",
|
||||
"lexer": "python",
|
||||
"content": "The text body of the snippet."
|
||||
}
|
||||
|
@ -76,6 +76,11 @@ Accept: */*
|
|||
- [**200 OK**](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/200) – No Error.
|
||||
- [**400 Bad Request**](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400) – One of the above form options was invalid, the response will contain a meaningful error message.
|
||||
|
||||
|
||||
!!! info "Info"
|
||||
|
||||
If you have a standalone installation and your API returns `https://dpaste-base-url.example.org` as the domain, you need to adjust the setting `get_base_url` property. See Settings.
|
||||
|
||||
## Third party API integration
|
||||
**subdpaste**
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ $ pipenv run ./managepy cleanup_snippets
|
|||
A crontab line might look like:
|
||||
|
||||
```c
|
||||
1 20 * * * /srv/dpaste.de/pipenv run manage.py cleanup_snippets > /dev/null
|
||||
1 20 * * * /srv/dpaste.org/pipenv run manage.py cleanup_snippets > /dev/null
|
||||
```
|
||||
|
||||
!!! note "Note"
|
||||
|
|
|
@ -656,7 +656,7 @@ class dpasteAppConfig(AppConfig):
|
|||
String. The full qualified hostname and path to the dpaste instance.
|
||||
This is used to generate a link in the API response. If the "Sites"
|
||||
framework is installed, it uses the current Site domain. Otherwise
|
||||
it falls back to 'https://dpaste.de'
|
||||
it falls back to 'https://dpaste.org'
|
||||
"""
|
||||
if apps.is_installed("django.contrib.sites"):
|
||||
from django.contrib.sites.shortcuts import get_current_site
|
||||
|
|
Loading…
Reference in New Issue