This Ember addon enables the use of Django REST Framework as an API backend. The core functionality of the adapter is in toranb/ember-data-django-rest-adapter. The addon is compatible with ember-cli version 0.1.0 and higher.
- IRC: #ember-django-adapter on freenode
- Issues: ember-django-adapter/issues
From within your Ember CLI application, run the following:
npm i --save-dev ember-django-adapter
In your app settings in config/environment.js
, set the hostname for your API,
e.g.:
if (environment === 'development') {
ENV.APP.API_HOST = 'http://localhost:8000';
}
if (environment === 'production') {
ENV.APP.API_HOST = 'https://api.myproject.org';
ENV.APP.API_NAMESPACE = '';
}
- API_HOST: The server hosting your API (default: None)
- API_NAMESPACE: Your API namespace (default: 'api')
Installing the adapter and setting API_HOST
should satisfy most requirements,
but if you want to add your own customizations:
ember generate django-adapter my-custom-adapter
ember generate django-serializer my-custom-serializer
For examples extending the adapter, see the cookbook.