RE: Best Practice for Raw SQL

2011-04-13 Thread Sells, Fred
om Subject: Re: Best Practice for Raw SQL On Wed, Apr 13, 2011 at 1:38 PM, Sells, Fred wrote: In my case I had to read some legacy data from a different schema on the same MySQL server and it was easy (but perhaps not elegant) to just establish a separate connection using MySQLdb modul

RE: Please Help a django Beginner!

2011-04-19 Thread Sells, Fred
I received this helpful hint from Shawn M. when faced with the same issue: import os os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings' #whereever your settings.py is located. >From the docs: http://docs.djangoproject.com/en/dev/topics/settings/ -Original Message- From: django

RE: This section is converting database table to excel file

2011-04-28 Thread Sells, Fred
Since Excel will import a csv file, why not just write a csv file. In mysql, while ugly, you could shell down and use the mysql command line options to export a query to csv. From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Od-Erdene Ch Sent: Thursday,

json serialization question

2011-05-24 Thread Sells, Fred
I'm using AJAX, jquery and JSON for the first time, having used templates to render XML for Flex/Flash in all my previous Django work. My code looks like this records = models.Residents.objects.extra( where=[], params=[...]) data = serializers.serialize('json', records, ensure_ascii=False, fie

RE: Django and Rich Client

2011-06-09 Thread Sells, Fred
FWIW I use flex for the rich client and get xml out of django which flex handles nicely. I use Ldap for Authorization (had to use legacy junk for authentication to be compliant) and I have a cron job that loads the ldap groups I need and there members into my db. Solves speed and reliability pro

RE: Django for a front end designer

2011-08-03 Thread Sells, Fred
I had to learn basic Php for a class. It's worth it to subscribe to Lynda.com for a few months to get their online training videos. Removes much pain. Like all training, it covers the basics and you really don't know what you don't know until you try to do something. -Original Message-

RE: Run an application periodically on django

