metakermit / generator-django-rest

Yeoman generator for a Django REST/GraphQL API, an optional React SPA & lots more!
MIT License
85 stars 19 forks source link
create-react-app django django-rest-framework heroku monorepo react yeoman yeoman-generator

generator-django-rest npm Build Status GitHub license Updates

A Yeoman generator for easily bootstrapping a Django REST API with some common settings and quickly deployable to Heroku/Dokku. Check out this quick screencast showing you how to deploy a full-fledged Django REST API to Heroku in 5 minutes:

asciicast

The goal is to keep you efficient and include features you need in a typical modern web app, yet keeps things simple and not too bloated. You can see an example generated Django project here. For some background on how and why the project was created, read this article.

Note: the project is still considered to be in beta until I get a chance to test it on more apps. That said, I am using it in my own projects :)

Features

Some of the cool features that come with generator-django-rest are:

See CHANGELOG.md for a full release history with all the features.

Getting Started

To begin, you need to install node.js. Once you have that, you need Yeoman pre-installed. Yeoman lives in the npm package repository. You only have to ask for him once, then he packs up and moves into your hard drive.

npm install -g yo

Then, we need the django-rest generator, i.e. plug-in. You install generator-django-rest from npm.

npm install -g generator-django-rest

Finally, for every new project you would initiate the generator in an empty folder.

mkdir myproject
cd myproject
yo django-rest

Now check the HACKING.md file in the generated code project for extra instructions (generated from this template if you're curious).

Contributing

If you have some ideas for contributions, suggestions are always welcome. Note, however, that the goal of the project is to stay minimalist, so we'll try to keep the number of dependencies small.

As a reminder to myself, I release a new version of generator-django-rest by running:

npm run release:patch # or :minor or :major
npm publish

License

MIT