npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

generator-dmndjango

v0.0.8

Published

Yeoman generator to pair front-end frameworks like Backbone and React with Django apps at The Dallas Morning News.

Downloads

27

Readme

generator-dmndjango NPM version

Built for pairing Django with client-side frameworks like Backbone and React, this Yeoman generator creates a gulp and browserify-based staticapp for transpiling, bundling, and rendering scss, js and responsive image sets into the static files directory of a Django app. It is designed to work with our django-project-template, but can be used in any standard Django app.

Installation

Requires the same dependencies used in generator-dmninteractives, namely:

$ npm install -g gulp
$ npm install -g yo
$ npm install -g generator-dmndjango

As well as ImageMagik for image processing:

# Mac
brew install imagemagick
# Ubuntu/Linux
apt-get install imagemagick

Generating the staticapp

If you're using our django-project-template, your app will contain an empty staticapp directory. If not, create one at the root of your Django app.

Move into the staticapp directory then generate the app:

$ yo dmndjango

The generator will ask for the app's name and for which module pattern you'd like to use, which will determine which subgenerator builds the app. (Currently supports CommonJS and ES6.)

CommonJS for Backbone/Marionette apps

The CommonJS subgenerator produces an app pre-architected for use with Backbone/Marionette apps.

ES6 for React/Redux apps

The ES6 subgenerator includes browserify JSX and ES6 babel transforms for use with React/Redux apps. It also includes starter files with useful boilerplate and airbnb's eslint configuration to keep your code squeaky clean.

Note: If you're using Atom's linter-eslint, you will experience errors if your editor is not opened at the staticapp root directory. Open a second project folder at the staticapp root while developing to get around the issue.

Using the staticapp

The staticapp presumes your Django app's static directory is structured like this:

your_app/
  static/
    your_app/
      js/
      css/
      img/

After the staticapp is installed, you can simply run gulp in its root directory while developing your Django project. Any changes made to javascript and scss files will be automatically rendered into your app's local static file directory. Images must be processed explicitly.

$ gulp

JS

The ES6 and CommonJS patterns bundle any javascript files prefixed with main-, allowing you to create multiple bundles for different Django views.

To uglify scripts in ES6, run:

gulp --production

SCSS

The staticapp offers support for SCSS, only.

IMG

Images must be processed explicitly by running:

$ gulp img

License

MIT © Jon McClure