jordan87: you need to tell it what app/module to run tests for, as I recall
NomadJim has quit
rmwdeveloper
tbaxter: is the initial dict typically empty?
tbaxter
dunno.
I would add to it though
v0lksman
is there a way to get the timezone of the end user? is it in the request object somewhere?
Diegao
FunkyBob: hi
zz_saschpe is now known as saschpe
Genitrust joined the channel
tbaxter
v0lksman: well, how do you expect to know the end user’s time zone?
Genitrus_ has quit
jordan87
tbaxter: I'm able to run with Tools > run manage.py task > test no issues
dyl
hrm
v0lksman
tbaxter: maybe something sent by the browser based on the users locale?
dyl
how to do this >_>
jordan87
tbaxter: but when I try to set up tests under configuration, it doesn't work
natea joined the channel
tbaxter
v0lksman: but other than geolocation, which is poorly supported and easy to turn off, how would the browser know locale? And which locale? Where they’re at most, or where they are now? For example, if I’m filling out an incident report form while I’m on the road, which is relevant, my home locale, the inciden’ts locale, or where I”m at now.
Timezones are hard.
v0lksman
tbaxter: they are...but in my case I'm not that picky...the "current" location timezone is good enough for my puroposes.
I guess the answer is no. so I'll dig another route (they provide postal code, maybe there is a way to determin from that)
radez_g0n3 is now known as radez
josephleon joined the channel
ovnicraft joined the channel
benjf joined the channel
bwreilly has quit
surfnturf
i'm using django-summernote in my project. works fine on my pc. but when i run on digital ocean, the editor doesn't show. I traced the problem to the html file created by summernote. It has a path "/static/django_summernote/summernote.min.js". How can I fix this?
And no, Django doesn't cache any requests by default at all.
idontneedanick has quit
I usually use Varnish + ESIs
roshanavand joined the channel
audioburn__away has quit
mmikeym
I'm getting csrf failure on PATCH and PUT request with restframework...I feel like it should be obvious what Im doing wrong but I see the csrf token in the request body just fine...any ideas?
dyl
Check your <form> tags.
jessamynsmith joined the channel
Your {% csrf_token %} might be rendering outside it.
{% csrf_token %}
mmikeym
it's an ajax PUT/PATCH request and its rendering fine
dyl
{{ my_form }}
surfnturf
tbaxter: you were right, my nginx was serving out /static instead of /staticfiles
mmikeym
first thing I checked
dyl
doesn't work.
hmm
paste?
paste it, I'll brb
Also, pop open your web debugger and intercept the request
check that the csrf token is indeed valid.
and present.
tbaxter
surfnturf: huh?
dyl
mmikeym If you can't figure it out, you ought to consider the X-CSRFToken header.
to be honest I just never really used PUT or PATCH much before
surfnturf
tbaxter: you were right that i did not configure my production server properly.
so it wasn't a bug. pilot error
jfkdaddy
Thanks, dyl.
erik` joined the channel
dyl
mmikeym hmm
mmikeym
dyl: works fine for POST requests....even from the same page
csrf is in the data from chromes console
dyl
Oh you know what.
Kronuz joined the channel
cleme1mp has quit
Those views are probably GETTING the csrf token
it's just *not the right one*.
mmikeym
ah that somewhat makes sense, but isn't the csrf token just set on a session basis since the user is logged in?
Kronuz has quit
dyl
CSRF is a cookie
(session independent nonce)
Kronuz joined the channel
It's session independent because it's supposed to prevent exploiting a users active session.
"This cookie is set by CsrfViewMiddleware. It is meant to be permanent, but since there is no way to set a cookie that never expires, it is sent with every response that has called django.middleware.csrf.get_token()"
nmd, it's one token.
limbera joined the channel
jordan87
So I'm trying to run all of my unit tests with my remote interpreter, but don't want my selenium tests to use that remote interpreter since it doesn't have any browsers (or GUI). is there an elegant way to handle this in pycharm/intellij (or even command line?)