FunkyBob: the way i described =) reverse() returns something like '/myapp/myurl' while the one in the response of a self.app.get() (i'm using WebTest) would be http://localhost:80/myapp/myurl (with the testserver address)
atlasloewenherz has quit
Kayra joined the channel
Kayra has quit
Kayra joined the channel
FunkyBob
I don't know what WebTest is... or how self.app.get() generates urls
so I still don't know the difference
Kayra has quit
codergonebad has quit
Kayra joined the channel
theshit123
hi, i am trying to do something when saving a object for a model and i dont know if i am doing it correctly or not, in the code i explain what i want to do: http://pastebin.com/33dJGUZ2 , basically i am trying to auto select a related object from other model using datefield but if there is not one for that date i want clone last one for that date and use it, the problem is when there is not anything i
need to tell the user he need make the first one.
Kayra has quit
Kayra joined the channel
pgcd
FunkyBob: it's the same with django testclient, i believe - only the urls become http://testserver/myapp/myurl (self.app.get() is equivalent to self.client.get())
(I just checked and I can confirm that that's the case)
uffs joined the channel
so, as far as I can tell, I can either manipulate the strings to compare them (perhaps prepending the "testserver" address to the reverse()d URL, but I can't find the reference on how to retrieve its address) or I can use resolve(), and I was wondering if there was any best practice
freeman_u joined the channel
kezabelle
what aspect of the response are you even testing?
dlogs has quit
IIRC LiveServer always uses testserver as it's address, FWIW
Kayra has quit
EyePulp joined the channel
pgcd
kezabelle: in this specific case I'm checking that a url is actually the get_absolute_url of an object
marek_sv joined the channel
marek_sv has quit
Kayra joined the channel
really, it's not a major issue (i've done it in the past by removiing the http://localhost:80/ bit, for instance)
kushal joined the channel
kezabelle
so you're doing something like self.client.get(obj.get_absolute_url()) …. and then testing what?
pgcd
but perhaps there are other, more standard ways
FunkyBob
you coud use the urlparse lib
kezabelle: yeah, that's what I don't get
pgcd: what are you trying to compare to what, and why?
pgcd
kezabelle: nope, i'm checking if the link generated in a feed is actually the correct one
kezabelle
do response headers even return the path you requested? can't imagine what the point'd be outside of a redirect
Kayra has quit
right
pgcd
i'm going through a TDD-style thingy phase
and yeah, redirects are another very common scenario
Kayra joined the channel
kezabelle
so you want to get the <loc> or whatever the xml element is, and then urlparse it and get the .path out of the namedtuple-ish thing
kezabelle: ok, makes sense and it's probably a lot easier to understand for whoever reads the test
kezabelle
bonus is you can also test the scheme, netloc etc too if you really want to
MblKiTA joined the channel
also means you can end up with querystring items in the feed and still be clear it represents the same object
pgcd
kezabelle: yep, that's very true =)
ghostlines joined the channel
emorrow joined the channel
Kayra has quit
kushal has quit
kushal joined the channel
Vadims joined the channel
snurfery has quit
bee_keeper has quit
Vadims
Hello everyone
could you help me to solve problem with CSS with django?
im fallowing tutorial part 1, and my admin panel doesnt accept static CSS file as CSS
Chrome console show me this error: Resource interpreted as Stylesheet but transferred with MIME type text/plain: "http://127.0.0.1:8000/static/admin/css/base.css".
hawkowl_work has left the channel
ticketbot has quit
what should i do to fix it?
ticketbot joined the channel
emorrow has quit
Andy80 joined the channel
MultiColourPixel has quit
hotsyk joined the channel
dali has quit
fumeboy joined the channel
nkuttler
Vadims: are you using runserver?
Vadims
yes
evrything step by step what says in tutorial
my main page where it says "it works" works fine and CSS applied
but most of the answers related to the users projects which they creat - so problem is specific. in my case i didnt create anything.... it is just basic tutorial
cardboard joined the channel
abarax joined the channel
Naeblis joined the channel
Chive joined the channel
Linux_Asylum joined the channel
Linux_Asylum has quit
pydave6367 has quit
Left_Turn joined the channel
gabrielo has quit
ghostlines has quit
renemarxis joined the channel
atlasloewenherz joined the channel
ghostlines joined the channel
MblKiTA has quit
MblKiTA joined the channel
emorrow joined the channel
gabrielo joined the channel
milafrerichs joined the channel
atlasloewenherz has quit
emorrow has quit
renemarxis
Hello i have some problem with nginx and gunicorn. I like to use gevent but it seems like my config is not correct. Using one worker and a long running django call blocks other calls to the app. Does someone see some error in my config files? Nginx: http://dpaste.de/Dfi5 and gunicorn http://dpaste.de/UAqH