Re: HttpResponse.has_header

2013-05-12 Thread Larry Martell
On Sun, May 12, 2013 at 1:07 AM, Masklinn wrote: > On 12 mai 2013, at 05:04, Larry Martell wrote: >> On Sat, May 11, 2013 at 9:08 AM, Masklinn wrote: >>> >>> On 2013-05-11, at 17:01 , Larry Martell wrote: >>> >>>> On Sat, May 11, 2013 at 8:23 AM

Re: HttpResponse.has_header

2013-05-12 Thread Larry Martell
On Sat, May 11, 2013 at 9:04 PM, Larry Martell wrote: > On Sat, May 11, 2013 at 9:08 AM, Masklinn wrote: >> >> On 2013-05-11, at 17:01 , Larry Martell wrote: >> >>> On Sat, May 11, 2013 at 8:23 AM, Masklinn wrote: >>>> On 2013-05-11, at 15:57 , Larry Ma

Re: HttpResponse.has_header

2013-05-14 Thread Larry Martell
On Sat, May 11, 2013 at 9:08 AM, Masklinn wrote: > > On 2013-05-11, at 17:01 , Larry Martell wrote: > >> On Sat, May 11, 2013 at 8:23 AM, Masklinn wrote: >>> On 2013-05-11, at 15:57 , Larry Martell wrote: >>>> >>>> Yes, that is what I did. This is

Getting file list and other paramters

2013-05-15 Thread Larry Martell
I have a form with an upload files button. The form is POSTed so that I can get the file list in HttpRequest.FILES (which is only populated for a POST). But I have other parameters I want to pass back as well (which I cannot do in POST). So I changed it to a GET, but now the list of files is a stri

Re: Getting file list and other paramters

