Re: Form to login

2015-11-03 Thread Dheerendra Rathor
Django do have built-in forms. Take a look here https://docs.djangoproject.com/en/1.8/topics/auth/default/#module-django.contrib.auth.forms On Wed, 4 Nov 2015 at 11:21 Dariusz Mysior wrote: > I try do login view and I find it on > >

Re: can I write Django a client consuming RESTfull api from elsewhere

2015-11-03 Thread Gergely Polonkai
On 4 Nov 2015 05:45, "kk" wrote: > > > > On Tuesday 03 November 2015 08:35 PM, Remco Gerlich wrote: >> >> Django code is just normal Python. Python can call REST APIs, sure (a nice library is Requests: docs.python-requests.org/en/latest/ ) >> > I got to see this, thanks, had a

Form to login

2015-11-03 Thread Dariusz Mysior
I try do login view and I find it on https://docs.djangoproject.com/en/1.8/topics/auth/default/ from django.contrib.auth import authenticate, login def my_view(request): username = request.POST['username'] password = request.POST['password'] user = authenticate(username=username,

Re: can I write Django a client consuming RESTfull api from elsewhere

2015-11-03 Thread kk
On Tuesday 03 November 2015 08:35 PM, Remco Gerlich wrote: Django code is just normal Python. Python can call REST APIs, sure (a nice library is Requests: docs.python-requests.org/en/latest/ ) I got to see this, thanks, had a quick look and it

Re: can I write Django a client consuming RESTfull api from elsewhere

2015-11-03 Thread Remco Gerlich
Django code is just normal Python. Python can call REST APIs, sure (a nice library is Requests: docs.python-requests.org/en/latest/ ) Doing this in the view means that the user has to wait until the request ends before he gets a response. Possibly this will make the view too slow. You could also

Re: How to clean up character database fields with leading and trailing spaces

2015-11-03 Thread DJ-Tom
It worked! Basically it was a one-liner as well :-) -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this

Re: can I write Django a client consuming RESTfull api from elsewhere

2015-11-03 Thread Avraham Serour
you don't need DRF at all, DRF will help you write REST servers if you need to consume you can just use requests ( http://docs.python-requests.org/en/latest/) On Tue, Nov 3, 2015 at 1:44 PM, kk wrote: > Dear all, > I wish to know if I need to do some thing special for

Re: How to clean up character database fields with leading and trailing spaces

2015-11-03 Thread DJ-Tom
Thanks Vijay, since this is a very small application, it uses sqlite 3 as the data backend... according to http://www.sqlite.org/lang_corefunc.html, there is a trim() function in sqlite... so I will check if this works. best Thomas Am Dienstag, 3. November 2015 14:02:52 UTC+1 schrieb Vijay

Re: How to clean up character database fields with leading and trailing spaces

2015-11-03 Thread Vijay Khemlani
As far as I know the Django ORM encapsulates SQL queries, so you can't put arbitrary python code in there (".strip()") If I remember correctly SQL does not have a standard TRIM method, but individual database engines do, for example for Postgres

can I write Django a client consuming RESTfull api from elsewhere

2015-11-03 Thread kk
Dear all, I wish to know if I need to do some thing special for consuming a RESTfull server from some other provider? What should I do in the views? Do I need the complete DRF to do this? Can I do this with just Django's views and then send data across to templates? I mean, can I write views

How to clean up character database fields with leading and trailing spaces

2015-11-03 Thread DJ-Tom
Hi, I have several character fields with leading and trailing spaces and would like to know if it is possible to clean them up with a one-liner... I tried the following but none of this works: rooms.objects.all().update(name=F('name').strip()) // AttributeError: 'F' object has no attribute