issue writing to compile_dir

33 views
Skip to first unread message

Howie Weiner

unread,
Aug 16, 2013, 11:34:13 AM8/16/13
to django-...@googlegroups.com
Hi Dave

Great library. Got it working fine locally. I have however, run into an issue running on my host (Webfaction). None of the files seem to be actually written to the compile_dir. Looking at the path written to the console files should be written to the tmp dir, but there is nothing actually written there. I'm guessing as I'm on a shared server, this will be the reason. Can't see any way to configure the compile_dir.

Guess,  it might be nice to make this a config option?

Dave Hall

unread,
Aug 16, 2013, 11:56:14 AM8/16/13
to Howie Weiner, django-...@googlegroups.com
django-reversion cleans up after itself having run, so you won't see any files there.

I've just checked on my own webfaction account, and the temp dir is writeable, which implies that this isn't the issue.

Out of interest, when you run a normal collectstatic, without django-require, do all the files end up in the right place?

--
You received this message because you are subscribed to the Google Groups "django-require discussion and announcements" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-requir...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Howie Weiner

unread,
Aug 16, 2013, 1:08:35 PM8/16/13
to Dave Hall, django-...@googlegroups.com
Aah. OK. Makes sense. Red herring then. I'm getting the old jQuery error:

Tracing dependencies for: almond
 out: JavaException: java.io.FileNotFoundException: /tmp/tmpYEybTe/js/lib/jquery/jquery.js (No such file or directory)

I know there are issues with jquery and require.js in general regarding the file location, but I had resolved this locally by specifying the mainConfigFile.

As this is the first dependency, I guessed it was an issue with writing to the tmp dir. Likely an issue with r.js then. Odd that it works locally, but not on Webfaction though. I guess the only difference might be the version?

Howie

Web and Mobile Development
m: 07932 138 668

Howie Weiner

unread,
Aug 18, 2013, 4:32:11 PM8/18/13
to django-...@googlegroups.com, Howie Weiner
So, the issue had absolutely nothing to do with dango-require, require.js nor Webfaction. My gitignore file included 'lib' and my js libraries were in a lib folder. duh.

Once I sorted this out it worked fine - though I hadn't yet installed node on the Webfaction server, and with the django-require 'auto' setting, the java compiler kicked in and immediately maxed out my memory allowance.. oops

Dave Hall

unread,
Aug 19, 2013, 5:03:55 AM8/19/13
to Howie Weiner, django-...@googlegroups.com
Sounds like you had an exciting time! :P

Howie Weiner

unread,
Aug 20, 2013, 7:30:11 PM8/20/13
to django-...@googlegroups.com, Howie Weiner
Don't suppose you have managed to pre-compile Handlebars templates as part of the optimisation performed by django-require?

I'm using the popular require-handlebars plugin (https://github.com/SlexAxton/require-handlebars-plugin) and have it working locally including running. r.js locally. I can successfully run my app using the optimised JS file, and all templates are precompiled into the file.

However, when optimising using django-require as part of collectstatic, it fails to find Handlebars with the following error:

Error: Error: ENOENT, no such file or directory '/tmp/tmpVm6ysT/js/lib/Handlebars.js'
In module tree:
main
  app
    views/header
      hbs

Further up the output, I can see the file is Uglified to a different temp dir - Uglify2 file: /tmp/tmpTSPkW8/js/lib/handlebars.js

Comparing with the output from the local optimisation, the hbs templates appear to be being ignored when django-require runs r.js files starting !hbs

Any hints?

Thnx

Dave Hall

unread,
Aug 21, 2013, 4:45:24 AM8/21/13
to Howie Weiner, django-...@googlegroups.com
That's pretty odd. Behind the scenes, all django-require does is run your app.build.js file into a tmp dir as part of collectstatic, then move back any modified files to the static dir.

I've not used handlebars in this way before, but I've written plugins for precompiling angularjs and underscore templates.

Is it possible that the hbs module doesn't run under node?

Howie Weiner

unread,
Aug 21, 2013, 5:29:28 AM8/21/13
to django-...@googlegroups.com, Howie Weiner
Managed to sort it out. Once again, nothing to do with your plug-in. Renamed 'handlebars.js' toi 'Handlebars.js' and this wasn't being picked up by git

sorry to have bothered you

Dave Hall

unread,
Aug 21, 2013, 5:33:40 AM8/21/13
to Howie Weiner, django-...@googlegroups.com
No worries! :P
Reply all
Reply to author
Forward
0 new messages