Coder Social home page Coder Social logo

steinrobert / generator-django-webapp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rockallite/generator-django-webapp

0.0 1.0 0.0 968 KB

Yeoman generator that scaffolds out a Django web app with front-end support.

JavaScript 69.78% HTML 23.50% CSS 6.72%

generator-django-webapp's Introduction

Django web app generator Build Status Built with Grunt

Yeoman generator that scaffolds out a Django web app with front-end support. Derived from generator-webapp.

Features

  • CSS Autoprefixing (new)
  • Built-in preview server with LiveReload
  • Automagically compile CoffeeScript & Compass
  • Automagically lint your scripts
  • Automagically wire up your Bower components with bower-install.
  • Awesome Image Optimization (via OptiPNG, pngquant, jpegtran and gifsicle)
  • Mocha Unit Testing with PhantomJS
  • Optional - Bootstrap for Sass
  • Optional - Leaner Modernizr builds (new)
  • Auto-generated config paths of all RequireJS modules (new)
  • Automagically handle {{ STATIC_URL }} and {% static %} template tags (new)
  • Optimze HTML files and Django templates, including inline Javascript and CSS (using grunt-htmlcompressor) (new)

generator-django-webapp depends on a heavily-patched version of grunt-usemin. For more information on what generator-django-webapp can do for you, take a look at the Grunt tasks.

Getting Started

  • Install: npm install -g generator-django-webapp
  • Start a Django project: django-admin.py startproject your_project_name
  • Set working directory to project base: cd your_project_name
  • Run: yo django-webapp
  • Set working directory for Grunt task: cd etc
  • Run grunt for building static assets
  • If everything is OK, the built assets are in etc/dist directory

Third-Party Dependencies

(HTML/CSS/JS/Images/etc)

Third-party dependencies are managed with bower-install. Add new dependencies using Bower and then run the Grunt task to load them:

  bower install --save jquery
  grunt bowerInstall

This works if the package author has followed the Bower spec. If the files are not automatically added to your index.html, check with the package's repo for support and/or file an issue with them to have it updated.

To manually add dependencies, bower install depName --save to get the files, then add a script or style tag to your index.html or an other appropriate place.

The components are installed in the root of the project at /bower_components. To reference them from the grunt serve web app index.html file, use src="bower_components" or src="/bower_components". Treat the references as if they were a sibling to index.html.

Testing Note: a project checked into source control and later checked out, needs to have bower install run from the test folder as well as from project root.

Grunt Serve Note

Note: grunt server was previously used for previewing in earlier versions of the project and is being deprecated in favor of grunt serve.

Options

  • --skip-install

    Skips the automatic execution of bower and npm after scaffolding has finished.

  • --test-framework=<framework>

    Defaults to mocha. Can be switched for another supported testing framework like jasmine.

  • --coffee

    Add support for CoffeeScript.

Contribute

Main development happens in Yeoman's generator-webapp. See the contributing docs

generator-django-webapp is fork-friendly (and is also a fork of generator-webapp) and you can always maintain a custom version which you npm install && npm link to continue using via yo django-webapp or a name of your choosing.

License

BSD license

generator-django-webapp's People

Contributors

addyosmani avatar alefteris avatar alrra avatar asuh avatar callumlocke avatar eddiemonge avatar fluke avatar handtrix avatar hashchange avatar kevva avatar matheusazzi avatar mklabs avatar oaleynik avatar oxnard805 avatar passy avatar peol avatar radnor avatar raphaelvalerio avatar robwalch avatar rockallite avatar rzschoch avatar sebdeckers avatar sebv avatar sheenobu avatar silvenon avatar sindresorhus avatar sleeper avatar sylvaindesve avatar tschaub avatar zhuangya avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.