These are chat archives for owais/django-webpack-loader

20th
Oct 2015
liondancer
@liondancer
Oct 20 2015 06:45
@owais are you free?
Owais Lone
@owais
Oct 20 2015 06:56
@liondancer not for long.
liondancer
@liondancer
Oct 20 2015 06:59
shoot
well i restructured my project
trying the 100% decoupling
but im not sure how to make the two talk
if you have time would you mind taking a look?
Owais Lone
@owais
Oct 20 2015 07:10
use django rest framework to create an api and use something like superagent.js or even jquery in the react app to communicate with the sever
liondancer
@liondancer
Oct 20 2015 07:11
im not sure how to get the frontend app running? use django-webpack-loader to load into the index.html?
Owais Lone
@owais
Oct 20 2015 07:16
Yes, that is the easier approach
liondancer
@liondancer
Oct 20 2015 07:16
Ill give that a shot
thanks again for all the help
Daniel Pouzemski
@fredsmoo
Oct 20 2015 13:36
Hi guys, do you happen to know if django-webpack-loader works with babel-plugin-react-transform instead of react-hot-loader?
I am getting an error from Django "type object argument after ** must be a mapping, not str" in a simple template with {% render_bundle 'main' %}
Not sure if it's due to babel-plugin-react-transform or maybe the fact that the bundles are still stored in-memory instead on the file system (is this a requirement btw?). Would be great if someone could help out
Owais Lone
@owais
Oct 20 2015 14:51
django-webpack-loader doesn't know anything about any webpack plugin or config
All it does is read a file generated by webpack-loader-plugin and use information in it to render tags in templates
Daniel Pouzemski
@fredsmoo
Oct 20 2015 14:52
I see, I assume you mean webpack-stats.json
Which I can generate successfully. It's still failing for me on {% load render_bundle from webpack_loader %}
Could that be because I am on a slightly older Django version 1.6.3?
Daniel Pouzemski
@fredsmoo
Oct 20 2015 15:34
Diving a bit deeper it looks like it's failing here: https://github.com/owais/django-webpack-loader/blob/master/webpack_loader/utils.py#L26 with the error "type object argument after ** must be a mapping, not str".
Daniel Pouzemski
@fredsmoo
Oct 20 2015 15:49

Ok, I found it through debugging: There has to be a hash inside the WEBPACK_LOADER with a configuration name. While I see that the README has the correct config example your article I was reading (http://owaislone.org/blog/webpack-plus-reactjs-and-django/#Django_integration) seems to be outdated and has the configuration following the hash directly like:

```

WEBPACK_LOADER = { 'BUNDLE_DIR_NAME': 'bundles/', 'STATS_FILE': os.path.join(BASE_DIR, 'webpack-stats.json'), }
Would be cool if you could update the article. Otherwise the docs are excellent, but I just lost couple of hours trying to debug the issue :)
Owais Lone
@owais
Oct 20 2015 16:36
Sorry about that
and thanks for figuring it out. Will update the article
liondancer
@liondancer
Oct 20 2015 16:41

I am getting the error:
Traceback: http://dpaste.com/1YE3ZFZ
django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.

Would it have to do with my settings.py?

https://github.com/liondancer/django-cherngloong/blob/master/server/cherngloong/settings.py

Owais Lone
@owais
Oct 20 2015 17:49
I think it is better to ask that in #django
much more people to help out there with django related stuff
Usually this happens when you try to import something before an app is initialized like a model
or if there is a circular import
liondancer
@liondancer
Oct 20 2015 18:02
I foudn out the issue
not many peopel are active in django gitter =/
Owais Lone
@owais
Oct 20 2015 18:42
Yea, django gitter is not hot
but Django IRC is very very active