django-gulp


Namedjango-gulp JSON
Version 4.1.0 PyPI version JSON
download
home_pagehttps://github.com/beaugunderson/django-gulp
SummaryRun your gulp tasks with runserver and collectstatic
upload_time2018-06-27 18:20:53
maintainer
docs_urlNone
authorBeau Gunderson
requires_python
licenseMIT
keywords django
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            django-gulp
-----------

``django-gulp`` overrides ``./manage.py runserver`` and
``./manage.py collectstatic`` so that they also run your gulp tasks.

I’ve used this in conjunction with watchify and livereload in gulp, so
that my simple unadorned runserver automatically watches and compiles
new JavaScript files with browserify and live reloads new CSS that’s
been automatically compiled from SASS.

Installation
~~~~~~~~~~~~

Add ``"django_gulp"`` to your ``INSTALLED_APPS`` setting like this,
making sure that it comes before ``django.contrib.staticfiles`` (or
other apps that override ``runserver`` or ``collectstatic`` in the list
if they’re listed):

::

   INSTALLED_APPS = (
       'django_gulp',
       ...
   )

Now when you run ``./manage.py runserver`` or
``./manage.py collectstatic`` your ``gulp`` tasks will run as well!

Settings
~~~~~~~~

``GULP_CWD`` defaults to the current working directory. Override it if
your ``gulpfile.js`` does not reside within the Django project’s
toplevel directory.

``GULP_PRODUCTION_COMMAND`` defaults to ``gulp build --production``.
``GULP_DEVELOP_COMMAND`` defaults to ``gulp``. Note that when specifying
this setting manually, ``GULP_CWD`` is ignored.

Heroku
~~~~~~

``django-gulp`` works on Heroku! You’ll just need to use buildpack-multi
and make sure your ``.buildpacks`` file looks like this:

::

   https://github.com/heroku/heroku-buildpack-nodejs.git
   https://github.com/heroku/heroku-buildpack-python.git

To use buildback-multi set your configuration like so:

::

   $ heroku config:set BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-multi.git

Example output
~~~~~~~~~~~~~~

.. code:: sh

   $ ./manage.py runserver
   >>> Starting gulp
   >>> gulp process on pid 47863
   Performing system checks...

   System check identified no issues.
   May 04, 2015 - 18:27:52
   Django version 1.8.1, using settings 'example.settings'
   Starting development server at http://127.0.0.1:8000/
   Quit the server with CONTROL-C.
   [18:27:53] Using gulpfile ~/p/example/gulpfile.js
   [18:27:53] Starting 'bower-install'...
   [18:27:54] Using cwd:  /Users/beau/p/example
   [18:27:54] Using bower dir:  static/vendor
   [18:27:54] Starting 'sass'...
   [18:27:54] Starting 'watch'...
   [18:27:54] Finished 'watch' after 19 ms
   [18:27:54] Starting 'watchify'...
   [18:28:08] Watching files required by bundle-about.js
   [18:28:08] Bundling bundle-about.js...
   [18:28:08] Watching files required by bundle-accounts-login.js
   [18:28:08] Bundling bundle-accounts-login.js...
   [18:28:08] Watching files required by bundle-accounts-signup.js
   [18:28:08] Bundling bundle-accounts-signup.js...
   [18:28:08] Watching files required by bundle-activities.js
   [18:28:08] Bundling bundle-activities.js...
   [18:28:08] Finished 'watchify' after 14 s
   [18:28:09] Finished 'sass' after 15 s
   ^C>>> Closing gulp process