2013-05-15 Thread Larry Martell
On Wed, May 15, 2013 at 9:04 AM, Tom Evans wrote: > On Wed, May 15, 2013 at 3:38 PM, Larry Martell > wrote: >> I have a form with an upload files button. The form is POSTed so that >> I can get the file list in HttpRequest.FILES (which is only populated >> for a

Re: Getting file list and other paramters

2013-05-15 Thread Larry Martell
On Wed, May 15, 2013 at 9:47 AM, Tom Evans wrote: > On Wed, May 15, 2013 at 4:19 PM, Larry Martell > wrote: >> On Wed, May 15, 2013 at 9:04 AM, Tom Evans wrote: >>> On Wed, May 15, 2013 at 3:38 PM, Larry Martell >>> wrote: >>>> I have a form with an

Re: Getting file list and other paramters

2013-05-15 Thread Larry Martell
do that? I googled for it, but did not find any examples. Thanks! > > You should do a POST to reliably upload a file, since various things in the > chain may have restrictions on the length or content of URL path strings. > > Bill > > > On Wed, May 15, 2013 at 11:19 AM, Lar

Re: Getting file list and other paramters

2013-05-15 Thread Larry Martell
On Wed, May 15, 2013 at 11:32 AM, Bill Freeman wrote: > > > > On Wed, May 15, 2013 at 1:09 PM, Larry Martell > wrote: >> >> On Wed, May 15, 2013 at 9:51 AM, Bill Freeman wrote: >> > If you are saying that you have other inputs in the form, and that y

Re: Getting file list and other paramters

2013-05-15 Thread Larry Martell
On Wed, May 15, 2013 at 12:50 PM, Larry Martell wrote: > On Wed, May 15, 2013 at 11:32 AM, Bill Freeman wrote: >>> > If there are other values you want to send that are not form inputs, one >>> > option is to url encode them and add them as query parameters to the &g

Re: Getting file list and other paramters

2013-05-15 Thread Larry Martell
On Wed, May 15, 2013 at 9:47 AM, Tom Evans wrote: > On Wed, May 15, 2013 at 4:19 PM, Larry Martell > wrote: >> On Wed, May 15, 2013 at 9:04 AM, Tom Evans wrote: >>> On Wed, May 15, 2013 at 3:38 PM, Larry Martell >>> wrote: >>>> I have a form with an

Re: Getting file list and other paramters

2013-05-15 Thread Larry Martell
On Wed, May 15, 2013 at 4:44 PM, Larry Martell wrote: > On Wed, May 15, 2013 at 9:47 AM, Tom Evans wrote: >> On Wed, May 15, 2013 at 4:19 PM, Larry Martell >> wrote: >>> On Wed, May 15, 2013 at 9:04 AM, Tom Evans wrote: >>>> On Wed, May 15, 2013 at 3:38 PM,

Re: Getting file list and other paramters

2013-05-16 Thread Larry Martell
On Thu, May 16, 2013 at 2:34 AM, Tom Evans wrote: > On Wed, May 15, 2013 at 6:08 PM, Larry Martell > wrote: >> On Wed, May 15, 2013 at 9:47 AM, Tom Evans wrote: >>> On Wed, May 15, 2013 at 4:19 PM, Larry Martell >>> wrote: >>>> On Wed, May 1

Re: HttpResponse.has_header

2013-05-16 Thread Larry Martell
On Sat, May 11, 2013 at 8:23 AM, Masklinn wrote: > On 2013-05-11, at 15:57 , Larry Martell wrote: >> >> Yes, that is what I did. This is not in my urlconf. It's in a view >> function. I replaced: >> >> return direct_to_template(request, template) >&

Re: HttpResponse.has_header

2013-05-16 Thread Larry Martell
On Thu, May 16, 2013 at 2:37 PM, Masklinn wrote: > > On 2013-05-16, at 22:22 , Larry Martell wrote: > >> On Sat, May 11, 2013 at 8:23 AM, Masklinn wrote: >>> On 2013-05-11, at 15:57 , Larry Martell wrote: >>>> >>>> Yes, that is what I did. This is

Re: HttpResponse.has_header

2013-05-16 Thread Larry Martell
On Thu, May 16, 2013 at 2:59 PM, Masklinn wrote: > > On 2013-05-16, at 22:41 , Larry Martell wrote: > >> On Thu, May 16, 2013 at 2:37 PM, Masklinn wrote: >>> >>> On 2013-05-16, at 22:22 , Larry Martell wrote: >>> >>>> On Sat, May 11, 2013 a

Re: HttpResponse.has_header

2013-05-16 Thread Larry Martell
On Tue, May 14, 2013 at 7:32 AM, Larry Martell wrote: > On Sat, May 11, 2013 at 9:08 AM, Masklinn wrote: >> >> On 2013-05-11, at 17:01 , Larry Martell wrote: >> >>> On Sat, May 11, 2013 at 8:23 AM, Masklinn wrote: >>>> On 2013-05-11, at 15:57 , Larry Ma

Re: access request variable from middlewares into my main project urls

2013-05-21 Thread Larry Martell
On Tue, May 21, 2013 at 6:56 AM, Nikhil Verma wrote: > Hello Guys > > > I want to make the urls dynamic and change according to roles in the project > for every app. > Example if there is role x so it should change like x/manage/view_name() , > if the role is admin the urls will become /admin/man

get django with ftp

2013-06-21 Thread Larry Martell
Is there a ftp site I can download django 1.4 and 1.5 from? Usually I get it from https://www.djangoproject.com/download/1.5.1/tarball/ but now I have to install it on a remote machine that I only have putty access to, so I can't run a browser. -- You received this message because you are subscri

Re: get django with ftp

2013-06-21 Thread Larry Martell
On Fri, Jun 21, 2013 at 6:58 AM, David Markey wrote: > No wget or curl command available? > > wget https://www.djangoproject.com/download/1.5.1/tarball/ -O django.tar.gz > > curl -L https://www.djangoproject.com/download/1.5.1/tarball/ > > django.tar.gz > Thanks! > O

standalone script to call a view

2013-06-28 Thread Larry Martell
I am trying to write a standalone script that calls one of my views. I can call the view, but I'm having a problem with proving what it wants. One of the things the view needs is request.user, and that looks like this: (Pdb) type(request.user) (Pdb) type(request) I'm trying to create the object

Re: standalone script to call a view

2013-06-28 Thread Larry Martell
nd if I go any further down I'll have to duplicate some existing code, which I'd rather not have to do. > On Fri, Jun 28, 2013 at 3:41 PM, Larry Martell > wrote: >> >> I am trying to write a standalone script that calls one of my views. I >> can call the view, bu

Re: standalone script to call a view

2013-06-28 Thread Larry Martell
On Fri, Jun 28, 2013 at 7:47 AM, Javier Guerra Giraldez wrote: > On Fri, Jun 28, 2013 at 8:21 AM, Larry Martell > wrote: >> I don't really understand what you mean by "create a function which is >> be called by view and your script." > > > AFAICT, yo

URL shorteners

2013-07-01 Thread Larry Martell
I'm looking for a URL shortener I can use with my django project. I want to be able to email a short link to someone that will expand to the 'real' URL. Googling I see there's quite a few different URL shorteners. Anyone here have any experiences with them they would like to share? Which one would

Re: URL shorteners

2013-07-01 Thread Larry Martell
g URL and it would return a short one and then if that short URL was used it would redirect to the original long one. But I've already implemented something myself and I have it working. > 2013/7/1 Larry Martell >> >> I'm looking for a URL shortener I can use with my django p

Getting URL root

2013-07-01 Thread Larry Martell
I have an app I distribute to clients. When I run the app on my local machine I connect to http://127.0.0.1/... When I'm VPN-ed into a client site I connect to the app on their machine with http://xx.xx.xx.xx/... When a client is running locally at their site they connect with http://myappsname.co

Re: Getting URL root

2013-07-01 Thread Larry Martell
on't know the URL - I'm not trying to parse it, I need to find out what it is. > On Tue, Jul 2, 2013 at 2:09 AM, Larry Martell > wrote: >> >> I have an app I distribute to clients. >> >> When I run the app on my local machine I connect to http://127.0.0.1/.

Re: Getting URL root

2013-07-02 Thread Larry Martell
oked from a request. > On Tue, Jul 2, 2013 at 8:43 AM, Larry Martell > wrote: >> >> On Mon, Jul 1, 2013 at 7:55 PM, Sithembewena Lloyd Dube >> wrote: >> > It sounds like you want to get the subdomain. Havew a look at the >> > urlparse >> >

Re: Getting URL root

2013-07-02 Thread Larry Martell
On Tue, Jul 2, 2013 at 1:25 AM, Mike Dewhirst wrote: > On 2/07/2013 5:07pm, Larry Martell wrote: >> >> I need to get it from a standalone program. It's a django script, but >> not invoked from a request. > > > import socket > def get_fully_qualified_domai

Re: Getting URL root

2013-07-02 Thread Larry Martell
On Tue, Jul 2, 2013 at 6:06 AM, Mike Dewhirst wrote: > On 2/07/2013 9:51pm, Larry Martell wrote: >> >> On Tue, Jul 2, 2013 at 1:25 AM, Mike Dewhirst >> wrote: >>> >>> On 2/07/2013 5:07pm, Larry Martell wrote: >>>> >>>> >>>

Re: Getting URL root

2013-07-02 Thread Larry Martell
On Tue, Jul 2, 2013 at 6:46 AM, Mike Dewhirst wrote: > On 2/07/2013 4:43pm, Larry Martell wrote: >> >> On Mon, Jul 1, 2013 at 7:55 PM, Sithembewena Lloyd Dube >> wrote: >>> >>> It sounds like you want to get the subdomain. Havew a look at th

Re: Getting URL root

2013-07-02 Thread Larry Martell
On Tue, Jul 2, 2013 at 7:12 AM, Drew Ferguson wrote: > On Tue, 2 Jul 2013 06:13:23 -0600 > Larry Martell wrote: > >> On Tue, Jul 2, 2013 at 6:06 AM, Mike Dewhirst >> wrote: >> > On 2/07/2013 9:51pm, Larry Martell wrote: >> >> >> >> On T

Returning data from view to ajax call

2013-07-02 Thread Larry Martell
I'm invoking a view from an ajax call and I want to return data. But the browser interpertates the return as a 500 (internal sever error) and my ajax success function does not get called. How can I return a successful status (like a 201) and also return data? -- You received this message because

Re: Returning data from view to ajax call

2013-07-02 Thread Larry Martell
my function I first tried returning just the string, but that was causing a 500 error. Then I tried this: return HttpResponse(content=data, content_type="text/plain", status=201) I don't get the error, but the ajax success function does not seem to be called. > > > On We

Re: Returning data from view to ajax call

2013-07-02 Thread Larry Martell
On Tue, Jul 2, 2013 at 4:49 PM, Sanjay Bhangar wrote: > On Tue, Jul 2, 2013 at 3:37 PM, Larry Martell > wrote: >> >> On Tue, Jul 2, 2013 at 4:24 PM, Sithembewena Lloyd Dube >> wrote: >> > What data format is your view returning? Django views return HTTP >&

Re: Returning data from view to ajax call

2013-07-02 Thread Larry Martell
On Tue, Jul 2, 2013 at 5:14 PM, Sanjay Bhangar wrote: > On Tue, Jul 2, 2013 at 4:01 PM, Larry Martell > wrote: >> >> >> >> In the browser the response has this: >> >> HTTP/1.0 200 OK >> Date: Tue, 02 Jul 2013 22:53:47 GMT >> Server: WSGIS

Re: Returning data from view to ajax call

2013-07-02 Thread Larry Martell
On Tue, Jul 2, 2013 at 5:24 PM, Sanjay Bhangar wrote: > On Tue, Jul 2, 2013 at 4:20 PM, Larry Martell > wrote: >> >> On Tue, Jul 2, 2013 at 5:14 PM, Sanjay Bhangar >> wrote: >> > On Tue, Jul 2, 2013 at 4:01 PM, Larry Martell >> > wrote: >> >&

Re: Returning data from view to ajax call

2013-07-03 Thread Larry Martell
On Tue, Jul 2, 2013 at 5:39 PM, Larry Martell wrote: > On Tue, Jul 2, 2013 at 5:24 PM, Sanjay Bhangar > wrote: >> On Tue, Jul 2, 2013 at 4:20 PM, Larry Martell >> wrote: >>> >>> On Tue, Jul 2, 2013 at 5:14 PM, Sanjay Bhangar >>> wrote: >&g

Re: Returning data from view to ajax call

2013-07-03 Thread Larry Martell
em) I don't want to return a template, just some data. I tried this: return render_to_string(simplejson.dumps(data)) But it blows up with template not found. > On Wednesday, July 3, 2013 8:14:06 AM UTC-5, larry@gmail.com wrote: >> >> On Tue, Jul 2, 2013 at 5:39 PM, L

