if you know how to achieve this please just tell me exactly how to do it
everywhere I ask people just keep pointing me to new references and nothing actually explicitly states how to do it
it's stupid
darkman66 joined the channel
I mean iOS apps accept cookies I think
..
FunkyBob
well, currently Django's default auth works using sessions
storing the current user in the session data.
so if you persist the session, which is managed by passing the session cookie from the client, the authentication remains
ustunozgur joined the channel
cppCzar
agh, so when I login through django's system
it creates a cookie?
Andy80 has quit
I guess that's exactly what I'm asking how to do
how can I persist the session?
and how can I get the cookie to the client?
tubaman joined the channel
FunkyBob
cppCzar: no, the session machinery assigns a cookie long before you log in
cppCzar
o.o
how?
FunkyBob
sessions are independant of logins
the cookie is automatically sent to the client...
it's a basic part of HTTP
cppCzar
at what point is the cookie automatically sent?
ustunozgur has quit
my app doesn't even interact with the server until you either create an account (which sends ONE post) or login (which sends a POST)
FunkyBob
from memory, the session cookie isn't returned until something is stored in the session
dali has quit
dali joined the channel
mattmcc
There's no reason your app can't just ping the server in the backend prior to the login form being posted.
cppCzar
mattmcc: good point
so when I store something in the session, how EXACTLY is the cookie getting returned?
Is it set in an http header?
FunkyBob
the normal, standard, HTTP way - in a header
cppCzar
because my only httpresponse with login is a string
okay, so even though I have "return HttpResponse("success")"... <- that will in fact return the cookie through the header too?
FunkyBob
yes, because it's handled by the sessions middleware
bmac joined the channel
cppCzar
FunkyBob: Okay, I'm getting closer to my answer then. :d Thanks man
So; how would I retrieve said cookie on the iOS side of things?
meaning what http header is it stored in?
mattmcc
Y'know, it's unlikely that the iOS API _doesn't_ have a simple HTTP library that handles all this stuff for you.
cppCzar
and is the header included in the "response"? because all I know to parse on iOS is the response that I receive from the server
mattmcc
Any decent HTTP library parses cookies and hands them to you in an appropriate data structure.
cppCzar
mattmcc: it does, but you still have to know how the backend works to even understand it
mattmcc: right, but I don't even know what header django puts the cookie in
tubaman has quit
kushal joined the channel
scipy53
Hey guys, I have a form which I am submitting via AJAX (instead of just the regular html form) ... but I'm running into a problem - I can't seem to submit files through ajax. Has anyone encountered this problem before and have a solution? Would very much appreciate it. Thanks!
mattmcc
RFC2109..
FunkyBob
cppCzar: it uses the STANDARD HTTP HEADERS FOR COOKIES
it's not anything Django specific
cppCzar
FunkyBob: Okay... it just has to be stored with a key or something. I don't understand how I'm supposed to find the cookie in the http header for cookies without knowing the key it was stored with
-_-
loic84 has quit
rgenito joined the channel
mattmcc
By default the cookie is just 'sessionid'
FunkyBob
cppCzar: as mattmcc was pointing out -- how you handle it will be dependant on your HTTP handling libs
so go read their docs
cppCzar
okay
thank you.
sorry to bother
I just really haven't been able to find any help on the subject
then every time I go into the iosdev room they tell me to use OAuth
FunkyBob
tell them you refuse to use any standard that is so harshly canned by its creator :P
cppCzar
but I don't see why I should need to use OAuth... or even understand the point of using OAuth2.0
what exactly is the purpose of OAuth2.0? (and what can it do that django sessions cannot)
FunkyBob
yeah, it's entirely the wrong solution for your case
the purpose of oauth2 is to provide 3rd party authentication and authroisation services
cppCzar
See, I've read that too, but I don't quite get what 3rd party authentication and authorisation services are
I know this is far branching from django
and I apologize
mattmcc
Typically, social sites.
estebistec has quit
But it may also be a service, like Dropbox, Google Apps, Github, whatever.
cppCzar
okay
what makes them need that type of authentication that other services don't?
msc has quit
What are they doing that needs that authentication?
mattmcc
They may be interacting with your account on those sites.
stevezau joined the channel
For Dropbox, it allows a site to sync files to a particular folder of yours, for example.
NomadJim_ joined the channel
msc joined the channel
cppCzar
I just don't see what that has to do with oAuth
>.<
I'm just a noob
FunkyBob
I can use it to permit TravisCI to access my Git Repo so it can listen for when I push commits
mattmcc
OAuth is the mechanism they use to authenticate you before you can make use of those APIs.
FunkyBob
you want your own client to authenticate with your own server... oauth is not the right tool
NomadJim has quit
cppCzar
well I want anyone's client to authenticate with the server I'm setting up
codygman has quit
mattmcc
Your server isn't a third party, so you don't need OAuth.
cppCzar
and the server will be messing with their user accounts and such, and post requests they make will be changing data associated with the account
ah, okay
I get it now
I think
somewhat
if my app was going to interact with Facebook, I would need Oauth?
FunkyBob
yes, but you would be an oauth consumer, not provider
stevezau
I want to provide a view where a user can go through and edit selected rows from a database table.. so the first page they select the items they want to edit.. then they hit the "fix" button.. they will then be present with each item one by one with some options on what they want to do.. Whats the best way to do this?? It's kinda like Pagination but the user selects which objects they want to
change (shown one by one)
or should i just do some jquery magic
cppCzar
FunkyBob: Oh, so if OTHER services were going to interact with my app, I would need to be an OAuth provider and provide oAuthorization to the clients trying to access my service?
I think it all just clicked.
thepeculiarform joined the channel
FunkyBob
yay!
cfoch joined the channel
mattmcc
stevezau: On the list page, wrap your item list with a form, give each row a checkbox that has the item ID as its value.
stevezau
mattmcc yeah i don't want to list all the items in one view
i want it as a detailedview but with a next button to move onto the next item/row
calamari has quit
mattmcc
Store the list of items to be edited in a session variable.
fire joined the channel
fire
is their any ecommerce framework based on django ?
just a thought, frameworks based on python might not be fully featured like magento and opencart ?
FunkyBob
why not?
mattmcc
Why would the language have anything to do with the features of the framework?
EyePulp joined the channel
twoolie has quit
FunkyBob
in fact, having a cleaner language would, IMHO, make it easier to produce full featured frameworks
adambrenecki joined the channel
nkuttler
mattmcc: some languages have lousy db abstraction libs
FunkyBob
nkuttler:that hasn't stopped PHP :P
mattmcc
Well, the context here was ecommerce.
nkuttler
FunkyBob: well, php had an early mover advantage :\
funny, today i was looking into the symphony framework, i was told it's well engineered. after 30 minutes i thought wth am i doing..
fire
mattmcc: infact python is more better for being cleaner language, but people suggest that python based e-commerce frameworks are yet to be get matured compred to other php based frameworks.
FunkyBob
AIUI django-oscar came out of a site that handles 25+ million line items...
mattmcc
fire: Oh, well that would be more about the majority of the projects themselves, not at all relevant to the language they're written in.
*maturity
fire
mattmcc: frankly speaking i have never got into e-commerce thing before so just bit confused
FunkyBob
fire: well, speaking as someone maintaining a large e-commerce site...