.. code:: sh

   $ ./manage.py collectstatic
   [18:32:54] Using gulpfile ~/p/example/gulpfile.js
   [18:32:54] Starting 'bower-install'...
   [18:32:55] Using cwd:  /Users/beau/p/example
   [18:32:55] Using bower dir:  static/vendor
   [18:32:55] Starting 'sass'...
   [18:32:56] Starting 'browserify'...
   [18:33:05] Bundling bundle-about.js...
   [18:33:05] Bundling bundle-accounts-login.js...
   [18:33:05] Bundling bundle-accounts-signup.js...
   [18:33:05] Bundling bundle-activities.js...
   [18:33:05] Finished 'browserify' after 9.39 s
   [18:33:08] Finished 'sass' after 13 s
   [18:33:14] Finished 'bower-install' after 19 s
   [18:33:14] Starting 'bower-main-files'...
   [18:33:14] Starting 'bower-detritus'...
   [18:33:14] Finished 'bower-main-files' after 104 ms
   [18:33:14] Finished 'bower-detritus' after 507 ms
   [18:33:14] Starting 'bower'...
   [18:33:14] Finished 'bower' after 18 μs
   [18:33:14] Starting 'build'...
   [18:33:14] Finished 'build' after 5 μs

   You have requested to collect static files at the destination
   location as specified in your settings:

       /Users/beau/p/example/static-files

   This will overwrite existing files!
   Are you sure you want to do this?

   Type 'yes' to continue, or 'no' to cancel: yes
   Copying '/Users/beau/p/example/build/js/bundle-about.js'
   Copying '/Users/beau/p/example/build/js/bundle-about.map.json'
   Copying '/Users/beau/p/example/build/js/bundle-accounts-login.js'
   Copying '/Users/beau/p/example/build/js/bundle-accounts-login.map.json'
   Copying '/Users/beau/p/example/build/js/bundle-accounts-signup.js'
   Copying '/Users/beau/p/example/build/js/bundle-accounts-signup.map.json'
   Copying '/Users/beau/p/example/build/js/bundle-activities.js'
   Copying '/Users/beau/p/example/build/js/bundle-activities.map.json'

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/beaugunderson/django-gulp",
    "name": "django-gulp",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "django",
    "author": "Beau Gunderson",
    "author_email": "beau@beaugunderson.com",
    "download_url": "https://files.pythonhosted.org/packages/5f/1a/d796f16711fdf28b0b2b31f15c77f8c98547e91422be73273cb4776ead26/django-gulp-4.1.0.tar.gz",
    "platform": "",
    "description": "django-gulp\n-----------\n\n``django-gulp`` overrides ``./manage.py runserver`` and\n``./manage.py collectstatic`` so that they also run your gulp tasks.\n\nI\u2019ve used this in conjunction with watchify and livereload in gulp, so\nthat my simple unadorned runserver automatically watches and compiles\nnew JavaScript files with browserify and live reloads new CSS that\u2019s\nbeen automatically compiled from SASS.\n\nInstallation\n~~~~~~~~~~~~\n\nAdd ``\"django_gulp\"`` to your ``INSTALLED_APPS`` setting like this,\nmaking sure that it comes before ``django.contrib.staticfiles`` (or\nother apps that override ``runserver`` or ``collectstatic`` in the list\nif they\u2019re listed):\n\n::\n\n   INSTALLED_APPS = (\n       'django_gulp',\n       ...\n   )\n\nNow when you run ``./manage.py runserver`` or\n``./manage.py collectstatic`` your ``gulp`` tasks will run as well!\n\nSettings\n~~~~~~~~\n\n``GULP_CWD`` defaults to the current working directory. Override it if\nyour ``gulpfile.js`` does not reside within the Django project\u2019s\ntoplevel directory.\n\n``GULP_PRODUCTION_COMMAND`` defaults to ``gulp build --production``.\n``GULP_DEVELOP_COMMAND`` defaults to ``gulp``. Note that when specifying\nthis setting manually, ``GULP_CWD`` is ignored.\n\nHeroku\n~~~~~~\n\n``django-gulp`` works on Heroku! You\u2019ll just need to use buildpack-multi\nand make sure your ``.buildpacks`` file looks like this:\n\n::\n\n   https://github.com/heroku/heroku-buildpack-nodejs.git\n   https://github.com/heroku/heroku-buildpack-python.git\n\nTo use buildback-multi set your configuration like so:\n\n::\n\n   $ heroku config:set BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-multi.git\n\nExample output\n~~~~~~~~~~~~~~\n\n.. code:: sh\n\n   $ ./manage.py runserver\n   >>> Starting gulp\n   >>> gulp process on pid 47863\n   Performing system checks...\n\n   System check identified no issues.\n   May 04, 2015 - 18:27:52\n   Django version 1.8.1, using settings 'example.settings'\n   Starting development server at http://127.0.0.1:8000/\n   Quit the server with CONTROL-C.\n   [18:27:53] Using gulpfile ~/p/example/gulpfile.js\n   [18:27:53] Starting 'bower-install'...\n   [18:27:54] Using cwd:  /Users/beau/p/example\n   [18:27:54] Using bower dir:  static/vendor\n   [18:27:54] Starting 'sass'...\n   [18:27:54] Starting 'watch'...\n   [18:27:54] Finished 'watch' after 19 ms\n   [18:27:54] Starting 'watchify'...\n   [18:28:08] Watching files required by bundle-about.js\n   [18:28:08] Bundling bundle-about.js...\n   [18:28:08] Watching files required by bundle-accounts-login.js\n   [18:28:08] Bundling bundle-accounts-login.js...\n   [18:28:08] Watching files required by bundle-accounts-signup.js\n   [18:28:08] Bundling bundle-accounts-signup.js...\n   [18:28:08] Watching files required by bundle-activities.js\n   [18:28:08] Bundling bundle-activities.js...\n   [18:28:08] Finished 'watchify' after 14 s\n   [18:28:09] Finished 'sass' after 15 s\n   ^C>>> Closing gulp process\n\n.. code:: sh\n\n   $ ./manage.py collectstatic\n   [18:32:54] Using gulpfile ~/p/example/gulpfile.js\n   [18:32:54] Starting 'bower-install'...\n   [18:32:55] Using cwd:  /Users/beau/p/example\n   [18:32:55] Using bower dir:  static/vendor\n   [18:32:55] Starting 'sass'...\n   [18:32:56] Starting 'browserify'...\n   [18:33:05] Bundling bundle-about.js...\n   [18:33:05] Bundling bundle-accounts-login.js...\n   [18:33:05] Bundling bundle-accounts-signup.js...\n   [18:33:05] Bundling bundle-activities.js...\n   [18:33:05] Finished 'browserify' after 9.39 s\n   [18:33:08] Finished 'sass' after 13 s\n   [18:33:14] Finished 'bower-install' after 19 s\n   [18:33:14] Starting 'bower-main-files'...\n   [18:33:14] Starting 'bower-detritus'...\n   [18:33:14] Finished 'bower-main-files' after 104 ms\n   [18:33:14] Finished 'bower-detritus' after 507 ms\n   [18:33:14] Starting 'bower'...\n   [18:33:14] Finished 'bower' after 18 \u03bcs\n   [18:33:14] Starting 'build'...\n   [18:33:14] Finished 'build' after 5 \u03bcs\n\n   You have requested to collect static files at the destination\n   location as specified in your settings:\n\n       /Users/beau/p/example/static-files\n\n   This will overwrite existing files!\n   Are you sure you want to do this?\n\n   Type 'yes' to continue, or 'no' to cancel: yes\n   Copying '/Users/beau/p/example/build/js/bundle-about.js'\n   Copying '/Users/beau/p/example/build/js/bundle-about.map.json'\n   Copying '/Users/beau/p/example/build/js/bundle-accounts-login.js'\n   Copying '/Users/beau/p/example/build/js/bundle-accounts-login.map.json'\n   Copying '/Users/beau/p/example/build/js/bundle-accounts-signup.js'\n   Copying '/Users/beau/p/example/build/js/bundle-accounts-signup.map.json'\n   Copying '/Users/beau/p/example/build/js/bundle-activities.js'\n   Copying '/Users/beau/p/example/build/js/bundle-activities.map.json'\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Run your gulp tasks with runserver and collectstatic",
    "version": "4.1.0",
    "split_keywords": [
        "django"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d424455b77dcff0e9faa30d301e85a0638daede4f727a712c0a55f842d444f12",
                "md5": "2090651e11c5290361cacf285cf5a30b",
                "sha256": "00d56f903fbbffe6338ffcf0522bbadf1e5775ffd8a37d7c9567bfe3ae9dc31e"
            },
            "downloads": -1,
            "filename": "django_gulp-4.1.0-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2090651e11c5290361cacf285cf5a30b",
            "packagetype": "bdist_wheel",
            "python_version": "3.6",
            "requires_python": null,
            "size": 7023,
            "upload_time": "2018-06-27T18:20:55",
            "upload_time_iso_8601": "2018-06-27T18:20:55.293853Z",
            "url": "https://files.pythonhosted.org/packages/d4/24/455b77dcff0e9faa30d301e85a0638daede4f727a712c0a55f842d444f12/django_gulp-4.1.0-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5f1ad796f16711fdf28b0b2b31f15c77f8c98547e91422be73273cb4776ead26",
                "md5": "aefdd91c58a919cb35af78de3a0c74ed",
                "sha256": "5f1b738689fd498504b368f5818633bf1c5a11ede9e79f67c248ce55776d6961"
            },
            "downloads": -1,
            "filename": "django-gulp-4.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "aefdd91c58a919cb35af78de3a0c74ed",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 6411,
            "upload_time": "2018-06-27T18:20:53",
            "upload_time_iso_8601": "2018-06-27T18:20:53.744937Z",
            "url": "https://files.pythonhosted.org/packages/5f/1a/d796f16711fdf28b0b2b31f15c77f8c98547e91422be73273cb4776ead26/django-gulp-4.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2018-06-27 18:20:53",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "beaugunderson",
    "github_project": "django-gulp",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "tox": true,
    "lcname": "django-gulp"
}
        
Elapsed time: 0.09402s