Re: Returning data from view to ajax call

2013-07-03 Thread Larry Martell
ng bypasses the headers, render to response will >> > include them) >> >> I don't want to return a template, just some data. I tried this: >> >> return render_to_string(simplejson.dumps(data)) >> >> But it blows up with template not found. &g

testing

2013-07-04 Thread Larry Martell
I'm just getting involved with setting up testing using the django testing facilities, and I have a couple of questions. If I do this from the django shell: $ python manage.py shell Python 2.7.2 (default, Oct 11 2012, 20:14:37) [GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on

Re: testing

2013-07-05 Thread Larry Martell
On Fri, Jul 5, 2013 at 6:38 AM, Ramiro Morales wrote: > On Thu, Jul 4, 2013 at 8:42 PM, Larry Martell wrote: >> >> I'm just getting involved with setting up testing using the django >> testing facilities, and I have a couple of questions. >> >> If I do this

Re: model relationship

2013-07-05 Thread Larry Martell
On Fri, Jul 5, 2013 at 7:44 AM, Kakar Arunachal Service wrote: > Hello, > Please guide me in model relationship. When to use many to many, many to > one, one to one relationships??? I'm all confused. > Thank you. http://www.datanamic.com/support/lt-dez005-introduction-db-modeling.html and many,

unit testing

