Wtower / django-ninecms

Nine CMS is a simple Django app to manage content. Users can create content and publish it to various paths.
BSD 3-Clause "New" or "Revised" License
42 stars 6 forks source link

Front-end package management #56

Closed Wtower closed 8 years ago

Wtower commented 8 years ago

As of v0.6.0 (f9a7f8152cab2a295a46f5a342c9fcbcbf8d33c4) the previous (totally basic) package management was removed in favour to other standard solutions. This issue deals with this and how to incorporate them with NineCMS.

Some preliminary suggestions include:

Wtower commented 8 years ago

Note: For any changes, update readme appropriately.

After several tests, some findings:

Wtower commented 8 years ago

Further findings:

Other possible features

Wtower commented 8 years ago

A note on serving minified packages vs cdn.

Regarding grunt, a separate app would be necessary:

Only the first app in INSTALLED_APPS seems to override a command. Therefore to override the runserver command it has to happen before django.contrib.staticfiles. A separate app will keep front-end JS completely off 9cms.

Features:

Wtower commented 8 years ago

Further findings:

Wtower commented 8 years ago

Updates:

Summary

Use the following stack:

Method:

Wtower commented 8 years ago

Setup gulp:

sudo apt-get install imagemagick
npm install -g gulp-cli
npm install -D gulp yargs gulp-utilbrowserify gulp-concat gulp-minify-css gulp-autoprefixer del gulp-notify gulp-if\
               watchify vinyl-source-stream vinyl-buffer gulp-uglify gulp-sass gulp-postcss gulp-sourcemaps\
               gulp-less jshint gulp-jshint jshint-stylish gulp-image-resize event-stream gulp-rename\
               concurrent-transform gulp-changed gulp-mocha gulp-google-webfonts
npm install -S jquery bootstrap lightbox2 normalize.css font-awesome puse-icons-feather

In case gulp watch not working with ENOSPC, increase the inotify watch limit:

# echo fs.inotify.max_user_watches=16384 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p  # bash
$ echo fs.inotify.max_user_watches=16384 | sudo tee -a /etc/sysctl.conf; and sudo sysctl -p  # fish
Wtower commented 8 years ago

Published gulpfile-ninecms.

Update readme.