heroku-python / dj-static

DEPRECATED - use WhiteNoise instead!
http://kennethreitz.org/introducing-dj-static/
BSD 2-Clause "Simplified" License
511 stars 74 forks source link

Backported for Django 1.4 compatibility #12

Closed wnh closed 10 years ago

wnh commented 11 years ago

Thanks @tinnet for doing all the real work

tinnet commented 11 years ago

:+1:

CalumJEadie commented 10 years ago

+1

sangel10 commented 10 years ago

Is there a way that I can use this with Heroku and Django 1.4?

natea commented 10 years ago

The way I used it was to pip uninstall dj-static and then re-install it using the Django 1.4 compat fork/branch:

pip install git+https://github.com/wnh/dj-static.git@feature/django-1.4-compat#egg=dj-static 
sangel10 commented 10 years ago

and then "git+https://github.com/wnh/dj-static.git@feature/django-1.4-compat#egg=dj-static " should get written to requirements.txt when I freeze, right?

wnh commented 10 years ago

I'm just using the the master zip file straight from github (https://github.com/wnh/dj-static/archive/master.zip)

Although you need to put the URL explicitly in your requirements.txt file, because pip freeze will still report it as dj-static==0.0.5

sangel10 commented 10 years ago

I tried both of these methods and both worked locally but when I pushed to Heroku I got the same error. Is anyone using this successfully with Heroku and Django 1.4?:


2013-10-15T20:09:37.910845+00:00 app[web.1]:     self.wsgi = self.app.wsgi()
2013-10-15T20:09:37.911024+00:00 app[web.1]:     from dj_static import Cling
2013-10-15T20:09:37.911024+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/dj_static.py", line 7, in <module>
2013-10-15T20:09:37.911024+00:00 app[web.1]:     from django.core.handlers.base import get_path_info
2013-10-15T20:09:37.911024+00:00 app[web.1]: ImportError: cannot import name get_path_info
natea commented 10 years ago

you need to wipe the virtualenv on heroku clean by creating a runtime.txt with this line: python-2.7.3

and then re-deploy to herok.

On Tue, Oct 15, 2013 at 4:14 PM, sangel10 notifications@github.com wrote:

I tried both of these methods and both worked locally but when I pushed to Heroku I got the same error. Is anyone using this successfully with Heroku and Django 1.4?:

2013-10-15T20:09:37.910845+00:00 app[web.1]: self.wsgi = self.app.wsgi() 2013-10-15T20:09:37.911024+00:00 app[web.1]: from dj_static import Cling 2013-10-15T20:09:37.911024+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/dj_static.py", line 7, in 2013-10-15T20:09:37.911024+00:00 app[web.1]: from django.core.handlers.base import get_path_info 2013-10-15T20:09:37.911024+00:00 app[web.1]: ImportError: cannot import name get_path_info

— Reply to this email directly or view it on GitHubhttps://github.com/kennethreitz/dj-static/pull/12#issuecomment-26368160 .

nate@appsembler.com +1 (617) 517-4953 http://twitter.com/natea | http://linkedin.com/in/natea

sangel10 commented 10 years ago

@natea great, that did the trick. thanks.

kennethreitz commented 10 years ago

Thanks so much!

kennethreitz commented 10 years ago

Would you mind doing a quick rebase so I can merge this in? :D

kennethreitz commented 10 years ago

Manually merging.