Integrating Ember with Pyramid

I need help integrating emberjs with pyramid. I’ve just finished the basic tutorial and would like to try it out further with doing a single page application with pyramid + pgsql (CRUD) and with pyramid just returning json results.

Some questions that I have are:

  1. Where do I put the emberjs in my Pyramid project folder.

  2. For retrieving and sending json data, would this link be the appropriate api to follow ( JSONAPIAdapter - 4.4 - Ember API Documentation ), as I saw many conflicting discussions about ember-data that basically paints ember-data in a negative way.

  3. What is the difference between RESTAdapter - 4.6 - Ember API Documentation and JSONAPIAdapter - 4.4 - Ember API Documentation?

PS: I have no experience with js mvc except js tool-kits like jQuery and react-native.

Thanks for taking the time to answer simple questions like these.

Just a few hints - without any knowledge about Pyramid:

During development use ember-cli’s proxy-parameter to redirect api-requests to your Pyramid-Backend.
See The Ember CLI - Introduction - Ember CLI Guides
and Startup — The Pyramid Web Framework v2.0

Terminal 1 (cd to your pyramid-app directory):
$ pserve development.ini
(or however it is started, notice the port it is being served)

Terminal 2 (cd to your ember-app directory):
$ ember server --proxy http://localhost:6543
(6543 is an example, use the port of your currently running pyramid-app)

Then open http://localhost:4200 to see your ember-app. All non-static-content (e.g. calls to api) will be redirected to your running pyramid-server.

If you want to go live, create a build of your Ember-App (again, see The Ember CLI - Introduction - Ember CLI Guides) and put it to the static-assets-location that you configured in your pyramid-app.

=> Static Assets with Pyramid:
Static Assets — The Pyramid Web Framework v2.0

=> JSON with Pyramid:
Renderers — The Pyramid Web Framework v2.0


Regarding adapters: Each adapter supports a different JSON-format.
The RESTAdapter is a very basic adapter and brings its own conventions regarding the json-format (see the docs).
The JSONAPIAdapter is build around the JSON-API standard, see http://jsonapi.org for docs and examples. This is what most people want.


Hope this helps!
1 Like

Thanks! That really helps massively