2013-07-07 Thread Larry Martell
Just getting started with django unit testing. I created a very simple test, just to see how things work. Here is my test: from django.test import TestCase fixtures = ['auth_user', 'auth_permission', 'data_cst'] class MeasDataTest(TestCase): def test_MeasDate(self): # login r

Re: unit testing

2013-07-07 Thread Larry Martell
On Sun, Jul 7, 2013 at 7:22 PM, Larry Martell wrote: > Just getting started with django unit testing. I created a very simple > test, just to see how things work. Here is my test: > > from django.test import TestCase > > fixtures = ['auth_user', 'auth_p

Re: unit testing

2013-07-08 Thread Larry Martell
On Sun, Jul 7, 2013 at 10:05 PM, Javier Guerra Giraldez wrote: > On Sun, Jul 7, 2013 at 10:47 PM, Larry Martell > wrote: >> MeasDataTest is declared as: >> >> class MeasDataTest(TestCase): >> >> Why do I get "does not refer to a test"? > &g

Re: Django 1.5 runserver hangs in Chrome

2013-07-08 Thread Larry Martell
On Mon, Jul 8, 2013 at 5:00 AM, Sven Bröckling wrote: > Hi, > > Chrome sometimes does really strange things. I use chrome with a disabled > cache for development (Open Developer Tools, click on the settings menu, > first option) which resolves this kind of problems for me. I'm frequently emptying

Re: unit testing

2013-07-08 Thread Larry Martell
On Mon, Jul 8, 2013 at 8:59 AM, wrote: > > > On Monday, July 8, 2013 7:49:53 AM UTC-4, larry@gmail.com wrote: >> >> >> >> Ah, I missed that in the docs. Thanks. When I renamed it to tests.py >> it got picked up. >> >> But in the django/contrib dirs (e.g. django/contrib/auth) the tests >> are

Re: Django 1.5 runserver hangs in Chrome

2013-07-08 Thread Larry Martell
On Mon, Jul 8, 2013 at 9:16 AM, François Schiettecatte wrote: > Its the little gear at the bottom right, took me a while to find it. Got it! Thanks! > On Jul 8, 2013, at 11:10 AM, Larry Martell wrote: > >> On Mon, Jul 8, 2013 at 5:00 AM, Sven Bröckling wrote: >>> Hi,

Re: unit testing

2013-07-08 Thread Larry Martell
On Mon, Jul 8, 2013 at 9:36 AM, Javier Guerra Giraldez wrote: > On Mon, Jul 8, 2013 at 10:13 AM, Larry Martell > wrote: >> I had seen the __init__ but I thought the tests had to be in the same >> dir as the models file. > > > the tests _module_ has to be in the sa

Re: How to download the table generated in html as a file

2013-07-08 Thread Larry Martell
On Mon, Jul 8, 2013 at 10:30 AM, sahitya pavurala wrote: > > Hi , > > > I am new to Django and I would be glad if i can get help on this . > > I am generating a html page where i get a table containing fields and values > of a database . > I want to download this table as a file (preferably as an

Re: How to download the table generated in html as a file

2013-07-08 Thread Larry Martell
On Mon, Jul 8, 2013 at 11:10 AM, sahitya pavurala wrote: > Hi , > > Can you specify from where am i getting the data here . > Should I have to retrieve the data again from the database . > > my view function has this code : > if Mice.objects.filter(pk=item).exists() == False: >

more testing questions

2013-07-08 Thread Larry Martell
Still working on getting my tests to run. I have 2 issues right now: 1) I want to load data from fixture files. In this case I am trying to load auth data to test the logins. I have this in my test code: from django.test import TestCase from django.contrib.auth.models import User, Permission cla

Re: Unable to do import django

2013-07-08 Thread Larry Martell
On Mon, Jul 8, 2013 at 12:10 PM, Yves S. Garret wrote: > I've gone through the entire django install steps and when I fired up my > Python shell > (python 2.7.5, to be exact) and did import django, this is what I got: > import django > Traceback (most recent call last): > File "", line 1, i

Re: Unable to do import django

2013-07-08 Thread Larry Martell
On Mon, Jul 8, 2013 at 2:00 PM, Yves S. Garret wrote: > On Monday, July 8, 2013 2:28:58 PM UTC-4, larry@gmail.com wrote: >> >> On Mon, Jul 8, 2013 at 12:10 PM, Yves S. Garret >> wrote: >> > I've gone through the entire django install steps and when I fired up my >> > Python shell >> > (python

Re: Unable to do import django

2013-07-08 Thread Larry Martell
On Mon, Jul 8, 2013 at 2:31 PM, Yves S. Garret wrote: > On Monday, July 8, 2013 4:03:12 PM UTC-4, larry@gmail.com wrote: >> >> On Mon, Jul 8, 2013 at 2:00 PM, Yves S. Garret >> wrote: >> > On Monday, July 8, 2013 2:28:58 PM UTC-4, larry@gmail.com wrote: >> >> >> >> On Mon, Jul 8, 2013 at

Re: Unable to do import django

2013-07-08 Thread Larry Martell
On Mon, Jul 8, 2013 at 2:34 PM, Yves S. Garret wrote: > On Monday, July 8, 2013 4:31:47 PM UTC-4, Yves S. Garret wrote: >> >> On Monday, July 8, 2013 4:03:12 PM UTC-4, larry@gmail.com wrote: >>> >>> On Mon, Jul 8, 2013 at 2:00 PM, Yves S. Garret >>> wrote: >>> > On Monday, July 8, 2013 2:28:5

Re: more testing questions

2013-07-08 Thread Larry Martell
On Mon, Jul 8, 2013 at 12:06 PM, Larry Martell wrote: > Still working on getting my tests to run. I have 2 issues right now: > > 1) I want to load data from fixture files. In this case I am trying to > load auth data to test the logins. I have this in my test code: > > from

