Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

No way to get this to work on Heroku #486

Open
alper opened this Issue · 5 comments

4 participants

@alper

Searching around the web there doesn't seem a straight forward way to get this to work on heroku.

I figured that putting everything on S3 as is the heroku recommended way for files would be the way to go. Then I read this: http://django-compressor.readthedocs.org/en/latest/remote-storages/
which is all fine but after having done that it doesn't say what the result is. Do I run collectstatic, compress, both? Do I do it locally or do I let the heroku push hook do it for me? Or do I in fact disable the heroku collectstatic because I don't have lessc &co in the heroku environment anyway.

So at the least this would be a documentation bug for this page: http://django-compressor.readthedocs.org/en/latest/remote-storages/

In principle this should work on heroku as well if you generate everything offline and check them into your version control, right?

There are these articles about setting up node and less in the heroku environment but they seem a bit excessive and don't in fact work:
http://marklmiddleton.com/2013/using-less-with-django-on-heroku/
http://www.sore.nu/blog/2012/dec/30/fieldguide-django-bootstrap-less-coffeescript-and-/

Am I missing anything here? After spending half a day on this yesterday I'm giving up (the clear alternative is compiling everything locally using the standard front end tools).

@syphar

Not a bug ;)

But there were many questions ;)

  • in most load-scenarios I would use dj-static (as seen in the heroku docs) or whitenoise for serving static files on heroku.
  • if everything is configured fine, heroku runs collectstatic for you when you push your code
  • if you want to add offline-compression, you can add a post_compile script (see here) that runs compress for you
  • don't offline-compress locally, let heroku do this for you.

  • for installing lessc on heroku is another task, I would have to google and try, too .. But your first link looks promising (at least the post_compile script).

@alper

In the section linked above under "Using staticfiles" still no idea why you need to make your own storage subclass or what you need to do after you've done it.

I tried installing lessc on heroku but if the post_compile script given doesn't work directly, this is extremely tedious to debug and frankly it doesn't sound like a good idea to create a container with everything and the kitchen sink.

Amazed at how hard this is still, but if anybody tells me what is happening here: http://django-compressor.readthedocs.org/en/latest/remote-storages/
I'll be happy to add a documentation patch.

@therippa

I created a fork of django-skel that supports django-compressor, scss compilation, bower, and bunch of other stuff (and have it running on heroku). Is anyone interested in seeing it?

@alper

I think people would definitely be interested in seeing stuff that works!

@konklone konklone referenced this issue in sunlightlabs/dryrub
Open

Make django-compressor optional #2

@briandant

@therippa: I'd be interested in seeing that, too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.