Re: I need to get psycopg2 installed on Mac OS X 10.5

2009-07-28 Thread William Siegrist


On Jul 27, 2009, at 11:07 PM, Kevin wrote:

>
> I have gotten psycopg2 to compile though in a roundabout way.  I have
> tried to compile Python from source and got other errors.  Although I
> already had Xcode installed, I decided that it couldn't hurt to
> reinstall it and see what happens.  After doing so, I was able to
> compile Python without any problems; go figure =).  Then using my new
> install of Python and exporting the path to PostgreSQL, compiling
> psycopg2 went smoothly.



If you don't mind an extra copy of python being built/installed, its  
very easy to install postgres and psycopg2 via MacPorts.

http://macports.org/

-Bill


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Help filter with Admin

2008-02-03 Thread William Siegrist

Have you tried using the IN filter?

Student.objects.filter(school__in = [A, B])


http://www.djangoproject.com/documentation/db-api/#in


-Bill


On Feb 3, 2008, at 1:41 PM, [EMAIL PROTECTED] wrote:



Hi,

I have a situation whereby I need to use filters with "OR" .

Here is a description of my model:

1) A student affiliated to only one school. (ForeignKey)
2) A student can only have one publication. (ForeignKey)
3) A student can have multiple research interest(s). (ManytoManyField)