Re: more testing questions

2013-07-08 Thread Larry Martell
On Mon, Jul 8, 2013 at 4:21 PM, Javier Guerra Giraldez wrote: > On Mon, Jul 8, 2013 at 4:14 PM, Larry Martell wrote: >> It appesars it's trying to add a row to django_content_type and it's >> already there. I tried not loading the fixture for django_content_type &g

Re: Error in return the view (The view did not return an HttpResponse object)

2013-07-11 Thread Larry Martell
On Thu, Jul 11, 2013 at 5:23 AM, Hélio Miranda wrote: > Good. > I have the following view: > def characValue(request, name): > if request.method == 'POST': > charac = CharacteristicsValue.objects(name=name) > val = [] > for aa in charac: > val.append(aa.valu

client side tests

2013-07-15 Thread Larry Martell
There's no way, using the django unit tests, to effect something client side, is there? For example, in one of my django apps the user can filter the data on the client side. This is done with javascript. Using the unit tests, there doesn't seem to be a way I emulate that for testing. How do folks

Re: client side tests

2013-07-15 Thread Larry Martell
unctional testing with selenium. >> >> Sent from my iPhone >> >> On Jul 15, 2013, at 4:00 AM, Larry Martell >> wrote: >> >> > There's no way, using the django unit tests, to effect something >> > client side, is there? >> > >&g

Re: django templates

2013-07-17 Thread Larry Martell
On Wed, Jul 17, 2013 at 8:34 AM, Harjot Mann wrote: > On Wed, Jul 17, 2013 at 6:46 PM, Derek wrote: >> One option is to use a Django admin action - the user selects which job/jobs >> are needed from the usual list - >> and your action can then generate the data, passing this into a single >> "mas

Re: 'LIKE' statement in Model.objects.raw() with percentage '%'

2013-07-17 Thread Larry Martell
On Wed, Jul 17, 2013 at 9:28 AM, spondbob squelpen wrote: > sorry i'm new with django, could u please tell me how to use the debugger? In your python code, add this "import pdb; pdb.set_trace()' at the place you want the breakpoint. Then run: python manage.py runserver Then go to your web page

Re: 'LIKE' statement in Model.objects.raw() with percentage '%'

2013-07-17 Thread Larry Martell
On Wed, Jul 17, 2013 at 8:24 AM, spondbob squelpen wrote: > I have problem in django using query statement "like %s%" with > Model.objects.raw(). I guess the problem is on '%' character but i don't > know where is it. Here's my model's code: > > def listInRange(self, placeLat, placeLng, typeId

Re: 'LIKE' statement in Model.objects.raw() with percentage '%'

2013-07-17 Thread Larry Martell
On Wed, Jul 17, 2013 at 8:58 AM, spondbob squelpen wrote: > where do i put those double percentage? like this? > tags = " AND (placeTag LIKE '%%" + "%%' OR placeTag LIKE > '%%".join(placeTag.split(',')) + "%%')" > > but still got the same error: > Warning: Truncated incorrect DOUBLE value: '1 AND

Re: 'LIKE' statement in Model.objects.raw() with percentage '%'

2013-07-17 Thread Larry Martell
On Wed, Jul 17, 2013 at 9:15 AM, spondbob squelpen wrote: > the '1' is coming from typeId, so the WHERE condition must be look like: > WHERE placeType_id=1 AND (placeTag LIKE '%test%') > > print out tags: > AND (placeTag LIKE '%test%') > > i have tried your solution by adding double percentage b

Re: new field in models

2013-07-22 Thread Larry Martell
On Mon, Jul 22, 2013 at 1:53 AM, Harjot Mann wrote: > In django when we add a new field in existing class, we need to drop > the table and then run the syncdb again. Is there any alternative for > it so that we can add the field without dropping the table?? Use alter table: http://dev.mysql.com/

Upgrading to 1.5 on Centos

2013-07-31 Thread Larry Martell
On my Mac, running python 2.7, I upgraded from 1.4 to 1.5 by doing this: rm -rf /Library/Python/2.7/site-packages/django Followed by python setup.py install in the dir I untar-ed Django-1.5.1 to. This all worked fine. On a Centos system running python 2.6 I did: rm -rf /usr/lib/python2.6/site-

Re: How template tag can receive values JS

2013-08-01 Thread Larry Martell
On Thu, Aug 1, 2013 at 6:48 AM, Mário Idival wrote: > Good morning everyone, > I wonder how I can do (and if it is possible), pass a value of javascript > variable to a template tag Django. > > eg > how it works: > {{Document.id | split_filter}} -> split_filter is just a random method, > receives

Re: Upgrading to 1.5 on Centos

2013-08-01 Thread Larry Martell
On Thu, Aug 1, 2013 at 2:30 AM, Branko Majic wrote: > On Wed, 31 Jul 2013 17:59:56 -0600 > Larry Martell wrote: > >> On my Mac, running python 2.7, I upgraded from 1.4 to 1.5 by doing this: >> >> rm -rf /Library/Python/2.7/site-packages/django >> >> Followe

Re: Upgrading to 1.5 on Centos

2013-08-01 Thread Larry Martell
On Thu, Aug 1, 2013 at 8:41 AM, Tom Evans wrote: > On Thu, Aug 1, 2013 at 3:17 PM, Larry Martell wrote: >> On Thu, Aug 1, 2013 at 2:30 AM, Branko Majic wrote: >>> On Wed, 31 Jul 2013 17:59:56 -0600 >>> Larry Martell wrote: >>> >>>> On my Mac, r

Re: Upgrading to 1.5 on Centos

2013-08-01 Thread Larry Martell
On Thu, Aug 1, 2013 at 9:27 AM, Tom Evans wrote: > On Thu, Aug 1, 2013 at 4:10 PM, Larry Martell wrote: >> Thanks very much Tom. This explains a lot - we were using the 1.3 >> manage file with 1.4. I'm very close now, but I'm not sure what to put >> in for proj

Re: Django installation on vanilla Mac OSX 10.8.2 mountain lion

2013-08-02 Thread Larry Martell
On Fri, Aug 2, 2013 at 8:41 AM, Sithembewena Lloyd Dube wrote: > Hi everyone, > > I just began using a new Mac at work (running OSX 10.8.2 Mountain Lion) and > it seems such a mission to install Django. Python 2.7.2. is already > installed. Following the official Django installation instructions,

connecting to MS SQL server in addition to default MySQL

2013-08-07 Thread Larry Martell
I have a django app that connects to a MySQL server in the usual way. I've noe been asked to add some new functionality that requires that I pull data from a MS SQL server database running on a Windows box. I don't want to use the django ORM with the db, just access it directly with some sql in my

Re: connecting to MS SQL server in addition to default MySQL

2013-08-08 Thread Larry Martell
I just have read-only access to the MS SQL server database. I can't install anything on the Windows box. So all I can do is execute sql queries against it. On Thu, Aug 8, 2013 at 9:19 AM, Michael Manfre wrote: > Any particular reason you want to completely avoid the ORM? My main project > that u

Re: connecting to MS SQL server in addition to default MySQL

2013-08-09 Thread Larry Martell
On Friday, August 9, 2013, Javier Guerra Giraldez wrote: > On Thu, Aug 8, 2013 at 9:22 PM, Larry Martell > > > wrote: > > So all I can do is execute sql > > queries against it. > > > good news: that's all the ORM needs. :-) Don't I need a models f

Re: connecting to MS SQL server in addition to default MySQL

2013-08-09 Thread Larry Martell
On Friday, August 9, 2013, Javier Guerra Giraldez wrote: > On Fri, Aug 9, 2013 at 8:53 AM, Larry Martell > > > wrote: > > On Friday, August 9, 2013, Javier Guerra Giraldez wrote: > >> > >> On Thu, Aug 8, 2013 at 9:22 PM, Larry Martell > >> > >

Live server tests from cron

2013-08-10 Thread Larry Martell
I have some tests that use LiveServerTestCase and selenium. When I run them from the command line they work fine. But I want to run them from cron. I know I need to use pyvirtualdisplay, but I can't seem to get it to work. I have this in my test: from pyvirtualdisplay import Display @classme

Re: connecting to MS SQL server in addition to default MySQL

2013-08-11 Thread Larry Martell
g/en/latest/ > [1] https://docs.djangoproject.com/en/dev/topics/db/sql/ > [2] > https://docs.djangoproject.com/en/dev/topics/db/sql/#executing-custom-sql-directlyget Does django-mssql work on linux and Macs? It says it needs PyWin32. > > > On Wed, Aug 7, 2013 at 2:42 PM, Larry Martell > w

Re: upgrading to 1.5.1

2013-08-18 Thread Larry Martell
On Sun, Aug 18, 2013 at 2:51 AM, Harjot Mann wrote: > Hello Everyone > Currently I am using django version 1.4.5 and I want to upgrade it to > 1.5.1, I have an app in django. I want to know that what problems will > I face while upgrading to that version. I have no idea about the > features of new

Re: Test using different database

2013-09-08 Thread Larry Martell
On Fri, Jul 26, 2013 at 7:45 AM, Antony wrote: > Hi, > > I have two databases on my settings file. One is sqlite and the other is > postgis. It is a big project so some developers use sqllite and a few are > using postgis. > Now, when I try ./manage.py test command, I get the following, > > --

Loading all js and css at login

2013-10-01 Thread Larry Martell
I would like to load all the javascript and css files that my app needs when the user logs in. So I added lines like this to my login.html: But when I go the pages that need these (that used to include them in their templates), they don't seem to be available. I don't get any errors, but it's

Re: Loading all js and css at login

2013-10-01 Thread Larry Martell
rowser can realize it has that > CSS, JS, etc, cached, rather than downloading it again. > > > On Tue, Oct 1, 2013 at 11:08 AM, Larry Martell wrote: > >> I would like to load all the javascript and css files that my app needs >> when the user logs in. So I added lines like

Re: Django data to Javascript

2013-10-15 Thread Larry Martell
On Tue, Oct 15, 2013 at 6:46 AM, drakko wrote: > Hello! > > I'm new to Django and Javascript and so I need some help with passing list > from django template to Javascript. > > The list is available in template (template.html) by using > > {% for shbf in should_have_found_list %} > > > but I have

Re: Django data to Javascript

2013-10-15 Thread Larry Martell
On Tue, Oct 15, 2013 at 9:54 AM, Scot Hacker wrote: > > > On Tuesday, October 15, 2013 8:45:09 AM UTC-7, larry@gmail.com wrote: >> >> >>> >> You can embed js anywhere in your template, e.g.: >> >> {% for shbf in should_have_found_list %} >> >> my_js_function(shbf); >> >> {%

Re: Can not connect to MySQL

2013-10-17 Thread Larry Martell
On Thu, Oct 17, 2013 at 1:47 PM, wrote: > Hi, I am new to Django and try to connect to database MySQL I get this > message: Can anyone help? thanks in advance. > > Unhandled exception in thread started by of at 0x3026810>> > Traceback (most recent call last): > File > "/home/tee/django-tee/lo

Re: Django Game Development?

2013-11-13 Thread Larry Martell
On Wed, Nov 13, 2013 at 2:05 PM, Eamonn Rea wrote: > > Oh, and one more thing: How do you pronounce Django? Is it just pronounced > 'Jango', or "D Jango"? I've always pronounced it 'D Jango', but I've heard > some people pronounce it 'Jango'. Is there any special meaning behind the > name 'Django

Re: Django/Web Programming Pattern

2013-11-14 Thread Larry Martell
On Thu, Nov 14, 2013 at 9:37 AM, Timothy W. Cook wrote: > Well, this isn't likely a Django specific question but since this > project is built in Django, I'd like to know how best to handle this > issue. > > I have a view that calls a function and performs a long running > process. It reads and

SECURE_PROXY_SSL_HEADER requires referer

2015-01-17 Thread Larry Martell
We have a django app accessed via SSL (i.e. with https). When we went to the admin site and it was redirected to admin/login/?next=/admin/ because we were not logged in, the https was not carried over and the request failed. I added SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https') t

Re: SECURE_PROXY_SSL_HEADER requires referer

2015-01-19 Thread Larry Martell
On Sat, Jan 17, 2015 at 10:03 AM, Larry Martell wrote: > We have a django app accessed via SSL (i.e. with https). When we went > to the admin site and it was redirected to admin/login/?next=/admin/ > because we were not logged in, the https was not carried over and the > request fai

Downloading thumbnails and replacing them with full images

2015-01-23 Thread Larry Martell
I have a django app that downloads 100's of images. To increase the performance, I want to change it so that it downloads thumbnails, and when the user clicks on one then download the full image. I'm sure I can come up with something on my own (send an ajax request on click, etc.) but I was wonder

Re: Downloading thumbnails and replacing them with full images

2015-01-24 Thread Larry Martell
On Fri, Jan 23, 2015 at 7:44 PM, Russell Keith-Magee wrote: > > On Sat, Jan 24, 2015 at 12:20 AM, Larry Martell > wrote: >> >> I have a django app that downloads 100's of images. To increase the >> performance, I want to change it so that it downloads thumbnails

Re: CSRF verification failed. Request aborted.

2015-01-24 Thread Larry Martell
On Sat, Jan 24, 2015 at 2:51 PM, Cornelio Royer Climent wrote: > HI. SOMEBODY COULD YOU HELP WITH THIS ERROR? > > I THINEK THAT I SAW EVERYTHING, BUT I DON'T FIND THE ERROR . > > > > > {{ words.english }} > > > {% if error_message %}{{ error_message }}{% endif %} > > > > {% csrf_token %} > > >

Tests and temp tables

2015-02-03 Thread Larry Martell
I have a django app that uses a temp table. In the real world this is no issue, as each invocation of the app runs in its own MySQL session so there cannot be any conflict with the temp tables. But in my tests there are multiple requests sent, and apparently they are all in the same session, as on

Re: Tests and temp tables

2015-02-05 Thread Larry Martell
On Thu, Feb 5, 2015 at 7:29 AM, Jani Tiainen wrote: > On Tue, 3 Feb 2015 19:38:31 -0500 > Larry Martell wrote: > >> I have a django app that uses a temp table. In the real world this is >> no issue, as each invocation of the app runs in its own MySQL session >> so t

Re: Tests and temp tables

2015-02-05 Thread Larry Martell
On Thu, Feb 5, 2015 at 10:53 AM, Carl Meyer wrote: > Hi Larry, > > On 02/05/2015 06:57 AM, Larry Martell wrote: >> On Thu, Feb 5, 2015 at 7:29 AM, Jani Tiainen wrote: >>> On Tue, 3 Feb 2015 19:38:31 -0500 >>> Larry Martell wrote: >>> >>>> I

Re: how to access json data value(s) returned back to django view from 'GET' request to an api

2015-02-05 Thread Larry Martell
On Thu, Feb 5, 2015 at 2:10 PM, Henry Versemann wrote: > I have a django view (django v. 1.7 ; python v. 2.7.8) which currently and > successfully sends a request to an api, and receives a good response back. > I'm sending and receiving using the 'requests' library (v. 2.4.3). Now in > addition to

Re: Tests and temp tables

2015-02-05 Thread Larry Martell
On Thu, Feb 5, 2015 at 3:16 PM, Carl Meyer wrote: > On 02/05/2015 11:20 AM, Larry Martell wrote: >> On Thu, Feb 5, 2015 at 10:53 AM, Carl Meyer wrote: >>> TransactionTestCase has been around for quite a long time (since 1.1, >>> IIRC). It's definitely in 1.5. &

admin shows `model name` object instead of values for foreign key fields

2015-02-06 Thread Larry Martell
I have a 1.7 app, and in admin when I reference a foreign key field, instead of showing the values in the drop down, it shows "`model name` object": [image: Inline image 2] This does not happen in 1.5 (in a different app). Here are my models: class IPGroups(models.Model): groupName = models.

Re: admin shows `model name` object instead of values for foreign key fields

2015-02-06 Thread Larry Martell
On Fri, Feb 6, 2015 at 4:06 PM, Daniel Roseman wrote: > On Friday, 6 February 2015 20:30:02 UTC, larry@gmail.com wrote: >> >> I have a 1.7 app, and in admin when I reference a foreign key field, >> instead of showing the values in the drop down, it shows "`model name` >> object": >> >> > >> H

<    1   2   3   4   5   6   >