You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+73-31Lines changed: 73 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,16 +3,21 @@
3
3
4
4
## Requirements
5
5
- Python 3.6
6
-
- Django (2.1)
6
+
- Django 3.1
7
7
- Django REST Framework
8
-
- Django Rest Auth
9
8
10
9
## Installation
10
+
After you cloned the repository, you want to create a virtual environment, so you have a clean python installation.
11
+
You can do this by running the command
11
12
```
12
-
pip install django
13
-
pip install djangorestframework
14
-
pip install django-rest-auth
15
-
pip install django-allauth
13
+
python -m venv env
14
+
```
15
+
16
+
After this, it is necessary to activate the virtual environment, you can get more information about this [here](https://docs.python.org/3/tutorial/venv.html)
17
+
18
+
You can install all the required dependencies by running
We can test the API using [curl](https://curl.haxx.se/) or [httpie](https://github.com/jakubroztocil/httpie#installation). Httpie is a user friendly http client that's written in Python. Let's install that.
37
+
We can test the API using [curl](https://curl.haxx.se/) or [httpie](https://github.com/jakubroztocil/httpie#installation), or we can use [Postman](https://www.postman.com/)
38
+
39
+
Httpie is a user-friendly http client that's written in Python. Let's try and install that.
33
40
34
41
You can install httpie using pip:
35
42
```
@@ -38,70 +45,105 @@ pip install httpie
38
45
39
46
First, we have to start up Django's development server.
40
47
```
41
-
python manage.py runserver
48
+
python manage.py runserver
42
49
```
43
50
Only authenticated users can use the API services, for that reason if we try this:
44
51
```
45
-
http http://127.0.0.1:8000/api/v1/movies/3
52
+
http http://127.0.0.1:8000/api/v1/movies/
46
53
```
47
54
we get:
48
55
```
49
-
{ "detail": "You must be authenticated" }
56
+
{
57
+
"detail": "Authentication credentials were not provided."
The API supports pagination, by default responses have a page_size=10 but if you want change that you can pass through params page=size=X
127
+
The API supports pagination, by default responses have a page_size=10 but if you want change that you can pass through params page_size={your_page_size_number}
0 commit comments