2011-08-04 Thread Sells, Fred
You can run a django module directly if you do something like: if __name__ == '__main__': sys.path.append( '/all/projects/one-up-from-site directory) #may not be needed in all cases. os.environ['DJANGO_SETTINGS_MODULE'] = 'mds30.settings' The problem I just encountered using

RE: Django for a front end designer

2011-08-05 Thread Sells, Fred
I think many of the members of this group have a pro-python bias for a good reason. Most of us have had to work with many other frameworks and languages and Python is the only one I would use to "unwind". Sometimes it's worth "paying your dues" -- You received this message because you are subsc

RE: The Django-CMS 2.1 Release Candidate 1 has been released!

2010-12-25 Thread Sells, Fred
Are there any example sites running this? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.co

RE: RE: The Django-CMS 2.1 Release Candidate 1 has been released!

2010-12-26 Thread Sells, Fred
Thanks. From: django-users@googlegroups.com [mailto:django-us...@googlegroups.com] On Behalf Of Jonas Obrist Sent: Sunday, December 26, 2010 5:29 AM To: django-users@googlegroups.com Subject: Re: RE: The Django-CMS 2.1 Release Candidate 1 has been released! Hi fred There's a lot of site

RE: an error happened to apache2and wsgi

2011-01-06 Thread Sells, Fred
I've seen similar errors if I left in print >>sys.stderr statements, although that was using mod_python. From: django-users@googlegroups.com [mailto:django-us...@googlegroups.com] On Behalf Of Graham Dumpleton Sent: Thursday, January 06, 2011 2:23 AM To: django-users@googlegroups.com Subject:

RE: ReportLab and Django - templates? ; FK object has no attribute split

2011-01-07 Thread Sells, Fred
Depending on what you need to do You could shell down and run FOP from Apache foundation which is xml, xslt to pdf Or if you are filling in a form, you can use Adobe LiveCycle to define a form and use code like below to fill in the form def getPDFContent(id): values = getAllValues(id)

using Django from cron

2011-03-10 Thread Sells, Fred
I'm sure the solution is out there somewhere, but my google search is giving me too many false positives. I have a stand along python program that will be run as a cron job and I don't know how to launch it so it picks up the django settings, etc. I can run it like this >python manage.py shell >

RE: using Django from cron

2011-03-16 Thread Sells, Fred
Thanks to all who responded and especially Shawn who said much the same thing in a way I could grasp. ... import os os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings' >From the docs: http://docs.djangoproject.com/en/dev/topics/settings/ Shawn -- You received this message because you

user confused with select_related and a one_to_one field

2011-03-16 Thread Sells, Fred
I'm using python 2.4 and django 1.2.4 with MySQL 5.0 FWIW I have the following models (code deleted to simplify) class Message(models.Model): facility= models.CharField(max_length=2, null=True, blank=True) msgtype = models.CharField(max_length=3) class Pv(models.Model): mess

deploying flex and django

2011-03-21 Thread Sells, Fred
I would appreciate some guidelines on a better way to deploy a flex/flash frontend with a django backend. I've got flex and django working nicely using the Flex HTTPService and XML and the message content. Probably not as efficient as other methods but this is an intratnet and performance is not

RE: Django on EC2

2011-03-22 Thread Sells, Fred
I'm using a redhat enterprise 6 and all these are standard or available as standard installs. -Original Message- From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Eric Chamberlain Sent: Tuesday, March 22, 2011 12:31 PM To: django-users@googlegroups.com

RE: Django on Windows 7

2011-03-22 Thread Sells, Fred
It's painless. I'm no sysadmin but I just followed the instructions and everything worked. I'm even using python 2.4 due to some outside issues. -Original Message- From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Vladimir Sent: Tuesday, March 22, 20

RE: Implementing a ldap db backend

2011-03-22 Thread Sells, Fred
I'm using my own auth and ldap via python-ldap as a query only; others maintain it. My only issue is that of response. I query all the groups I care about and get all their members and keep that in a MySQL db that I refresh every 5 minutes of an unrelated cron job. From: django-users@googl

RE: Rewriting Java UI for Django?

2011-03-25 Thread Sells, Fred
I also have made the conversion from Java/Swing/Webapp(jnlp) to Django, but I used Flex (a.k.a. Flash) for my UI because I've got a rich client background and did not want to deal with Browser inconsistencies. I'm happy with that choice. I use a very simple django template to render a very consi

RE: How to run a file.py in the django environement

2011-03-28 Thread Sells, Fred
It was explained very clearly to me, I believe by shawn, but I've lost the original reference. If the file you want to run is in your django app directory you just need import datetime, sys, os, logging os.environ['DJANGO_SETTINGS_MODULE'] = 'YourDirectoryThatContainsTheSettingsModule.settings

wsgi config question

2011-03-29 Thread Sells, Fred
I'm just converting from mod_python to mod_wsgi and making progress. I would like to be able to deploy multiple independent webapps without having to edit the apache configs each time. I'm thinking of something like /var/www/wsgi-scripts App1.wsgi App2.wsgi

noobie cannot get mod_wsgi to import settings

2011-03-30 Thread Sells, Fred
I've been googling and trying this for 2 days now, I'm sure I'm just confused about something basic because it cannot be that hard. I've tried all the hints I found via google and they made sense but no success. I'm running RHEL 6 Python 2.6.5, django 1.2.4 and mod_wsgi 3.2. I'm trying to config

RE: Django IDE : how to start the devserver in an editor?

2011-03-30 Thread Sells, Fred
Using eclipse you can create a run configuration that starts the dbserver and it will auto-reload whenever you change a file. Of course since the dbserver auto restarts when it detects a file change, the command line is not all that bad. -Original Message- From: django-users@googlegroups.

RE: staticfile app question

2011-03-30 Thread Sells, Fred
This may be using a canon to swat a fly, but... I had a project some time ago where I needed a very repetitive java/swing UI. I ended up creating python classes that had a __repr__ method that generated the java source code. Then I was able to have very concise python files that instantiated the

RE: Advice: project hosting apps

2011-04-04 Thread Sells, Fred
I've seen a lot of chatter about Eclipse mylyn which can be integrated with trak. Not used it however. -Original Message- From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Javier Guerra Giraldez Sent: Monday, April 04, 2011 10:21 AM To: django-users@g

RE: [Suspected Spam] Django app for data management and visualization

2011-04-05 Thread Sells, Fred
There are guys in this group who are much more sophisticated meta programmers than I. But here's a very simple method: It is easiest if each unique module has the same class name, such as "class Controller:" Then define and import all your plugins (does not allow uploading plugin, but that's ris

RE: LDAP and 1.2

2011-04-05 Thread Sells, Fred
Because our active directory contains many more users than are allowed to use my django app, I have a cron job that runs every 5 minutes and updates a mysql database with the subset I care about. That way if AD is offline at the time, I'm not hosed. From: django-users@googlegroups.com [mailto:

RE: [Suspected Spam] mysql problems after upgrading to django 1.3

2011-04-10 Thread Sells, Fred
Try mysql from the command line, make sure the service is running. Sometimes the install does not set it up to start on a reboot. Make sure you did not specify the port (socket) either when you installed or in django -- usually it's 3306 on a pc, don't know about mac. -Original Message- F

Integration with Legacy DB

2015-01-14 Thread Sells, Fred
Although I have not tried it, the docs are pretty clear about how to sync a django model to an existing legacy DB (sqlserver08 in this case). But is there a way to sync to a select statement with multi-table joins without first creating a View? I know that creating a view would be easiest, but

centos 6 python 2.6 django 1.7 install problem

2014-10-14 Thread Sells, Fred
Downloaded the gz file, unzipped and ran python setup.py install Note, due to network security settings, I cannot use pip or any similar tool that needs external web access I get the following errors, any advice on how to fix? …snip…. creating /usr/lib/python2.6/site-packages/Django-1.7-py

need django.cache advice

2014-01-09 Thread Sells, Fred
I've got a queryset that is ~ a 6 table join of a lot of data that generates about 1000 records with about 25 fields each I've got ~100 terminals hitting this query every 1 minute looking for a subset of 25 records ~20 records change every minute I was thinking about updating the data (queryse

RE: need django.cache advice

2014-01-09 Thread Sells, Fred
Thanks Erick, I was not aware of Varnish. Erik wrote: 1000 records from 6 tables shouldn't be a problem if your database is properly indexed. Databases are good at caching query results and not doing excess work when the data hasn't changed. Maybe the first request from a terminal will be slow

RE: need django.cache advice

2014-01-09 Thread Sells, Fred
bject: Re: need django.cache advice On Thu, Jan 9, 2014 at 4:43 PM, Sells, Fred wrote: > > Fred: I was unclear. The initial join is 1 x 1000 x 20 x 100 ... which > gets reduced to about 1000 records. A few records are changed every second. are the 'interesting' 1000 out-re

big legacy database with complex many to many relationships

2014-02-24 Thread Sells, Fred
I have to integrate to a large read only legacy mssql database . The many-to-many tables have a lot of additional fields like start/end dates of the relationship and their own naming conventions Can anyone point me to some links that treat this topic in depth. I've looked at the django book an

RE: big legacy database with complex many to many relationships

2014-02-24 Thread Sells, Fred
database with complex many to many relationships On Mon, Feb 24, 2014 at 2:54 PM, Sells, Fred wrote: > I have to integrate to a large read only legacy mssql database . while certainly it's possible to configure this as a second database and use the ORM, I've found that it's more

RE: [ELI5] how to deploy django

2014-03-18 Thread Sells, Fred
The latest “Two Scoops of Django” book claims to have good info on deploying; I’ve not read it yet. From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Walter Wang Sent: Tuesday, March 04, 2014 11:54 AM To: django-users@googlegroups.com Subject: Re: [ELI5] how

<    1   2