Giter Site home page Giter Site logo

django-node's People

Contributors

gldnspud avatar glifchits avatar markfinger avatar mic159 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

django-node's Issues

Add management commands to handle broken node_modules

If npm fails half-way, it'll often break node_modules in a way that is only repairable by removing the directory and running npm install again.

Maybe:

  • ./manage.py npm_remove_node_modules delete node_modules directory in every app's root
  • ./manage.py npm_install invoke npm install on every app with a package.json file
  • ./manage.py npm_repair perform both of the above

Allow custom location for node_modules directory

It would be nice to let the users choose a different location for node_modules directory instead of node_modules in the source directory. Some times, we install packages globally instead of a virtualenv (like when in docker) so normal users cannot write to /usr/local/lib/python/...

Also, some times, we might already have a node_modules directory specified for other npm modules used with the product with proper PATHs set.

Clean TypeError output

TypeError: Cannot read property 'onReady' of undefined

Should be

TypeError: Cannot read property 'onReady' of undefined

Python 3.4 support

I try using this module on python 3.4, but i receive this error:

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/home/styleex/ferrario/env/lib/python3.4/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
    utility.execute()
  File "/home/styleex/ferrario/env/lib/python3.4/site-packages/django/core/management/__init__.py", line 354, in execute
    django.setup()
  File "/home/styleex/ferrario/env/lib/python3.4/site-packages/django/__init__.py", line 21, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/styleex/ferrario/env/lib/python3.4/site-packages/django/apps/registry.py", line 85, in populate
    app_config = AppConfig.create(entry)
  File "/home/styleex/ferrario/env/lib/python3.4/site-packages/django/apps/config.py", line 87, in create
    module = import_module(entry)
  File "/home/styleex/ferrario/env/lib/python3.4/importlib/__init__.py", line 109, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 2231, in _gcd_import
  File "<frozen importlib._bootstrap>", line 2214, in _find_and_load
  File "<frozen importlib._bootstrap>", line 2203, 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 1448, in exec_module
  File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
  File "/home/styleex/ferrario/env/lib/python3.4/site-packages/django_react/__init__.py", line 1, in <module>
    from .components import ReactComponent
  File "/home/styleex/ferrario/env/lib/python3.4/site-packages/django_react/components.py", line 10, in <module>
    from .render import render_component
  File "/home/styleex/ferrario/env/lib/python3.4/site-packages/django_react/render.py", line 4, in <module>
    from django_node import npm, node
  File "/home/styleex/ferrario/env/lib/python3.4/site-packages/django_node/npm.py", line 2, in <module>
    import settings
ImportError: No module named 'settings'

django_node does not seem to work on Windows

We currently have a setup where we have multiple developers some are on Linux and others are on Windows.

On Linux django_node works perfectly, but on Windows it fails.

We get the following trace:

"C:\Program Files (x86)\JetBrains\PyCharm 4.0.6\bin\runnerw.exe" C:\Python34\python.exe C:/Users/Frank/Dropbox/PycharmProjects/prototype/manage.py runserver 8000
Traceback (most recent call last):
File "C:/Users/Frank/Dropbox/PycharmProjects/prototype/manage.py", line 10, in
execute_from_command_line(sys.argv)
File "C:\Python34\lib\site-packages\django\core\management__init__.py", line 338, in execute_from_command_line
utility.execute()
File "C:\Python34\lib\site-packages\django\core\management__init__.py", line 312, in execute
django.setup()
File "C:\Python34\lib\site-packages\django__init__.py", line 18, in setup
apps.populate(settings.INSTALLED_APPS)
File "C:\Python34\lib\site-packages\django\apps\registry.py", line 108, in populate
app_config.import_models(all_models)
File "C:\Python34\lib\site-packages\django\apps\config.py", line 198, in import_models
self.models_module = import_module(models_module_name)
File "C:\Python34\lib\importlib__init__.py", line 109, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 2254, in _gcd_import
File "", line 2237, in _find_and_load
File "", line 2226, in _find_and_load_unlocked
File "", line 1200, in _load_unlocked
File "", line 1129, in _exec
File "", line 1471, in exec_module
File "", line 321, in _call_with_frames_removed
File "C:\Python34\lib\site-packages\django_node\models.py", line 5, in
install_configured_package_dependencies()
File "C:\Python34\lib\site-packages\django_node\package_dependent.py", line 19, in install_configured_package_dependencies
install_dependencies(directory)
File "C:\Python34\lib\site-packages\django_node\package_dependent.py", line 8, in install_dependencies
resolve_dependencies(path_to_run_npm_install_in=directory)
File "C:\Python34\lib\site-packages\django_node\utils.py", line 223, in resolve_dependencies
npm.install(path_to_run_npm_install_in)
File "C:\Python34\lib\site-packages\django_node\npm.py", line 37, in install
ensure_installed()
File "C:\Python34\lib\site-packages\django_node\npm.py", line 16, in ensure_installed
raise_if_dependency_missing(NPM_NAME)
File "C:\Python34\lib\site-packages\django_node\utils.py", line 121, in raise_if_dependency_missing
raise MissingDependency(error)
django_node.exceptions.MissingDependency: NPM is not installed or cannot be found at path "npm".

NPM is installed and available in the Windows path as npm --version works.

io.js compatibility

Would be worth checking if io.js is compatible.

I believe it uses the same entry point, node, so the only issue I can forsee would be version parsing.

npm.install commands can make a system look broken

The blocking nature of the subprocess is pretty opaque and makes it look broken, particularly if you're not expecting the extra stage when each app installs its dependencies.

npm.install should invoke subprocess.call, rather than utils.run_command.

Bower bindings

Should have a similar API and functionality set to the npm bindings.

I can't imagine a situation where services would want access to bower_components but they're useful in projects, so a functionality similar to the PACKAGE_DEPENDENCIES setting would be good - BOWER_DEPENDENCIES or some such.

https://github.com/nvbn/django-bower exists, but you lose a lot and gain very little by abstracting away bower's API to a handful of management commands. I'm more inclined to rely on bower's CLI locally and use these bindings to simply invoke bower install for dependency management on non-developer machines and remote servers.

PATH_TO_NPM = setting_overrides.get( 'PATH_TO_NODE', 'npm' )

I am using windows but I couldnt get django to find the npm binary. after going through the source, settings.py I noticed this

PATH_TO_NPM = setting_overrides.get(
    'PATH_TO_NODE',
    'npm'
)

shouldn't it be

PATH_TO_NPM = setting_overrides.get(
    'PATH_TO_NPM',
    'npm'
)

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.