Skip to content

Goldcap/django-operis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django Operis

Autogeneration of Ember Models from Django Models

Ember Install

So just a brief rundown of how to get started with ember-cli. A lot of it will involve installing Ember CLI on your local machine.

Here's the basic ember setup, taken from Ember CLI

npm install -g ember-cli
npm install -g bower
npm install -g phantomjs

Following that, let's install the Node Modules and Bower Components. Remember, bower won't let you run as root, but NPM requires it.

npm install

su someuser
bower install
exit

Django Install

This has yet to be added to PIP, so to install, clone from the git repository, if you haven't already. Make sure the "ember" directory has been copied into your templates directory.

You'll need to add a few things to your Django Settings:

ENVIRONMENT = "development"
EMBER_MODELS = ["some-app.models","some-other-app.models","some-module.models",]
EMBER_APP_NAME = "some-ember-app"
EMBER_ENV = '{"environment":"development","baseURL":"/","locationType":"auto","EmberENV":{"FEATURES":{}},"APP":{"LOG_ACTIVE_GENERATION":true,"LOG_VIEW_LOOKUPS":true}}'

Generating Models

Once this is done, you should be able to generate the Ember models from Django models. You should likewise make sure you've collected the static components from Operis.

python manage.py collect-static-ember
python manage.py generate-ember

You can now see ember running on static "html" using ember-cli.

cd some-ember-app
ember server

Locally we'll proxy everything via nginx, you'll see a custom config in the "doc" directory. Then you can view the homepage here:

http://localhost

Or directly via Ember Server

http://localhost:4200

Feel free to reach out to me with any questions or issues you might have, as the instructions above may or may not cover everything. Most of all, have fun!

About

Autogeneration of Ember Models from Django Models

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published