Code Monkey home page Code Monkey logo

django-compressor-requirejs's People

Contributors

bpeschier avatar iven avatar svleeuwen avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

django-compressor-requirejs's Issues

django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.

Hi,

Using Django 1.9.4 on Python 3.4.3 there is an error when trying to use this app.

Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x7f3975404b70>
Traceback (most recent call last):
  File "/.../VirtualEnv/lib/python3.4/site-packages/django/utils/autoreload.py", line 226, in wrapper
    fn(*args, **kwargs)
  File "/.../VirtualEnv/lib/python3.4/site-packages/django/core/management/commands/runserver.py", line 109, in inner_run
    autoreload.raise_last_exception()
  File "/.../VirtualEnv/lib/python3.4/site-packages/django/utils/autoreload.py", line 249, in raise_last_exception
    six.reraise(*_exception)
  File "/.../VirtualEnv/lib/python3.4/site-packages/django/utils/six.py", line 685, in reraise
    raise value.with_traceback(tb)
  File "/.../VirtualEnv/lib/python3.4/site-packages/django/utils/autoreload.py", line 226, in wrapper
    fn(*args, **kwargs)
  File "/.../VirtualEnv/lib/python3.4/site-packages/django/__init__.py", line 18, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/.../VirtualEnv/lib/python3.4/site-packages/django/apps/registry.py", line 85, in populate
    app_config = AppConfig.create(entry)
  File "/.../VirtualEnv/lib/python3.4/site-packages/django/apps/config.py", line 90, in create
    module = import_module(entry)
  File "/.../VirtualEnv/lib/python3.4/importlib/__init__.py", line 109, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
  File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
  File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1129, in _exec
  File "<frozen importlib._bootstrap>", line 1471, in exec_module
  File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
  File "/.../VirtualEnv/lib/python3.4/site-packages/requirejs/__init__.py", line 1, in <module>
    from .filter import RequireJSCompiler
  File "/.../VirtualEnv/lib/python3.4/site-packages/requirejs/filter.py", line 19, in <module>
    from .js import JsCompressor
  File "/.../VirtualEnv/lib/python3.4/site-packages/requirejs/js.py", line 5, in <module>
    from compressor.js import JsCompressor as CompressorJsCompressor
  File "/.../VirtualEnv/lib/python3.4/site-packages/compressor/js.py", line 2, in <module>
    from compressor.base import Compressor, SOURCE_HUNK, SOURCE_FILE
  File "/.../VirtualEnv/lib/python3.4/site-packages/compressor/base.py", line 19, in <module>
    from compressor.utils import get_class, get_mod_func, staticfiles
  File "/.../VirtualEnv/lib/python3.4/site-packages/compressor/utils/staticfiles.py", line 9, in <module>
    if apps.is_installed("django.contrib.staticfiles"):
  File "/.../VirtualEnv/lib/python3.4/site-packages/django/apps/registry.py", line 227, in is_installed
    self.check_apps_ready()
  File "/.../VirtualEnv/lib/python3.4/site-packages/django/apps/registry.py", line 124, in check_apps_ready
    raise AppRegistryNotReady("Apps aren't loaded yet.")
django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.

A simple workaround for this is to move the import from .js import JsCompressor
into the function write_output.

Push 0.4 to PyPi

Currently only 0.3 is available. The settings since have changed so it would be great to have the current version pushed to PyPi.

Handle predefined modules

jQuery and Masonry set their own module names in a complete define(, [], function(...) { ... }) call. This requires a paths setting if the module is not on that path.

Currently the compressor filter labels these modules under their full path, instead of recognising the module has its name preset.

filter.py: ImportError: cannot import name 'app_template_dirs'

Hey,

I'm using Django 1.8.3 with Python 3.4.3, and I have the following error when trying to use your module:

>>> import requirejs
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/.../venv/lib/python3.4/site-packages/requirejs/__init__.py", line 1, in <module>
    from .filter import RequireJSCompiler
  File "/.../venv/lib/python3.4/site-packages/requirejs/filter.py", line 8, in <module>
    from django.template.loaders.app_directories import app_template_dirs
ImportError: cannot import name 'app_template_dirs'

It seems that app_template_dirs is indeed not there:

>>> from django.template.loaders.app_directories import app_template_dirs
Traceback (most recent call last):
  File "<input>", line 1, in <module>
ImportError: cannot import name 'app_template_dirs'

django.template.loaders.app_directories has a get_app_template_dirs function.

Could you please fix this?

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.