@danielcb29
MVT
Model
MVT
Model
Model Definition
=>
MVT
Model
Fields
=>
MVT
Model
Methods
=>
Model
View
MVT
=>
Model
View
MVT
=>
Model
View
Template
=>
=>
MVT
forms.py
form.html
cars/urls.py
Apps https://docs.djangoproject.com/en/2.1/ref/applications/
Admin https://docs.djangoproject.com/en/2.1/ref/contrib/admin/
Tests https://docs.djangoproject.com/en/2.1/topics/testing/
Context Processors https://docs.djangoproject.com/en/2.1/ref/templates/api/
Migrations https://docs.djangoproject.com/en/2.1/topics/migrations/
Please provide a service to get the car list on my React Native App
What happens with URLs or out app routing?
What happens with the CBV that already have some logic abstractions?
Even Worse: What happens with the Authentication?, CORS?
...etc
REST
Client
Server
HTTP Request
}
Method: GET, POST, PUT, DELETE
Header: Metadata
Endpoint: URL to the source
Payload (optional): Information that client sends to server
REST
Client
Server
HTTP Response
{
Status Code: 20*, 30*, 40*, 50*
Response Data (optional): Commonly JSON
Response Header: Metadata
Python (2.7, 3.4, 3.5, 3.6, 3.7)
Django (1.11, 2.0, 2.1)
REST framework requires the following:
pip install djangorestframework
pip install markdown
pip install django-filter
In our Python environment we start running the following commands:
1
INSTALLED_APPS = (
...
'rest_framework',
)
Then importing the app in our INSTALLED_APPS:
2
urlpatterns = [
...
url(r'^<url>/',
include('rest_framework.urls'))
]
In case we want to use rest framework Browsable API
3
4
Serializer
Serializer
=>
View
Serializer
=>
View
=>
Endpoint
Your client is happy now!
@danielcb29