BaseURI:<URl>/api/
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'X-CSRFToken': Cookies.get('csrftoken')
},
body: {
username: <username>,
password: <password>
}
- Ensure csrf
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'X-CSRFToken': Cookies.get('csrftoken')
},
body: {
'withCredentials': true
}
- Ensure csrf
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'X-CSRFToken': Cookies.get('csrftoken')
},
body: {
username: <username>,
password: <password>
}
- Ensure csrf
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'X-CSRFToken': Cookies.get('csrftoken')
},
body: {
'withCredentials': true
}
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
List all archives, but only properties: slug, title, date_created, date_modified, date_published, published.
- Ensure csrf
[
{
"slug": "testslug3",
"title": "testTitle3",
"date_created": "2022-01-02T10:00:00Z",
"date_modified": "2022-09-14T06:43:32.221152Z",
"date_published": "2022-09-14T06:43:32.218690Z",
"published": false
},
{
"slug": "testslug2",
"title": "testTitle2",
"date_created": "2007-01-02T10:00:00Z",
"date_modified": "2022-09-13T06:43:32.221152Z",
"date_published": "2022-09-13T06:43:32.218690Z",
"published": true
},
{
"slug": "testslug1",
"title": "testTitle1",
"date_created": "2007-01-01T10:00:00Z",
"date_modified": "2022-09-12T18:23:10.903240Z",
"date_published": "2022-09-12T18:23:10.900625Z",
"published": true
}
]
List all published archives, but only properties: slug, title, date_created, date_modified, date_published, published.
[
{
"slug": "testslug2",
"title": "testTitle2",
"date_created": "2022-01-02T10:00:00Z",
"date_modified": "2022-09-13T06:43:32.221152Z",
"date_published": "2022-09-13T06:43:32.218690Z",
"published": true
},
{
"slug": "testslug1",
"title": "testTitle1",
"date_created": "2022-01-01T10:00:00Z",
"date_modified": "2022-09-12T18:23:10.903240Z",
"date_published": "2022-09-12T18:23:10.900625Z",
"published": true
}
]
Show the archive with specified slug, with all properties: slug, title, body, date_created, date_modified, date_published, published.
- If archive not published then ensure csrf
{
"slug": "testslug2",
"title": "testTitle2",
"body": "Test",
"date_created": "2007-01-02T10:00:00Z",
"date_modified": "2022-09-13T06:43:32.221152Z",
"date_published": "2022-09-13T06:43:32.218690Z",
"published": true
},
data includes properties: slug, title, published.
- Ensure csrf
data includes properties: slug, title, published.
- Ensure csrf
- Ensure csrf
- Ensure csrf
- Ensure csrf
- Ensure csrf
- Default host on
http://127.0.0.1:8000/$ python manage.py runserver
- modify
<app-name>/models.py -
python manage.py makemigrations -
python manage.py migrate
- clear migrations table
./manage.py migrate --fake <app-name> zero - Remove
<app-name>/migrations/folder or contents. - Make the migrations:
./manage.py makemigrations <app-name> - Tidy up your migrations without making other database changes:
./manage.py migrate --fake <app-name>