|
1 | 1 | # django_rest_framework_tutorial
|
2 | 2 |
|
3 |
| -My practices about [Django 1.9 Project tutorial](https://docs.djangoproject.com/en/1.9/intro/) and [Django Rest Framework 3.6.4 tutorial Quickstart](http://www.django-rest-framework.org/tutorial/quickstart/). |
| 3 | +My practices about the following tutorials: |
| 4 | + |
| 5 | +- [Django 1.9 Project tutorial](https://docs.djangoproject.com/en/1.9/intro/). |
| 6 | +- [Django Rest Framework 3.6.4 tutorial Quickstart](http://www.django-rest-framework.org/tutorial/quickstart/). |
| 7 | +- [Desarrollo de un API REST con Django REST framework, tutorial 1: Serialización](http://jonathanpumares.com/desarrollo-de-un-api-rest-con-django-rest-framework-tutorial-1-serializacion/). |
4 | 8 |
|
5 | 9 | ## Installation
|
6 | 10 |
|
@@ -43,6 +47,14 @@ $ python manage.py runserver
|
43 | 47 |
|
44 | 48 | **Tip:** PLEASE add two **groups**, two **users** and later add a user into a group.
|
45 | 49 |
|
| 50 | +### Quickstart App |
| 51 | + |
| 52 | +For add data for *Quickstart* App, please access to the following URL: [http://localhost:8000/admin/quickstart/](http://localhost:8000/admin/quickstart/) |
| 53 | + |
| 54 | +### Snippets App |
| 55 | + |
| 56 | +For add data for *Snippets* App, please access to the following URL: [http://localhost:8000/admin/snippets/](http://localhost:8000/admin/snippets/) |
| 57 | + |
46 | 58 | ### Testing the API
|
47 | 59 |
|
48 | 60 | You have many APIs Rest for testing, now access to the APIs, both from the command-line, using tools like **curl**, please execute the following command:
|
@@ -168,6 +180,24 @@ $ curl -H 'Accept: application/json; indent=4' -u admin:password123 http://127.0
|
168 | 180 | ]
|
169 | 181 | ```
|
170 | 182 |
|
| 183 | +#### Snippets list endpoint |
| 184 | + |
| 185 | +For testing the **snippets list** API Rest, please execute the following command: |
| 186 | + |
| 187 | +```bash |
| 188 | +$ curl -H 'Accept: application/json; indent=4' -u admin:password123 http://localhost:8000/snippets/list/ |
| 189 | +[{"id":1,"title":"","code":"foo = \"bar\"\n","linenos":false,"language":"python","style":"friendly"},{"id":2,"title":"","code":"print \"hello, world\"\n","linenos":false,"language":"python","style":"friendly"},{"id":3,"title":"","code":"print \"hello, world\"","linenos":false,"language":"python","style":"friendly"}] |
| 190 | +``` |
| 191 | + |
| 192 | +#### Snippets detail endpoint |
| 193 | + |
| 194 | +For testing the **snippets detail** API Rest, please execute the following command: |
| 195 | + |
| 196 | +```bash |
| 197 | +$ curl -H 'Accept: application/json; indent=4' -u admin:password123 http://localhost:8000/snippets/detail/1/ |
| 198 | +{"id":1,"title":"","code":"foo = \"bar\"\n","linenos":false,"language":"python","style":"friendly"} |
| 199 | +``` |
| 200 | + |
171 | 201 | ## Django Interactive Console
|
172 | 202 | For make some practices the Django ORM, please execute the following command:
|
173 | 203 |
|
@@ -317,3 +347,4 @@ ValidationError: {'email': [u'Enter a valid email address.'], 'created': [u'This
|
317 | 347 |
|
318 | 348 | - [Django 1.9 Project tutorial](https://docs.djangoproject.com/en/1.9/intro/).
|
319 | 349 | - [Django Rest Framework 3.6.4 tutorial Quickstart](http://www.django-rest-framework.org/tutorial/quickstart/).
|
| 350 | +- [Desarrollo de un API REST con Django REST framework, tutorial 1: Serialización](http://jonathanpumares.com/desarrollo-de-un-api-rest-con-django-rest-framework-tutorial-1-serializacion/). |
0 commit comments