if anyone can help me, I'd really appreciate it. I've made a simple little django app and am trying to learn how to deploy to heroku. I'm following a guide and I need to install some dependencies. All of them installed fine except psycopg2. "pip install psycopg2" gives me this output: http://pastebin.com/SnH1wWWa
I've scoured stackexchange and google looking for answers, but can't find what I have to do
__love__
if you only need psycopg2 on heroku, and not locally, don't install it locally
as8
will I need to add psycopg2 to requirements.txt? or does heroku already know to use it
IIRC, {% static %} has the advantage of being able to compute hostname components of the URL which may change, such as CDN containers.
Since it calls down to the storage backend to get the URL.
aah
folks -- I'm trying to override submit_line.html to add some logic based on the logged in user, but I can't seem to access request.user in here -- any thoughts? something as simple as request.user.is_superuser doesn't appear to be available.
ph44 joined the channel
fission6
thanks mattmcc ill start using that after yrs with {{ STATIC_URL }}
foo` joined the channel
zhost has quit
__love__
aah: you have the request context processor turned on, right?
mattmcc
The auth context processor is on by default, you don't have to go through request.
cro joined the channel
Though you do still have to use RequestContext.
Hien has quit
fission6
mattmcc: what do you use
bwreilly joined the channel
giarc has quit
{{ STATIC_URL }} or {% static %}
giarc joined the channel
mattmcc
My stuff's still STATIC_URL, largely because I haven't needed to switch.
fission6
word
Z_A_M
nevermind I fixed it I wasn't listening at port 433
polishnorbi joined the channel
nettoweb joined the channel
Hien joined the channel
ehmatthes joined the channel
giarc
heh, i just converted an app to use {% static 'url %}
deploying static files sure has gotten better...
kenbolton joined the channel
at first glance, collectstatic looked laborious and odd…but, i'm sold
csotelo has quit
polishnorbi has quit
radez is now known as radez_g0n3
__love__
same here. haven't needed to switch
Siecje joined the channel
how does `collectstatic` look complicated?
foo` has quit
aah has quit
aah joined the channel
aah has quit
giarc
just seemed strange to make copies. also, wasn't entirely clear which setting was doing what…but once i actually used it, it was clear
__love__
yeah, the static/media stuff could use some better names
kenbolton has quit
giarc
…like, so many different settings w/ the word 'STATIC' to wrap your head around
also, the MEDIA_ ones
__love__
i think STATIC_ROOT and STATIC_URL are fine
STATICFILES_DIRS should be ASSET_DIRS
then it's easy to explain that your assets get collected into the static root
xorobabel has quit
giarc
honestly, i feel like coming at it now for the first time it might not feel as odd. but given the learned behavior of older implementations and usage it was harder
mattmcc
giarc: Don't make copies, make symlinks. ;)
tbaxter
I think both media and static stuff could be named better, but I understand the historical reasons that brought us where we are
__love__
and MEDIA_* should be UPLOADS_*
giarc
mattmcc: WHAT?
symlinks?
mattmcc
collectstatic -l
giarc
ah
__love__
mattmcc: oh god no
mattmcc: what does that do for assets that need compilation?
giarc
wasn't aware of that...
serving from a CDN anwyay..so, symlinks wont work
mattmcc
Yeah, if you're compiling or hosting offiste, obviously symlinks are out.
__love__
so basically if you're doing anything of consequence… ;)
giarc
but symlinks makes total sense for same host
__love__
for non-compiled, same host, yes
polishnorbi joined the channel
polishnorbi has quit
giarc
( used to symlink the admin static files in anyway! )
dfdx2 joined the channel
krassinger joined the channel
…what sort of 'media' you folks having users upload that needs compiling?
…just curious
dray3 joined the channel
__love__
none
we're talking about static files
hence 'collectSTATIC'
giarc
__love__: "mattmcc: what does that do for assets that need compilation?" ?
mattmcc
giarc: LESS/SASS, JS that you want to compress, etc.
tbaxter
I compile my user photo uploads into a giant sprite via PIL. Makes for bad load times, but really interesting slideshows.
mattmcc
Heh.
__love__
even just combining and minifying css and js
krassinger
i'm on a shared hosting provider and i have 2 domains. they both use the same django project. does it make sense to clone my repo twice onto the server and keep them separate that way or should i configure my project to manage both domains?
giarc
ah, gotcha w/ minified js etc
krassinger
is that even possible with fcgi?
giarc
guess i misread that…thought you were referring to uploaded content
kamol joined the channel
zerick has quit
( MEDIA rather than STATIC files… ;-) )
dibic has quit
nullcode has quit
darwin_bio has left the channel
nettoweb has quit
kenbolton joined the channel
krassinger
thoughts?
FunkyBob
krassinger: if it should be identical content for both domains, I don't see any reason to run two instances
CodenameTim has quit
giarc
krassinger: you could configure the webserver to serve the same code for each domain. seems simpler than having 2 copies
FunkyBob
krassinger: the FastCGI task will happily answer requests from wherever
mwmnj joined the channel
rolleiflex has quit
moneydouble has quit
tbaxter
same app stack, same content, then one project. But if they diverge, I'd have two projects (or at least two settings files) sharing apps. Still one Django install, of course.
Laybunz joined the channel
rolleiflex joined the channel
blackpuma joined the channel
pdurbin joined the channel
NomadJim joined the channel
chrislkeller has quit
lint-tech joined the channel
matt`r_ joined the channel
dlam has quit
hyperair joined the channel
FunkyBob
anyone ever done a nested {% include %} for, say, a Menu structure,, and had problems?
I'm trying to concoct a test case for a PR
tbaxter
FunkyBob: memory is hazy but I seem to recal a problem like that
matt`r has quit
blackpuma
Given models Supplier and Order, where Order has attribute supplier=ForeignKey(Supplier), can I do a filter() on Supplier to get suppliers with > 0 order records? I'm currently using a list comprehension to iterate over Supplier, which obviously is suboptimal. My nose has been in the docs, to no avail. :/
FunkyBob
tbaxter: yeah, there was potentially an infinite recursion issue