-
Notifications
You must be signed in to change notification settings - Fork 120
/
Copy pathdescription.txt
60 lines (37 loc) · 1.09 KB
/
description.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
Build a Rest API with Django/Python
This is a basic guide on how to build a REST API with Django & Python. For much deeper depth, check out our new course on REST API: http://joincfe.com/courses/rest-api
Software
Django 1.11.8
Python 3.6.3
Django Rest Framework 3.7.3
Django Rest Framework JWT 1.11.0
Initial Setup
```
virtualenv -p python3 restapi-basics
# activate it
# mac: `source bin/activate`
# windows: `.\Scripts\activate`
pip install django==1.11.8 djangorestframework==3.7.3 djangorestframework-jwt==1.11.0
mkdir src && cd src
django-admin startproject cfehome .
django-admin startapp postings
```
Update your settings to reflect the following:
INSTALLED_APPS = [
...
'rest_framework',
'postings'
]
'''
REST_FRAMEWORK = {
'DEFAULT_PERMISSION_CLASSES': (
'rest_framework.permissions.IsAuthenticated',
),
'DEFAULT_AUTHENTICATION_CLASSES': (
'rest_framework_jwt.authentication.JSONWebTokenAuthentication',
'rest_framework.authentication.SessionAuthentication',
'rest_framework.authentication.BasicAuthentication',
),
}
'''
#