I want to use the filter (which is awesome!!). However, I want to
filter
all students belonging to school A OR school B (with other filter
criteria,
on other columns (all ANDed).

Can I do that with the django Admin? If so, how?

Below is the actual model of my classes:

I appreciate any help.

Thanks,
sanrio



class School (models.Model):
   name = models.CharField (maxlength=60)
   def __str__ (self):
   return self.name
   class Admin:
   list_display = ('name',)
   class Meta:
   db_table = 'School'

Publication (models.Model):
   name = models.CharField (maxlength=50)
   def __str__ (self):
   return self.name
   class Admin:
   list_display = ('name',)
   class Meta:
   db_table = 'Publication'

class Student (models.Model):
   first_name = models.CharField (maxlength=30)
   last_name = models.CharField (maxlength=30)
   email = models.EmailField ()
   phone = models.PhoneNumberField ()
   research = models.ManyToManyField (Research, null=True,
blank=True)
   publication = models.ForeignKey (Publication)
   affiliation = models.ForeignKey (School)

class Admin:
   list_display = ('last_name', 'first_name', 'affiliatiation')
   list_filter = ('affiliation', 'publication', 'research')






--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google  
Groups "Django users" group.

To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---










smime.p7s
Description: S/MIME cryptographic signature


Re: Administration site is plain

2008-01-28 Thread William Siegrist
Make sure  your production server knows where to send requests for / 
media/. You probably need a symlink to django/contrib/admin/media.


See "Serving admin files" here (especially if you're using mod_python):

http://www.djangoproject.com/documentation/modpython/


-Bill



On Jan 28, 2008, at 2:48 PM, Michael Hipp wrote:



Running on my local development server the Administration site looks
normal with the nice colors and formatting.

Running on my production server it is utterly plain (black and white).
It's evidently not picking up some css or templates or something.

I don't see anything helpful in the apache log other than it can't  
find

404.html but I don't know why it would be looking for that. Setting
DEBUG=True didn't show anything either.

Anyone know how to fix this?

Thanks,
Michael

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google  
Groups "Django users" group.

To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---












smime.p7s
Description: S/MIME cryptographic signature


Re: Running django+apache on my macbook

2008-01-18 Thread William Siegrist
I recommend installing apache, python, and mod_python via MacPorts.   
Thats what I do to run django on various Mac platforms. Granted, I  
work with the MacPorts project, so maybe I'm biased, but I also came  
from a linux environment and find MacPorts to be very useful for  
package management.


http://www.macports.org/

-Bill


On Jan 18, 2008, at 9:55 AM, John M wrote:



OK,

So I know Linux / Apache pretty well, never really done any hard-core
stuff with it.  Now I want to use apache on my macbook (intel) OSx
10.5 (upgrade),but have no clue about how to do it.

Googling for how to install mod_python results in a lot of issues from
what I can find, 64bit vs 32bit, etc.

So my question is, whats the easiest way to just get my macbook intel
10.5 to run apache and Django.

Thanks everyone

John
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google  
Groups "Django users" group.

To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---









smime.p7s
Description: S/MIME cryptographic signature


Re: best practices for a production site

2008-01-18 Thread William Siegrist
If the spelling changes are in 1 file, and the new feature is in  
another file, can't you "svn update" just the spelling change file and  
not the new feature file? And if they are in the same file, I think  
the --revision option to svn update might also help.


-Bill


On Jan 17, 2008, at 11:55 PM, Kenneth Gonsalves wrote:



hi,

I have a site in production and being developed at the same time - a
common django usecase I am sure. This is the first time I am
developing a site with a team comprised of several remote
contributors also. My previous teams were all in the same lab.
Currently everyone with commit rights commits code to the repository.
I test it out on the setup on my local box, and if satisfactory do an
svn up on the server and restart apache. The problem is that there
are two types of changes in code - one is new features and the other
is minor changes. With the current setup, minor changes have to wait
until the new features are tested out. So even a spelling mistake has
to wait until whatever is already committed is tested and accepted.
At the same time, the new features do not really justify setting up
separate branches. So what would be the best way out of this?
--

regards
kg
http://lawgon.livejournal.com
http://nrcfosshelpline.in/web/
Foss Conference for the common man: http://registration.fossconf.in/web/



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google  
Groups "Django users" group.

To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---












smime.p7s
Description: S/MIME cryptographic signature


Re: Login to Django Administration Page via Post Method

2008-01-16 Thread William Siegrist
You use "Self" instead of "self" in the param line, was that just a  
cut-n-paste error?


-Bill

On Jan 15, 2008, at 10:41 PM, [EMAIL PROTECTED] wrote:



Hi all,

I am about to writing the django unittest, so I need to login to the
django admin page to test my unittest. I send the POST request to /
admin/ by using the admin account(username/password). Then the
response from the admin page return like the password/username are
invalid. can't login.

I use the mysqlite and then create admin user in the DB. The page that
im gonna test is needed an admin session id, so i need to login to
django admin page first, then i can test my unittest.


class LogReportTest(unittest.TestCase):
   def setUp(self):
   self.client = Client()
   self.username = 'admin'
   self.email= '[EMAIL PROTECTED]'
   self.password = 'welcome'
   create_admin_user(self.username, self.email, self.password)
   param = {'username':Self.username,'password':Self.password}
   response = self.client.post('/admin/',param)
   print response

any ideas?

Regards,
ajink09
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google  
Groups "Django users" group.

To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---








smime.p7s
Description: S/MIME cryptographic signature


Re: CSS Issues

2008-01-06 Thread William Siegrist
bah, nevermind, I should try reading more carefully, as you're not  
using the test server. :)


Sorry.

Might be a conflict with using /media/ for both admin and static files?

-Bill


On Jan 6, 2008, at 9:12 PM, pacman wrote:



Hi, I have a strange issue with my css not loading. CSS and Images
seem to work fine for the admin portion of the site but when I try to
add my own CSS it can't seem to find it.

my variables look as such:

MEDIA_ROOT = '/srv/abc/media/'
MEDIA_URL = 'http://www.abc.net/media/'
ADMIN_MEDIA_PREFIX = 'http://www.abc.net/media/'

I have a CSS link in a template file that looks like so but will not
load:

	
css/styling.css" />
I point my browser to the link and it seems to show the default admin
stuff suchas the css, js, and image files but it doesn't show the
stuff that I have tossed into that directory such as the styling.css.

my apache config looks like this:


   ServerName django.abc.net
   ServerAlias django
   ServerAdmin [EMAIL PROTECTED]

   
   SetHandler python-program
   PythonHandler django.core.handlers.modpython
   SetEnv DJANGO_SETTINGS_MODULE abc.settings
   PythonPath "['/srv','/srv/django-0.96-current','/srv/abc'] +
sys.path"
   PythonDebug On
   
   
   SetHandler None
   



for some reason I have to use the www.abc.com/media/ to get to where
my media content is stored rather than what I assume should be like
this django.abc.com/media/ since I set the handler to none within the
virtual host tag. Anyone know why I have to use the first url as
apposed to using the second one?


Does anyone know why my css is not loading correctly but the admin css
works fine?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google  
Groups "Django users" group.

To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~----~--~--~---







William Siegrist
Software Support Engineer
Mac OS Forge
http://macosforge.org/
[EMAIL PROTECTED]
408 862 7337







smime.p7s
Description: S/MIME cryptographic signature


Re: CSS Issues

2008-01-06 Thread William Siegrist

Have you tried this yet?

http://www.djangoproject.com/documentation/static_files/


-Bill



On Jan 6, 2008, at 9:12 PM, pacman wrote:



Hi, I have a strange issue with my css not loading. CSS and Images
seem to work fine for the admin portion of the site but when I try to
add my own CSS it can't seem to find it.

my variables look as such:

MEDIA_ROOT = '/srv/abc/media/'
MEDIA_URL = 'http://www.abc.net/media/'
ADMIN_MEDIA_PREFIX = 'http://www.abc.net/media/'

I have a CSS link in a template file that looks like so but will not
load:

	
css/styling.css" />
I point my browser to the link and it seems to show the default admin
stuff suchas the css, js, and image files but it doesn't show the
stuff that I have tossed into that directory such as the styling.css.

my apache config looks like this:


   ServerName django.abc.net
   ServerAlias django
   ServerAdmin [EMAIL PROTECTED]

   
   SetHandler python-program
   PythonHandler django.core.handlers.modpython
   SetEnv DJANGO_SETTINGS_MODULE abc.settings
   PythonPath "['/srv','/srv/django-0.96-current','/srv/abc'] +
sys.path"
   PythonDebug On
   
   
   SetHandler None
   



for some reason I have to use the www.abc.com/media/ to get to where
my media content is stored rather than what I assume should be like
this django.abc.com/media/ since I set the handler to none within the
virtual host tag. Anyone know why I have to use the first url as
apposed to using the second one?


Does anyone know why my css is not loading correctly but the admin css
works fine?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google  
Groups "Django users" group.

To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~----~--~--~---







William Siegrist
Software Support Engineer
Mac OS Forge
http://macosforge.org/
[EMAIL PROTECTED]
408 862 7337







smime.p7s
Description: S/MIME cryptographic signature


Re: Views, Templates, and Dictionaries

2008-01-02 Thread William Siegrist

This might help...

from:  http://www.djangoproject.com/documentation/templates/#for

{% for key, value in this_dict.items %}
{{ key }}: {{ value }}
{% endfor %}

-Bill

On Jan 2, 2008, at 8:40 PM, brandonl wrote:



I have a simple view:

def index(request):
this_dict = { 'one':'','two':'', 'three':''}
c = Context({"this_dict":this_dict})
return HttpResponse(t.render(c))

my template is like so:

{% for i in this_dict %}
   key: {{i}} 
   value:{{this_dict.i}} 
{% endfor %}

When the view is rendered it only prints the dictionary keys and not
the values:

key: one
value:
key:two
value:
key:three
value:

What am I doing wrong here?  Any help would be greatly appreciated.
Thanks.

- Brandon

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google  
Groups "Django users" group.

To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---









smime.p7s
Description: S/MIME cryptographic signature