Re: Django training resources?

2010-12-17 Thread Kenneth Gonsalves
On Fri, 2010-12-17 at 18:37 -0800, Sean W wrote:
> I should mention that a would prefer a tutorial that goes over 
> web development principals like Javascript and AJAX because I've never
> used 
> those tools before. 

that has nothing to do with django
-- 
regards
Kenneth Gonsalves

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: registering app level signal handlers

2010-12-17 Thread Yaniv Aknin
Maybe I'm missing something here, but why not the app's __init__.py?

(my main urls.py imports all my apps' urls.py, which means their __init__.py
is likely to be called rather early in any request, no?)

 - Yaniv

On Sat, Dec 18, 2010 at 3:10 AM, dmitry b  wrote:

> Aren't an app's models loaded lazily (upon the first use)?
>
> On Dec 16, 7:16 pm, "W. Craig Trader"  wrote:
> > I usually register the signals for a given application at the bottom of
> that
> > app's model.py file.
> >
> > - Craig -
>
> --
> 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.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



VirtualHost and external IP

2010-12-17 Thread andy
I have the following in my apache httpd.conf file


ServerName mastermac

Alias /site_media/ /var/www/django_projects/master_mac_enterprise/
master_mac_enterprise/site_media/


Order deny,allow
Allow from all
Options -Indexes


WSGIScriptAlias / /var/www/django_projects/master_mac_enterprise/
master_mac_enterprise/apache/django.wsgi


Order deny,allow
Allow from all




ServerName localhost/portfolio

Alias /site_media/ /var/www/django_projects/portfolio/portfolio/
public/site_media/


Order deny,allow
Allow from all
Options -Indexes


WSGIScriptAlias / /var/www/django_projects/portfolio/portfolio/public/
django.wsgi


Order deny,allow
Allow from all



which works perfectly when I try to access the site locally using
http://mastermac and http://portfolio.

My question is how can I access these site from my external IP or when
using my local IP address from another machine? currently only the
first site is accessibly externally when I try to do this.

I tried WSGIScriptAlias /mastermac and WSGIScriptAlias /portfolio
which works until I try to load a new page, since the /mastermac is
being ignored on subsequent request form the application.

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django vs Postgres Connection

2010-12-17 Thread CLIFFORD ILKAY

On 12/17/2010 03:49 PM, armandoperico wrote:

on settings.py..

DATABASES = {
 'default': {
 'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add
'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
 'NAME': 'dbname',  # Or path to database
file if using sqlite3.
 'USER': 'myuser',  # Not used with
sqlite3.
 'PASSWORD': 'mypass',  # Not used with
sqlite3.
 'HOST': '127.0.0.1',  # Set to empty
string for localhost. Not used with sqlite3.
 'PORT': '5432',  # Set to empty string for
default. Not used with sqlite3.
 }
}


Either get rid of the 127.0.0.1 and 5432 as per the comments in the code 
above or change listen_address="*" in postgresql.conf and restart PG. 
The former will make a socket connection. You're trying to make a TCP/IP 
connection to PostgreSQL as you have it above now and PG is configured 
by default to only listen to localhost, not an IP address, even if that 
IP address is 127.0.0.1. You'll most likely find 
listen_address="localhost" on your machine right now.

--
Regards,

Clifford Ilkay
Dinamis
1419-3266 Yonge St.
Toronto, ON
Canada  M4N 3P6


+1 416-410-3326

--
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Authenticate every def in views.py

2010-12-17 Thread suckerfish
Hi guys

I've added a decorator to *each* def in views.py to require
authentication. Is there a simpler way that allows me to apply
authentication automatically to every def in the file?

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django training resources?

2010-12-17 Thread Sean W
I should mention that a would prefer a tutorial that goes over 
web development principals like Javascript and AJAX because I've never used 
those tools before.

Thanks again.   

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django training resources?

2010-12-17 Thread Sean
USA
On Dec 17, 2010 9:28 PM, "Kenneth Gonsalves"  wrote:
> On Fri, 2010-12-17 at 15:12 -0800, Sean W wrote:
>> Is anyone aware of good quality, affordable training for Django?
>
> which country?
> --
> regards
> Kenneth Gonsalves
>
> --
> 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.com
.
> For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.
>

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django training resources?

2010-12-17 Thread Kenneth Gonsalves
On Fri, 2010-12-17 at 15:12 -0800, Sean W wrote:
> Is anyone aware of good quality, affordable training for Django? 

which country?
-- 
regards
Kenneth Gonsalves

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.




Re: How to get a web development job (i.e. Django/Python) if someone is an amateur programmer?

2010-12-17 Thread Kenneth Gonsalves
On Fri, 2010-12-17 at 13:15 -0500, Ken Huang wrote:
> I've got a still-live Digg-like PHP site that I built two years ago
> with a
> few buddies. How much cred does that buy me if I'm looking for a
> Django job?
> Do I need to specifically build and/or open source Django?
> 
> 

yes
-- 
regards
Kenneth Gonsalves

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to get a web development job (i.e. Django/Python) if someone is an amateur programmer?

2010-12-17 Thread Kenneth Gonsalves
On Fri, 2010-12-17 at 09:03 -0800, Dopster wrote:
> As an amateur, how could I position myself to get in the door at an 
> established startup (i.e., not founding team) or web dev shop as a
> junior 
> Django/[insert language/framework here] developer? 

as a fellow amateur, I found the best way is to publish all my code as
open source, sit on IRC and contribute to the mailing list. No doubt I
am at the bottom of the django food chain, but answering frequently
asked questions frees up the bigger guys for more important things.
-- 
regards
Kenneth Gonsalves

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django training resources?

2010-12-17 Thread mengu
hi,

i think you should definitely watch this screencast series:
http://showmedo.com/videotutorials/video?name=336=336

On Dec 18, 1:12 am, Sean W  wrote:
> Is anyone aware of good quality, affordable training for Django?  I'm
> entirely new to web development, although I do have some experience with
> Python. I'm also a college student, so cost is a concern. I don't have the
> time to travel to a training seminar. I'm not one of those people who can
> master a subject simply by reading a book or tutorial–I need some hands on
> experience. Something like a webinar would work, even a pre-recorded one.
>
> Any suggestions are appreciated. Thanks.

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django training resources?

2010-12-17 Thread Sebastian Gutierrez
try showmedo.com

They have some django tutorials given by screen casts that are free and some 
that are pretty cheap. 

Sebastian

On Dec 17, 2010, at 3:12 PM, Sean W wrote:

> Is anyone aware of good quality, affordable training for Django?  I'm 
> entirely new to web development, although I do have some experience with 
> Python. I'm also a college student, so cost is a concern. I don't have the 
> time to travel to a training seminar. I'm not one of those people who can 
> master a subject simply by reading a book or tutorial–I need some hands on 
> experience. Something like a webinar would work, even a pre-recorded one.
> 
> Any suggestions are appreciated. Thanks.
>  
> 
> -- 
> 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.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: registering app level signal handlers

2010-12-17 Thread dmitry b
Aren't an app's models loaded lazily (upon the first use)?

On Dec 16, 7:16 pm, "W. Craig Trader"  wrote:
> I usually register the signals for a given application at the bottom of that
> app's model.py file.
>
> - Craig -

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django vs Postgres Connection

2010-12-17 Thread Anurag Chourasia
Hi Armando,

To specify the Postgre password, you should set the environment variable
pointing to the pgpass file .. basically add this line to your wsgi
script (replacing with the actual location of your pgpass file of course)

*os.environ['PGPASSFILE']='/home/ap2/.pgpass'*

Let me know if it works.

Regards,
Anurag

On Sat, Dec 18, 2010 at 3:20 AM, armandoperico wrote:

> sorry,
> how should do to specify the password on the wsgi file ?
> this would be the best i have so far.
>
> thanks
>
>
> On Dec 17, 10:17 pm, Anurag Chourasia 
> wrote:
> > And did you had to provide a password for establishing that connection?
> Or
> > the .pgpass file took care of it?
> >
> > If you had to provide a password then probably that's your clue. You
> might
> > be required to specify the pgpass in mod wsgi script.
> >
> > On Sat, Dec 18, 2010 at 2:45 AM, armandoperico <
> armandoper...@hotmail.com>wrote:
> >
> >
> >
> >
> >
> >
> >
> > > yes.
> >
> > > On Dec 17, 10:04 pm, Anurag Chourasia 
> > > wrote:
> > > >  On this server, are you able to connect to the PostGre database
> using
> > > the
> > > > command line?
> >
> > > > psql -U myuser -h 127.0.0.1 -p 5432 -d dbname
> >
> > > > Regards,
> > > > Anurag
> >
> > > > On Sat, Dec 18, 2010 at 2:19 AM, armandoperico <
> > > armandoper...@hotmail.com>wrote:
> >
> > > > > on settings.py..
> >
> > > > > DATABASES = {
> > > > >'default': {
> > > > >'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add
> > > > > 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or
> 'oracle'.
> > > > >'NAME': 'dbname',  # Or path to database
> > > > > file if using sqlite3.
> > > > >'USER': 'myuser',  # Not used with
> > > > > sqlite3.
> > > > >'PASSWORD': 'mypass',  # Not used with
> > > > > sqlite3.
> > > > >'HOST': '127.0.0.1',  # Set to empty
> > > > > string for localhost. Not used with sqlite3.
> > > > >'PORT': '5432',  # Set to empty string
> for
> > > > > default. Not used with sqlite3.
> > > > > }
> > > > > }
> >
> > > > > On Dec 17, 9:25 pm, Christophe Pettus  wrote:
> > > > > > On Dec 17, 2010, at 12:02 PM, armandoperico wrote:
> >
> > > > > > > On my local machine everything is running fine, but when i try
> to
> > > > > > > deploy to a running server with apache (mod_wsgi), i'm getting
> the
> > > > > > > following error (database related):
> >
> > > > > > > Caught OperationalError while rendering: could not connect to
> > > server:
> > > > > > > Permission denied
> > > > > > >Is the server running on host "127.0.0.1" and accepting
> > > > > > >TCP/IP connections on port 5432?
> >
> > > > > > What's your database configuration on the Apache machine?
> >
> > > > > > --
> > > > > > -- Christophe Pettus
> > > > > >x...@thebuild.com
> >
> > > > > --
> > > > > 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.
> >
> > > --
> > > 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.com
> 
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/django-users?hl=en.
>
> --
> 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.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Django training resources?

2010-12-17 Thread Sean W
Is anyone aware of good quality, affordable training for Django?  I'm 
entirely new to web development, although I do have some experience with 
Python. I'm also a college student, so cost is a concern. I don't have the 
time to travel to a training seminar. I'm not one of those people who can 
master a subject simply by reading a book or tutorial–I need some hands on 
experience. Something like a webinar would work, even a pre-recorded one.

Any suggestions are appreciated. Thanks.
 

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django vs Postgres Connection

2010-12-17 Thread armandoperico
sorry,
how should do to specify the password on the wsgi file ?
this would be the best i have so far.

thanks


On Dec 17, 10:17 pm, Anurag Chourasia 
wrote:
> And did you had to provide a password for establishing that connection? Or
> the .pgpass file took care of it?
>
> If you had to provide a password then probably that's your clue. You might
> be required to specify the pgpass in mod wsgi script.
>
> On Sat, Dec 18, 2010 at 2:45 AM, armandoperico 
> wrote:
>
>
>
>
>
>
>
> > yes.
>
> > On Dec 17, 10:04 pm, Anurag Chourasia 
> > wrote:
> > >  On this server, are you able to connect to the PostGre database using
> > the
> > > command line?
>
> > > psql -U myuser -h 127.0.0.1 -p 5432 -d dbname
>
> > > Regards,
> > > Anurag
>
> > > On Sat, Dec 18, 2010 at 2:19 AM, armandoperico <
> > armandoper...@hotmail.com>wrote:
>
> > > > on settings.py..
>
> > > > DATABASES = {
> > > >    'default': {
> > > >        'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add
> > > > 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
> > > >        'NAME': 'dbname',                      # Or path to database
> > > > file if using sqlite3.
> > > >        'USER': 'myuser',                      # Not used with
> > > > sqlite3.
> > > >        'PASSWORD': 'mypass',                  # Not used with
> > > > sqlite3.
> > > >        'HOST': '127.0.0.1',                      # Set to empty
> > > > string for localhost. Not used with sqlite3.
> > > >        'PORT': '5432',                      # Set to empty string for
> > > > default. Not used with sqlite3.
> > > >     }
> > > > }
>
> > > > On Dec 17, 9:25 pm, Christophe Pettus  wrote:
> > > > > On Dec 17, 2010, at 12:02 PM, armandoperico wrote:
>
> > > > > > On my local machine everything is running fine, but when i try to
> > > > > > deploy to a running server with apache (mod_wsgi), i'm getting the
> > > > > > following error (database related):
>
> > > > > > Caught OperationalError while rendering: could not connect to
> > server:
> > > > > > Permission denied
> > > > > >    Is the server running on host "127.0.0.1" and accepting
> > > > > >    TCP/IP connections on port 5432?
>
> > > > > What's your database configuration on the Apache machine?
>
> > > > > --
> > > > > -- Christophe Pettus
> > > > >    x...@thebuild.com
>
> > > > --
> > > > 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.com > > >  groups.com>
> > 
> > > > .
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/django-users?hl=en.
>
> > --
> > 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.com > groups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Full text search with PostgreSQL and Django

2010-12-17 Thread Jorge Bastida
http://haystacksearch.org/

2010/12/17 marcoarreguin 

> Hi!!
>
> I need to implement a search engine with full text search, I'm using
> postgreSQL and Django, I have searched in google (
> http://barryp.org/blog/entries/postgresql-full-text-search-django/ )
> but isn't there a more simple way ??
>
> Or just another way?
>
> --
> 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.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
Benito Jorge Bastida
jo...@thecodefarm.com

thecodefarm SL
Av. Gasteiz 21, 1º Derecha
01008 Vitoria-Gasteiz
http://thecodefarm.com
Tel: (+34) 945 06 55 09

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Full text search with PostgreSQL and Django

2010-12-17 Thread marcoarreguin
Hi!!

I need to implement a search engine with full text search, I'm using
postgreSQL and Django, I have searched in google (
http://barryp.org/blog/entries/postgresql-full-text-search-django/ )
but isn't there a more simple way ??

Or just another way?

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Multiple conditions on same field in JOIN over three models

2010-12-17 Thread Jonas H.

On 12/17/2010 08:38 PM, Łukasz Rekucki wrote:

Blog.objects.filter(post_tags__name__in=["foo",
"bar"]).annotate(match_count=Count('post__tags')).filter(match_count=2)

This should give you the right results.


Neat! And blazingly fast, too, I guess!

Thank you very much, anyway :-)

Jonas

--
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Request Object Data

2010-12-17 Thread Jonas H.

On 12/17/2010 10:18 PM, hank23 wrote:

Is data entered on an input screen automatically added to the request
when the screen is submitted? If so are there any special parameters
or settings in the screen controls which have to be set/coded to get
the entered data saved into the request and under what keys is the
data saved? Once in the request then how can I retrieve the data back
out of the request so that I access it and do something with it? I
have seen an example where some data is extracted back out of the
request using "request.POST['choice']". Can this code be used to
retrieve any data which is saved in the request? Thanks for the
help.



http://docs.djangoproject.com/en/dev/intro/tutorial04/

--
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django vs Postgres Connection

2010-12-17 Thread armandoperico
yes... no passwords.

On Dec 17, 10:17 pm, Anurag Chourasia 
wrote:
> And did you had to provide a password for establishing that connection? Or
> the .pgpass file took care of it?
>
> If you had to provide a password then probably that's your clue. You might
> be required to specify the pgpass in mod wsgi script.
>
> On Sat, Dec 18, 2010 at 2:45 AM, armandoperico 
> wrote:
>
>
>
>
>
>
>
> > yes.
>
> > On Dec 17, 10:04 pm, Anurag Chourasia 
> > wrote:
> > >  On this server, are you able to connect to the PostGre database using
> > the
> > > command line?
>
> > > psql -U myuser -h 127.0.0.1 -p 5432 -d dbname
>
> > > Regards,
> > > Anurag
>
> > > On Sat, Dec 18, 2010 at 2:19 AM, armandoperico <
> > armandoper...@hotmail.com>wrote:
>
> > > > on settings.py..
>
> > > > DATABASES = {
> > > >    'default': {
> > > >        'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add
> > > > 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
> > > >        'NAME': 'dbname',                      # Or path to database
> > > > file if using sqlite3.
> > > >        'USER': 'myuser',                      # Not used with
> > > > sqlite3.
> > > >        'PASSWORD': 'mypass',                  # Not used with
> > > > sqlite3.
> > > >        'HOST': '127.0.0.1',                      # Set to empty
> > > > string for localhost. Not used with sqlite3.
> > > >        'PORT': '5432',                      # Set to empty string for
> > > > default. Not used with sqlite3.
> > > >     }
> > > > }
>
> > > > On Dec 17, 9:25 pm, Christophe Pettus  wrote:
> > > > > On Dec 17, 2010, at 12:02 PM, armandoperico wrote:
>
> > > > > > On my local machine everything is running fine, but when i try to
> > > > > > deploy to a running server with apache (mod_wsgi), i'm getting the
> > > > > > following error (database related):
>
> > > > > > Caught OperationalError while rendering: could not connect to
> > server:
> > > > > > Permission denied
> > > > > >    Is the server running on host "127.0.0.1" and accepting
> > > > > >    TCP/IP connections on port 5432?
>
> > > > > What's your database configuration on the Apache machine?
>
> > > > > --
> > > > > -- Christophe Pettus
> > > > >    x...@thebuild.com
>
> > > > --
> > > > 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.com > > >  groups.com>
> > 
> > > > .
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/django-users?hl=en.
>
> > --
> > 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.com > groups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Request Object Data

2010-12-17 Thread hank23
Is data entered on an input screen automatically added to the request
when the screen is submitted? If so are there any special parameters
or settings in the screen controls which have to be set/coded to get
the entered data saved into the request and under what keys is the
data saved? Once in the request then how can I retrieve the data back
out of the request so that I access it and do something with it? I
have seen an example where some data is extracted back out of the
request using "request.POST['choice']". Can this code be used to
retrieve any data which is saved in the request? Thanks for the
help.

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django vs Postgres Connection

2010-12-17 Thread Anurag Chourasia
And did you had to provide a password for establishing that connection? Or
the .pgpass file took care of it?

If you had to provide a password then probably that's your clue. You might
be required to specify the pgpass in mod wsgi script.

On Sat, Dec 18, 2010 at 2:45 AM, armandoperico wrote:

> yes.
>
> On Dec 17, 10:04 pm, Anurag Chourasia 
> wrote:
> >  On this server, are you able to connect to the PostGre database using
> the
> > command line?
> >
> > psql -U myuser -h 127.0.0.1 -p 5432 -d dbname
> >
> > Regards,
> > Anurag
> >
> > On Sat, Dec 18, 2010 at 2:19 AM, armandoperico <
> armandoper...@hotmail.com>wrote:
> >
> >
> >
> >
> >
> >
> >
> > > on settings.py..
> >
> > > DATABASES = {
> > >'default': {
> > >'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add
> > > 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
> > >'NAME': 'dbname',  # Or path to database
> > > file if using sqlite3.
> > >'USER': 'myuser',  # Not used with
> > > sqlite3.
> > >'PASSWORD': 'mypass',  # Not used with
> > > sqlite3.
> > >'HOST': '127.0.0.1',  # Set to empty
> > > string for localhost. Not used with sqlite3.
> > >'PORT': '5432',  # Set to empty string for
> > > default. Not used with sqlite3.
> > > }
> > > }
> >
> > > On Dec 17, 9:25 pm, Christophe Pettus  wrote:
> > > > On Dec 17, 2010, at 12:02 PM, armandoperico wrote:
> >
> > > > > On my local machine everything is running fine, but when i try to
> > > > > deploy to a running server with apache (mod_wsgi), i'm getting the
> > > > > following error (database related):
> >
> > > > > Caught OperationalError while rendering: could not connect to
> server:
> > > > > Permission denied
> > > > >Is the server running on host "127.0.0.1" and accepting
> > > > >TCP/IP connections on port 5432?
> >
> > > > What's your database configuration on the Apache machine?
> >
> > > > --
> > > > -- Christophe Pettus
> > > >x...@thebuild.com
> >
> > > --
> > > 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.com
> 
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/django-users?hl=en.
>
> --
> 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.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django vs Postgres Connection

2010-12-17 Thread armandoperico
could it be something related with permissions ?!
because i have to change everything to "apache" - chown -R apache ../
myproject_folder/

which would be the right permissions to have ?

thanks a lot

On Dec 17, 10:04 pm, Anurag Chourasia 
wrote:
>  On this server, are you able to connect to the PostGre database using the
> command line?
>
> psql -U myuser -h 127.0.0.1 -p 5432 -d dbname
>
> Regards,
> Anurag
>
> On Sat, Dec 18, 2010 at 2:19 AM, armandoperico 
> wrote:
>
>
>
>
>
>
>
> > on settings.py..
>
> > DATABASES = {
> >    'default': {
> >        'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add
> > 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
> >        'NAME': 'dbname',                      # Or path to database
> > file if using sqlite3.
> >        'USER': 'myuser',                      # Not used with
> > sqlite3.
> >        'PASSWORD': 'mypass',                  # Not used with
> > sqlite3.
> >        'HOST': '127.0.0.1',                      # Set to empty
> > string for localhost. Not used with sqlite3.
> >        'PORT': '5432',                      # Set to empty string for
> > default. Not used with sqlite3.
> >     }
> > }
>
> > On Dec 17, 9:25 pm, Christophe Pettus  wrote:
> > > On Dec 17, 2010, at 12:02 PM, armandoperico wrote:
>
> > > > On my local machine everything is running fine, but when i try to
> > > > deploy to a running server with apache (mod_wsgi), i'm getting the
> > > > following error (database related):
>
> > > > Caught OperationalError while rendering: could not connect to server:
> > > > Permission denied
> > > >    Is the server running on host "127.0.0.1" and accepting
> > > >    TCP/IP connections on port 5432?
>
> > > What's your database configuration on the Apache machine?
>
> > > --
> > > -- Christophe Pettus
> > >    x...@thebuild.com
>
> > --
> > 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.com > groups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django vs Postgres Connection

2010-12-17 Thread armandoperico
yes.

On Dec 17, 10:04 pm, Anurag Chourasia 
wrote:
>  On this server, are you able to connect to the PostGre database using the
> command line?
>
> psql -U myuser -h 127.0.0.1 -p 5432 -d dbname
>
> Regards,
> Anurag
>
> On Sat, Dec 18, 2010 at 2:19 AM, armandoperico 
> wrote:
>
>
>
>
>
>
>
> > on settings.py..
>
> > DATABASES = {
> >    'default': {
> >        'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add
> > 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
> >        'NAME': 'dbname',                      # Or path to database
> > file if using sqlite3.
> >        'USER': 'myuser',                      # Not used with
> > sqlite3.
> >        'PASSWORD': 'mypass',                  # Not used with
> > sqlite3.
> >        'HOST': '127.0.0.1',                      # Set to empty
> > string for localhost. Not used with sqlite3.
> >        'PORT': '5432',                      # Set to empty string for
> > default. Not used with sqlite3.
> >     }
> > }
>
> > On Dec 17, 9:25 pm, Christophe Pettus  wrote:
> > > On Dec 17, 2010, at 12:02 PM, armandoperico wrote:
>
> > > > On my local machine everything is running fine, but when i try to
> > > > deploy to a running server with apache (mod_wsgi), i'm getting the
> > > > following error (database related):
>
> > > > Caught OperationalError while rendering: could not connect to server:
> > > > Permission denied
> > > >    Is the server running on host "127.0.0.1" and accepting
> > > >    TCP/IP connections on port 5432?
>
> > > What's your database configuration on the Apache machine?
>
> > > --
> > > -- Christophe Pettus
> > >    x...@thebuild.com
>
> > --
> > 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.com > groups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django vs Postgres Connection

2010-12-17 Thread Anurag Chourasia
 On this server, are you able to connect to the PostGre database using the
command line?

psql -U myuser -h 127.0.0.1 -p 5432 -d dbname

Regards,
Anurag

On Sat, Dec 18, 2010 at 2:19 AM, armandoperico wrote:

> on settings.py..
>
> DATABASES = {
>'default': {
>'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add
> 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
>'NAME': 'dbname',  # Or path to database
> file if using sqlite3.
>'USER': 'myuser',  # Not used with
> sqlite3.
>'PASSWORD': 'mypass',  # Not used with
> sqlite3.
>'HOST': '127.0.0.1',  # Set to empty
> string for localhost. Not used with sqlite3.
>'PORT': '5432',  # Set to empty string for
> default. Not used with sqlite3.
> }
> }
>
> On Dec 17, 9:25 pm, Christophe Pettus  wrote:
> > On Dec 17, 2010, at 12:02 PM, armandoperico wrote:
> >
> > > On my local machine everything is running fine, but when i try to
> > > deploy to a running server with apache (mod_wsgi), i'm getting the
> > > following error (database related):
> >
> > > Caught OperationalError while rendering: could not connect to server:
> > > Permission denied
> > >Is the server running on host "127.0.0.1" and accepting
> > >TCP/IP connections on port 5432?
> >
> > What's your database configuration on the Apache machine?
> >
> > --
> > -- Christophe Pettus
> >x...@thebuild.com
>
> --
> 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.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django vs Postgres Connection

2010-12-17 Thread armandoperico
Below follows my wsgi script.
But i don't think it's not being able to read the settings.py because
it is actually complaining about the info that is inside there. (the
DB infos)
:S

-wsgi
---
import os
import sys

sys.path.append('***/wsgi/src/mysite/')
sys.path.append('*/wsgi/')

os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'

import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
-wsgi
---

On Dec 17, 9:51 pm, Anurag Chourasia 
wrote:
> You might want to check your wsgi script.
>
> Looks like the environment variables that you have in there are wrong and
> not allowing the import of settings.py
>
> Regards,
> Anurag
>
> On Sat, Dec 18, 2010 at 1:32 AM, armandoperico 
> wrote:
>
>
>
>
>
>
>
> > Hi,
> > this is the first time i try to deploy a django project and i'm not
> > being able to solve a problem.
>
> > On my local machine everything is running fine, but when i try to
> > deploy to a running server with apache (mod_wsgi), i'm getting the
> > following error (database related):
>
> > Caught OperationalError while rendering: could not connect to server:
> > Permission denied
> >        Is the server running on host "127.0.0.1" and accepting
> >        TCP/IP connections on port 5432?
>
> > The fact is that when i try to connect to the database using psql -
> > U... is working fine, so postgree is working ok, it seems to be with
> > django :S
>
> > Exception Location:     /usr/lib/python2.6/site-packages/django/db/
> > backends/postgresql_psycopg2/base.py in _cursor, line 136
>
> > this is my django version (just in case): 1.2.3
>
> > Anyone here has faced this problem ?
> > have any ideas?
>
> > Thanks
>
> > --
> > 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.com > groups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django vs Postgres Connection

2010-12-17 Thread Anurag Chourasia
You might want to check your wsgi script.

Looks like the environment variables that you have in there are wrong and
not allowing the import of settings.py

Regards,
Anurag

On Sat, Dec 18, 2010 at 1:32 AM, armandoperico wrote:

> Hi,
> this is the first time i try to deploy a django project and i'm not
> being able to solve a problem.
>
> On my local machine everything is running fine, but when i try to
> deploy to a running server with apache (mod_wsgi), i'm getting the
> following error (database related):
>
> Caught OperationalError while rendering: could not connect to server:
> Permission denied
>Is the server running on host "127.0.0.1" and accepting
>TCP/IP connections on port 5432?
>
> The fact is that when i try to connect to the database using psql -
> U... is working fine, so postgree is working ok, it seems to be with
> django :S
>
> Exception Location: /usr/lib/python2.6/site-packages/django/db/
> backends/postgresql_psycopg2/base.py in _cursor, line 136
>
> this is my django version (just in case): 1.2.3
>
> Anyone here has faced this problem ?
> have any ideas?
>
> Thanks
>
> --
> 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.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django vs Postgres Connection

2010-12-17 Thread armandoperico
on my pg_hba.conf i right now have this:

# "local" is for Unix domain socket connections only
local   all all   trust
# IPv4 local connections:
hostall all 192.168.0.1/32trust
hostall all 127.0.0.1/32trust
# IPv6 local connections:
hostall all ::1/128trust


On Dec 17, 9:38 pm, Mathieu Leduc-Hamel  wrote:
> check if postgresql is listening to 127.0.0.1, 0.0.0.0 or nothing in postgrsql
>
>
>
>
>
>
>
>
>
> On Fri, Dec 17, 2010 at 3:30 PM, Servais Nabil  
> wrote:
> > Hello, I think postgresql is not running or doesnt use the 5432 port. Check
> > your processus.
>
> > Le 17 déc. 2010 21:25, "Christophe Pettus"  a écrit :
>
> >> On Dec 17, 2010, at 12:02 PM, armandoperico wrote:
> >>> On my local machine everything is running fine, but when i try to
> >>> deploy to a running server with apache (mod_wsgi), i'm getting the
> >>> following error (database related):
>
> >>> Caught OperationalError while rendering: could not connect to server:
> >>> Permission denied
> >>> Is the server running on host "127.0.0.1" and accepting
> >>> TCP/IP connections on port 5432?
>
> >> What's your database configuration on the Apache machine?
>
> >> --
> >> -- Christophe Pettus
> >> x...@thebuild.com
>
> >> --
> >> 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.com.
> >> For more options, visit this group at
> >>http://groups.google.com/group/django-users?hl=en.
>
> > --
> > 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.com.
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.
>
> --
> Mathieu Leduc-Hamel

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django vs Postgres Connection

2010-12-17 Thread armandoperico
on settings.py..

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add
'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'dbname',  # Or path to database
file if using sqlite3.
'USER': 'myuser',  # Not used with
sqlite3.
'PASSWORD': 'mypass',  # Not used with
sqlite3.
'HOST': '127.0.0.1',  # Set to empty
string for localhost. Not used with sqlite3.
'PORT': '5432',  # Set to empty string for
default. Not used with sqlite3.
}
}

On Dec 17, 9:25 pm, Christophe Pettus  wrote:
> On Dec 17, 2010, at 12:02 PM, armandoperico wrote:
>
> > On my local machine everything is running fine, but when i try to
> > deploy to a running server with apache (mod_wsgi), i'm getting the
> > following error (database related):
>
> > Caught OperationalError while rendering: could not connect to server:
> > Permission denied
> >    Is the server running on host "127.0.0.1" and accepting
> >    TCP/IP connections on port 5432?
>
> What's your database configuration on the Apache machine?
>
> --
> -- Christophe Pettus
>    x...@thebuild.com

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



RE: Django vs Postgres Connection

2010-12-17 Thread James DeMichele
This sounds more like a Postgresql settings problem than a Django/Python
specific problem.

I'd suggest taking a look at your pg_hba.conf file. It can be finicky, so
you probably want to reference this if you haven't already:

http://www.postgresql.org/docs/8.4/static/auth-pg-hba-conf.html

-Jamie

-Original Message-
From: django-users@googlegroups.com [mailto:django-us...@googlegroups.com]
On Behalf Of armandoperico
Sent: Friday, December 17, 2010 2:03 PM
To: Django users
Subject: Django vs Postgres Connection

Hi,
this is the first time i try to deploy a django project and i'm not
being able to solve a problem.

On my local machine everything is running fine, but when i try to
deploy to a running server with apache (mod_wsgi), i'm getting the
following error (database related):

Caught OperationalError while rendering: could not connect to server:
Permission denied
Is the server running on host "127.0.0.1" and accepting
TCP/IP connections on port 5432?

The fact is that when i try to connect to the database using psql -
U... is working fine, so postgree is working ok, it seems to be with
django :S

Exception Location: /usr/lib/python2.6/site-packages/django/db/
backends/postgresql_psycopg2/base.py in _cursor, line 136

this is my django version (just in case): 1.2.3

Anyone here has faced this problem ?
have any ideas?

Thanks

-- 
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.com.
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django vs Postgres Connection

2010-12-17 Thread Mathieu Leduc-Hamel
check if postgresql is listening to 127.0.0.1, 0.0.0.0 or nothing in postgrsql

On Fri, Dec 17, 2010 at 3:30 PM, Servais Nabil  wrote:
> Hello, I think postgresql is not running or doesnt use the 5432 port. Check
> your processus.
>
> Le 17 déc. 2010 21:25, "Christophe Pettus"  a écrit :
>>
>> On Dec 17, 2010, at 12:02 PM, armandoperico wrote:
>>> On my local machine everything is running fine, but when i try to
>>> deploy to a running server with apache (mod_wsgi), i'm getting the
>>> following error (database related):
>>>
>>> Caught OperationalError while rendering: could not connect to server:
>>> Permission denied
>>> Is the server running on host "127.0.0.1" and accepting
>>> TCP/IP connections on port 5432?
>>
>> What's your database configuration on the Apache machine?
>>
>> --
>> -- Christophe Pettus
>> x...@thebuild.com
>>
>> --
>> 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.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
> --
> 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.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 
Mathieu Leduc-Hamel

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django vs Postgres Connection

2010-12-17 Thread Servais Nabil
Hello, I think postgresql is not running or doesnt use the 5432 port. Check
your processus.
Le 17 déc. 2010 21:25, "Christophe Pettus"  a écrit :
>
> On Dec 17, 2010, at 12:02 PM, armandoperico wrote:
>> On my local machine everything is running fine, but when i try to
>> deploy to a running server with apache (mod_wsgi), i'm getting the
>> following error (database related):
>>
>> Caught OperationalError while rendering: could not connect to server:
>> Permission denied
>> Is the server running on host "127.0.0.1" and accepting
>> TCP/IP connections on port 5432?
>
> What's your database configuration on the Apache machine?
>
> --
> -- Christophe Pettus
> x...@thebuild.com
>
> --
> 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.com
.
> For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.
>

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django vs Postgres Connection

2010-12-17 Thread Christophe Pettus

On Dec 17, 2010, at 12:02 PM, armandoperico wrote:
> On my local machine everything is running fine, but when i try to
> deploy to a running server with apache (mod_wsgi), i'm getting the
> following error (database related):
> 
> Caught OperationalError while rendering: could not connect to server:
> Permission denied
>   Is the server running on host "127.0.0.1" and accepting
>   TCP/IP connections on port 5432?

What's your database configuration on the Apache machine?

--
-- Christophe Pettus
   x...@thebuild.com

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Django vs Postgres Connection

2010-12-17 Thread armandoperico
Hi,
this is the first time i try to deploy a django project and i'm not
being able to solve a problem.

On my local machine everything is running fine, but when i try to
deploy to a running server with apache (mod_wsgi), i'm getting the
following error (database related):

Caught OperationalError while rendering: could not connect to server:
Permission denied
Is the server running on host "127.0.0.1" and accepting
TCP/IP connections on port 5432?

The fact is that when i try to connect to the database using psql -
U... is working fine, so postgree is working ok, it seems to be with
django :S

Exception Location: /usr/lib/python2.6/site-packages/django/db/
backends/postgresql_psycopg2/base.py in _cursor, line 136

this is my django version (just in case): 1.2.3

Anyone here has faced this problem ?
have any ideas?

Thanks

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



wsgi.file_wrapper failing silently

2010-12-17 Thread Brian Craft
I'm testing the patch for ticket 2131
(http://code.djangoproject.com/ticket/2131) on 1.2.3. I'm getting back
a 500 (internal server error) sometime after returning the
HttpResponseSendFile(), with nothing in the apache error log.

Any suggestions on how to debug 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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Multiple conditions on same field in JOIN over three models

2010-12-17 Thread Łukasz Rekucki
On 17 December 2010 19:20, Jonas H.  wrote:
> Hello!
>
> Assuming the following data model:
>
> +--+                +--+                   +-+
> | Blog | has many (1:n) | Post | tagged with (n:m) | Tag |
> +--+                +--+                   +-+
>
> I want to filter out all blogs that have a post tagged with "foo" and "bar"
> (the same post satisfying *both* conditions).
>
> How would that query look like? Intuitively I'd say
>
>    Blog.objects.filter(post__tags__name="foo",
>                        post__tags__name="bar")
>
> but obviously that's a SyntaxError because of the repeated keyword argument
> to filter(). I also tried Q() objects but that generates some totally
> unrelated queries.

In [9]: print  Blog.objects.filter(Q(post__tags__name="foo") &
Q(post__tags__name="bar")).query

SELECT "simple_blog"."id"
FROM "simple_blog"
INNER JOIN "simple_post" ON ("simple_blog"."id" =
"simple_post"."blog_id")
INNER JOIN "simple_post_tags" ON ("simple_post"."id" =
"simple_post_tags"."post_id")
INNER JOIN "simple_tag" ON ("simple_post_tags"."tag_id" =
"simple_tag"."id")
WHERE ("simple_tag"."name" = foo  AND "simple_tag"."name" = bar )

Looks related. It's exactly what you specified, but conditions you
gave are just impossible to satisfy.

Your task is a bit more complicated to do in SQL:

Blog.objects.filter(post_tags__name__in=["foo",
"bar"]).annotate(match_count=Count('post__tags')).filter(match_count=2)

This should give you the right results.

-- 
Łukasz Rekucki

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Multiple conditions on same field in JOIN over three models

2010-12-17 Thread Jonas H.

On 12/17/2010 08:21 PM, Javier Guerra Giraldez wrote:

Blog.objects.filter(post__tags__name="foo").filter(post__tags__name="bar")


That's "get all blogs that have at least one post tagged with 'foo' and 
one post tagged with 'bar'", not requiring that *one post* matches 
*both* conditions.


--
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Multiple conditions on same field in JOIN over three models

2010-12-17 Thread Javier Guerra Giraldez
On Fri, Dec 17, 2010 at 1:20 PM, Jonas H.  wrote:
> Blog.objects.filter(post__tags__name="foo",
>                        post__tags__name="bar")

untested:

Blog.objects.filter(post__tags__name="foo").filter(post__tags__name="bar")

-- 
Javier

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: PyDev Django Debugging

2010-12-17 Thread Tim Sawyer

Hi,

You need to get it working in the dev server first, as you'll need that 
to debug with (I think).


You need to modify the pythonpath so it can see your code.

Modify manage.py in (1) and try running the dev server with:

  python manage.py runserver.

You'll need something like this at the top of manage.py

  import sys
  sys.path = ['/path/to/web/sites/mysite', '/path/to/web/sites/app'] + 
sys.path


Tim.


On 17/12/10 15:03, MLG wrote:

Hi Tim,

Thank you for your prompt response.

The "runserver --noreload" is in place as well in the arguments tab. I
have already set this option. The truth is that i haven't tried to run
the application in the development server but directly in the apache.

The structure is as follow:
1)web/sites/mysite
2)web/sites/app/basesite

The (1) is the main project which will contain a lot of applications
(INSTALLED_APPS). Also, it has the manage.py, settings.py, urls.py,
etc
(2) is the "basesite" application. It contains only urls.py. models.py
and media_urls.py at this time (no manage.py - not sure if this is the
problem).

Thank you.

MLG


On Dec 17, 4:51 pm, "Tim Sawyer"  wrote:

Here's my instructions for debugging in PyDev, hope that helps:

http://drumcoder.co.uk/blog/2010/apr/21/debugging-django-pydev/

This is done using the development server, not Apache, from within Eclipse.

Does your app work in the development server?

Tim.


Hi,



I am new to Django trying to port a web site from PHP to Django. I use
Apache web server and I have a problem with the debugging. I use
Aptana PyDev as IDE and i want to use the debugger in the toolbar. I
define the workspace in the the debug configuration as well as the
main module (manage.py). I have 2 APPS defined in INSTALLED_APPS in
settings.py. For example the names of the apps are: "basesite" and
"mysite". "mysite" app is located in the current directory, which
contains manage.py, settings.py, urls.py, etc. On the other hand,
"basesite" is located in another path (../../apps/basesite/). When i
click on Debug, i get an error: "Error no module name basesite". It
seems that it is not visible.
However, the application works properly in a run mode (not debug)
using the apache web server. The only issue is that i do not know what
i have to configure or what i miss in the debugging...



I would appreciate if you could help me.



Thank you in advance!



MLG



--
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.com.
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.




--
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



get request from an java API to DJango

2010-12-17 Thread sami nathan
THANKS FOR NOTIFICATION
 Hi i am newbie to django i am having task that want to
get request from an java API and give Response to the same API (To act
as an server ) So i am having WSDL file for the JAVA API
I decided to do that in ZSI WEB SERVICE and i generated server file
using wsdl2py cmmd  and according to tutorial i am seeing i want to
overrriden the class in the server file but i am getting error Type
error unbound method __init__() must be called with TypeCode
instance as first argument (got String instance instead)" i am
getting word from that API and i am returning the same word   what
this error says clearly?  So i am  finding little bit difficult in the
ZSI is there Any other method to do the above task please suggest me
At last clearly now i need to get request from that API and parse it

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Multiple conditions on same field in JOIN over three models

2010-12-17 Thread Jonas H.

Hello!

Assuming the following data model:

+--++--+   +-+
| Blog | has many (1:n) | Post | tagged with (n:m) | Tag |
+--++--+   +-+

I want to filter out all blogs that have a post tagged with "foo" and 
"bar" (the same post satisfying *both* conditions).


How would that query look like? Intuitively I'd say

Blog.objects.filter(post__tags__name="foo",
post__tags__name="bar")

but obviously that's a SyntaxError because of the repeated keyword 
argument to filter(). I also tried Q() objects but that generates some 
totally unrelated queries.


The docs only have an example with two conditions against different 
fields (in topics/db/queries:"Spanning multi-valued relationships").


Thanks!
Jonas

--
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to get a web development job (i.e. Django/Python) if someone is an amateur programmer?

2010-12-17 Thread Ken Huang
OP here.

I've got a still-live Digg-like PHP site that I built two years ago with a
few buddies. How much cred does that buy me if I'm looking for a Django job?
Do I need to specifically build and/or open source Django?

Thanks for the advice guys - much appreciated!

On Fri, Dec 17, 2010 at 1:10 PM, garagefan  wrote:

> I was once in your shoes. No real resume experience to show... no
> sites to display my knowledge.
>
> My advice... makes more friends. It's all in who you know. Met some at
> an intro html course at a community college, ended up being good
> friends. He was a developer already, but a few years later he tells me
> about a company he got placed at and said I could easily do the
> work... then he helped me get an interview, then I got hired...
> knowing basic stuff.
>
> Moral of the story, network
>
> On Dec 17, 12:03 pm, Dopster  wrote:
> > *This is a question that can be generalized for any other amateur
> > programmers looking to get into software development, and specifically
> > startups. I specify Django/Python in my own details below, but it can be
> > replaced with PHP, Ruby, etc.*
> >
> > As an amateur, how could I position myself to get in the door at an
> > established startup (i.e., not founding team) or web dev shop as a junior
> > Django/[insert language/framework here] developer? What could I do that
> > would give me a chance of getting a job? My guess is that actually
> building
> > something is the right way to go about this?
> >
> > Build a really simple web app? Build a web resume? Start a technical
> blog?
> > Contribute to open source? (though as an amateur, making meaningful
> > contributions is unlikely...)
> > --
> >
> > My own personal details, as to define what I mean by "amateur":
> >
> > Academic CS knowledge:
> >
> >- Non-CS degree
> >- Two Java courses in college as a non-CS engineer (4+ years ago),
> which
> >I admittedly have since forgotten, but helped me establish...
> >- Comfort with basic CS elements (i.e., classes, functions, basic data
> >structures, control flow tools, etc.)
> >
> > Practical experience (from a failed startup and work):
> >
> >- 1 year of HTML/CSS/JS
> >- 1 year of PHP
> >- 3 years of SQL (mySQL, Oracle, MS Access)
> >- 2 years of VBA development in Excel/Access (front-end and back-end)
>
> --
> 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.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to get a web development job (i.e. Django/Python) if someone is an amateur programmer?

2010-12-17 Thread garagefan
I was once in your shoes. No real resume experience to show... no
sites to display my knowledge.

My advice... makes more friends. It's all in who you know. Met some at
an intro html course at a community college, ended up being good
friends. He was a developer already, but a few years later he tells me
about a company he got placed at and said I could easily do the
work... then he helped me get an interview, then I got hired...
knowing basic stuff.

Moral of the story, network

On Dec 17, 12:03 pm, Dopster  wrote:
> *This is a question that can be generalized for any other amateur
> programmers looking to get into software development, and specifically
> startups. I specify Django/Python in my own details below, but it can be
> replaced with PHP, Ruby, etc.*
>
> As an amateur, how could I position myself to get in the door at an
> established startup (i.e., not founding team) or web dev shop as a junior
> Django/[insert language/framework here] developer? What could I do that
> would give me a chance of getting a job? My guess is that actually building
> something is the right way to go about this?
>
> Build a really simple web app? Build a web resume? Start a technical blog?
> Contribute to open source? (though as an amateur, making meaningful
> contributions is unlikely...)
> --
>
> My own personal details, as to define what I mean by "amateur":
>
> Academic CS knowledge:
>
>    - Non-CS degree
>    - Two Java courses in college as a non-CS engineer (4+ years ago), which
>    I admittedly have since forgotten, but helped me establish...
>    - Comfort with basic CS elements (i.e., classes, functions, basic data
>    structures, control flow tools, etc.)
>
> Practical experience (from a failed startup and work):
>
>    - 1 year of HTML/CSS/JS
>    - 1 year of PHP
>    - 3 years of SQL (mySQL, Oracle, MS Access)
>    - 2 years of VBA development in Excel/Access (front-end and back-end)

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



One project, many apps, how to share single user profile

2010-12-17 Thread donn

Hi,
I hope someone can give me a hand.

I'd like to have a *single* UserProfile table/model which is *shared* 
across many apps, much like auth_user is.


--- setup info ---
Django 1.2.1 on a recent Linux system. All pretty up-to-date.

One project (X). Many apps (A,B,C). The url, say: *.home.box, where I 
have setup fake (/etc/hosts) subdomains to localhost as A.home.box etc.


I have an Apache VirtualHost per name and they each point to a .wsgi 
file which, in turn, points to a settings_*.py file per name.
(I *think* this all means each "app" is running in a kind of sandbox -- 
I really don't know what apache processes are -- so it's like three 
different web-sites all running from a (mostly) common directory 
structure and each one has a single instance of the settings pertinent 
to it.)


This, astonishingly, seems to work. All good so far.
--- ---

If a user who is not logged-in (i.e. no cookie) hits A|B|C.home.box I'd 
like them to get sent to A.home.box/login

Once they are logged-in, they should be able to visit B|C.home.box

So far they all have one table; the auth_user one. I have a sqlite db 
which all three apps share.


I'd like to have a single UserProfile table/model which is shared across 
all three apps.


I tried the way the docs suggest and used AUTH_PROFILE_MODULE, but that 
gets wired to 'A' (for example) but then I can't seem to get_profile() 
from request.user in views in B or C (I get some kind of can't find 
A.UserProfile error.)


I did manage to get A_userprofilebase, B_userprofile and C_userprofile 
-- but that's three tables! I have not yet hacked a way to reach the 
user profile from the user.
(I am doing this by subclassing a model: A has the main class, 
userprofilebase, with all the profile fields. B and C subclass that as 
userprofile.)
I don't know quite what this will all mean for situations like deleting 
a user -- I'd have to go look in three places to completely delete their 
profile too.


I need to restrict who can visit what 'sites' (some users can hit B, 
some C and some both), so the profile table would hold info about this 
kind of thing.



Right, clear as mud I hope :)

\d



--
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to get a web development job (i.e. Django/Python) if someone is an amateur programmer?

2010-12-17 Thread Shawn Milochik
As someone who has hired a couple of people just like you in the past 
year, here's my response. Others may have different standards.


Having links to sites you've developed is good.

Having links to a github account with public projects is great.

A resume with bad spelling, grammar, or obviously "fluffed up" 
descriptions of your experience is a great way to get overlooked.


However, beyond any of those things, the one magical way to get my 
attention is to indicate that you love what you do by showing that 
you've done a lot of programming that you did NOT do for school or work.


I'd rather bring in someone for an interview with no CS degree who 
stayed up half the night struggling with a personal project than someone 
with a degree who doesn't seem to have done any coding for fun.


Shawn

--
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Forbidden (403) - CSRF verification failed. Request aborted.

2010-12-17 Thread Daniel Roseman
It's not just the view that processes the form that needs RequestContext - the 
one that generates it does too. Normally these are the same view, but it looks 
from your code that you are posting to a different view. Perhaps you could show 
the code of the other one and we'll see what is wrong with it. 
-- 
DR 

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to get a web development job (i.e. Django/Python) if someone is an amateur programmer?

2010-12-17 Thread Carlos Daniel Ruvalcaba Valenzuela
I founded my own startup 2 years ago, personally I can tell you that
having open source work published talks very well of you, even if is
not your own project but substantial contributions.

Open Source gives you the opportunity to develop your skills and show
them to the world, personally I look for people with OSS background as
they most likely already know the tools such as VCS, bug trackers,
etc.

Try building a few apps and sites to get a bit of experience
developing those kind of projects.

Admittedly, there isn't a silver bullet, but doing OSS will at least
get you contacts, I personally have received Jobs and offers just
because I'm a django/python developer and listed in a few sites (such
as djangopeople).

Regards,
Carlos Daniel Ruvalcaba Valenzuela
Blackchair Software
http://www.blackchairsoft.com/


On Fri, Dec 17, 2010 at 10:03 AM, Dopster  wrote:
> This is a question that can be generalized for any other amateur programmers
> looking to get into software development, and specifically startups. I
> specify Django/Python in my own details below, but it can be replaced with
> PHP, Ruby, etc.
>
> As an amateur, how could I position myself to get in the door at an
> established startup (i.e., not founding team) or web dev shop as a junior
> Django/[insert language/framework here] developer? What could I do that
> would give me a chance of getting a job? My guess is that actually building
> something is the right way to go about this?
>
> Build a really simple web app? Build a web resume? Start a technical blog?
> Contribute to open source? (though as an amateur, making meaningful
> contributions is unlikely...)
>
> 
>
> My own personal details, as to define what I mean by "amateur":
>
> Academic CS knowledge:
>
> Non-CS degree
> Two Java courses in college as a non-CS engineer (4+ years ago), which I
> admittedly have since forgotten, but helped me establish...
> Comfort with basic CS elements (i.e., classes, functions, basic data
> structures, control flow tools, etc.)
>
> Practical experience (from a failed startup and work):
>
> 1 year of HTML/CSS/JS
> 1 year of PHP
> 3 years of SQL (mySQL, Oracle, MS Access)
> 2 years of VBA development in Excel/Access (front-end and back-end)
>
> --
> 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.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



How to get a web development job (i.e. Django/Python) if someone is an amateur programmer?

2010-12-17 Thread Dopster
 

*This is a question that can be generalized for any other amateur 
programmers looking to get into software development, and specifically 
startups. I specify Django/Python in my own details below, but it can be 
replaced with PHP, Ruby, etc.*

As an amateur, how could I position myself to get in the door at an 
established startup (i.e., not founding team) or web dev shop as a junior 
Django/[insert language/framework here] developer? What could I do that 
would give me a chance of getting a job? My guess is that actually building 
something is the right way to go about this? 

Build a really simple web app? Build a web resume? Start a technical blog? 
Contribute to open source? (though as an amateur, making meaningful 
contributions is unlikely...)
--

My own personal details, as to define what I mean by "amateur":

Academic CS knowledge:

   - Non-CS degree
   - Two Java courses in college as a non-CS engineer (4+ years ago), which 
   I admittedly have since forgotten, but helped me establish...
   - Comfort with basic CS elements (i.e., classes, functions, basic data 
   structures, control flow tools, etc.)

Practical experience (from a failed startup and work):

   - 1 year of HTML/CSS/JS
   - 1 year of PHP
   - 3 years of SQL (mySQL, Oracle, MS Access)
   - 2 years of VBA development in Excel/Access (front-end and back-end)

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Date localization

2010-12-17 Thread eka (Esteban)
Fixed thanks!

On Dec 17, 1:29 pm, "eka (Esteban)"  wrote:
> It tries both (en_US, en) but import_module fails to import it
>
> On Dec 17, 12:58 pm, "eka (Esteban)"  wrote:
>
> > debugging found that is trying to open *** ImportError: No module
> > named formats.en_US.formats
>
> > en_US ? shouldn't be 'en' ?
>
> > On Dec 17, 12:40 pm, "eka (Esteban)"  wrote:
>
> > > Any reason why django is not reading from my FORMAT_MODULE_PATH ?
> > > USE_L10N = True, USE_I18N = True
> > > the date is transformed but not to my format but to the one in
> > > django.conf.locale
> > > django v1.2.3

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Date localization

2010-12-17 Thread eka (Esteban)
It tries both (en_US, en) but import_module fails to import it

On Dec 17, 12:58 pm, "eka (Esteban)"  wrote:
> debugging found that is trying to open *** ImportError: No module
> named formats.en_US.formats
>
> en_US ? shouldn't be 'en' ?
>
> On Dec 17, 12:40 pm, "eka (Esteban)"  wrote:
>
> > Any reason why django is not reading from my FORMAT_MODULE_PATH ?
> > USE_L10N = True, USE_I18N = True
> > the date is transformed but not to my format but to the one in
> > django.conf.locale
> > django v1.2.3

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: tinymce

2010-12-17 Thread Aljoša Mohorović
On Fri, Dec 17, 2010 at 3:27 PM, alecx
 wrote:
> I integrated django-tinymce into my application. Now I can edit the
> text in the former textarea field.
> But when I submit the form, the field is empty.
> I am not able to figure out why the text I wrote in the editor field
> is not submitted.
> Has someone a tip for me?

please post your views.py and template code, at least parts with form
logic and related stuff.


Aljosa

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Date localization

2010-12-17 Thread eka (Esteban)
debugging found that is trying to open *** ImportError: No module
named formats.en_US.formats

en_US ? shouldn't be 'en' ?


On Dec 17, 12:40 pm, "eka (Esteban)"  wrote:
> Any reason why django is not reading from my FORMAT_MODULE_PATH ?
> USE_L10N = True, USE_I18N = True
> the date is transformed but not to my format but to the one in
> django.conf.locale
> django v1.2.3

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: wikileaks cables on a django site

2010-12-17 Thread Andre Terra
Love the idea, but where's the magic? It's really lacking a django pony!


On Fri, Dec 17, 2010 at 12:25, ahppub  wrote:

> Check this out, WikiLeaks cables hosted on a Django site :)
> http://www.dazzlepod.com/cable/
>
> --
> 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.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Date localization

2010-12-17 Thread eka (Esteban)
Any reason why django is not reading from my FORMAT_MODULE_PATH ?
USE_L10N = True, USE_I18N = True
the date is transformed but not to my format but to the one in
django.conf.locale
django v1.2.3

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Forbidden (403) - CSRF verification failed. Request aborted.

2010-12-17 Thread hank23
I have pretty much completed the intro. tutorial for django. I'm now
trying to add some actual updating screens to the existing site, to
experiment and also to try to figure out more how everything works.
I'm currently trying to code an "addpoll" screen which I've coded to
look like this:

Add Poll Screen

{% if error_message %}{{ error_message }}{%
endif %}


{% csrf_token %}
QUESTION: 






I'm able to display the above screen just fine, but when I click the
"addpoll" button I get the 403 error listed above. I have currently
coded the view that I'm trying to post to like this:

def addpoll(request):
dctnry = {'error_message': 'No new poll data added'}
return render_to_response('polls/addpoll.html', dctnry,
 
context_instance=RequestContext(request))

just to see if I can get and informational error message to be
displayed on the screen. So can someone explain what's wrong with my
addpoll view and/or the screen code above?  I also need to figure out
how to extract the screen data out of the request, in my views. I'd
very much appreciate any help in trying to figure this out. Thanks.

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: JavaScript src files not found.

2010-12-17 Thread Vovk Donets
2010/12/17 Robert Steckroth 

> Hey coders, Where would stuff like .js src files go in a Django powered
> Website?
> ERROR -->  09:20:08.016: Network: GET
> http://localhost:8000/users/PBUi/mouse.js [HTTP/1.0 404 NOT FOUND 30ms]
> ERROR --> 09:20:07.823: Network: GET
> http://localhost:8000/users/sylvester.js [HTTP/1.0 404 NOT FOUND 11ms]
>
> There is many of these files to include for a entire program included in my
> home page.
> This is in the mySite/templates/users directory in the index.html file.
> What is my fundamental design flaw?
>

if i understand you correctly:
in settings.py theres is a lines
# Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/"
MEDIA_ROOT = /absolute/path
# URL that handles the media served from MEDIA_ROOT.
# Example: "http://media.lawrence.com;
MEDIA_URL = "/media/"
**so in a template you need specify path to media like this:
{{MEDIA_URL}}path/to/my/cript.js
But keep in mind that this variable must be passed into template via context
processor ("django.core.context_processors.media", ) or directly from view.
As for regular design flow read django manual. There is to much to say in
one letter.
*
Vovk Donets*
 python developer

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: PyDev Django Debugging

2010-12-17 Thread MLG
Hi Tim,

Thank you for your prompt response.

The "runserver --noreload" is in place as well in the arguments tab. I
have already set this option. The truth is that i haven't tried to run
the application in the development server but directly in the apache.

The structure is as follow:
1)web/sites/mysite
2)web/sites/app/basesite

The (1) is the main project which will contain a lot of applications
(INSTALLED_APPS). Also, it has the manage.py, settings.py, urls.py,
etc
(2) is the "basesite" application. It contains only urls.py. models.py
and media_urls.py at this time (no manage.py - not sure if this is the
problem).

Thank you.

MLG


On Dec 17, 4:51 pm, "Tim Sawyer"  wrote:
> Here's my instructions for debugging in PyDev, hope that helps:
>
> http://drumcoder.co.uk/blog/2010/apr/21/debugging-django-pydev/
>
> This is done using the development server, not Apache, from within Eclipse.
>
> Does your app work in the development server?
>
> Tim.
>
> > Hi,
>
> > I am new to Django trying to port a web site from PHP to Django. I use
> > Apache web server and I have a problem with the debugging. I use
> > Aptana PyDev as IDE and i want to use the debugger in the toolbar. I
> > define the workspace in the the debug configuration as well as the
> > main module (manage.py). I have 2 APPS defined in INSTALLED_APPS in
> > settings.py. For example the names of the apps are: "basesite" and
> > "mysite". "mysite" app is located in the current directory, which
> > contains manage.py, settings.py, urls.py, etc. On the other hand,
> > "basesite" is located in another path (../../apps/basesite/). When i
> > click on Debug, i get an error: "Error no module name basesite". It
> > seems that it is not visible.
> > However, the application works properly in a run mode (not debug)
> > using the apache web server. The only issue is that i do not know what
> > i have to configure or what i miss in the debugging...
>
> > I would appreciate if you could help me.
>
> > Thank you in advance!
>
> > MLG
>
> > --
> > 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.com.
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



JavaScript src files not found.

2010-12-17 Thread Robert Steckroth
Hey coders, Where would stuff like .js src files go in a Django powered
Website?
ERROR -->  09:20:08.016: Network: GET
http://localhost:8000/users/PBUi/mouse.js [HTTP/1.0 404 NOT FOUND 30ms]
ERROR --> 09:20:07.823: Network: GET
http://localhost:8000/users/sylvester.js [HTTP/1.0 404 NOT FOUND 11ms]

There is many of these files to include for a entire program included in my
home page.
This is in the mySite/templates/users directory in the index.html file.
What is my fundamental design flaw?
-- 
*Bringing game to younix*
Bust0ut Entertainment  ---
PureBreedDefense.com --> TheLinuxGame.com --> PBDefence.com
"Finding the exit without looking"

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: PyDev Django Debugging

2010-12-17 Thread Tim Sawyer
Here's my instructions for debugging in PyDev, hope that helps:

http://drumcoder.co.uk/blog/2010/apr/21/debugging-django-pydev/

This is done using the development server, not Apache, from within Eclipse.

Does your app work in the development server?

Tim.

> Hi,
>
> I am new to Django trying to port a web site from PHP to Django. I use
> Apache web server and I have a problem with the debugging. I use
> Aptana PyDev as IDE and i want to use the debugger in the toolbar. I
> define the workspace in the the debug configuration as well as the
> main module (manage.py). I have 2 APPS defined in INSTALLED_APPS in
> settings.py. For example the names of the apps are: "basesite" and
> "mysite". "mysite" app is located in the current directory, which
> contains manage.py, settings.py, urls.py, etc. On the other hand,
> "basesite" is located in another path (../../apps/basesite/). When i
> click on Debug, i get an error: "Error no module name basesite". It
> seems that it is not visible.
> However, the application works properly in a run mode (not debug)
> using the apache web server. The only issue is that i do not know what
> i have to configure or what i miss in the debugging...
>
> I would appreciate if you could help me.
>
> Thank you in advance!
>
> MLG
>
> --
> 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.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



PyDev Django Debugging

2010-12-17 Thread MLG
Hi,

I am new to Django trying to port a web site from PHP to Django. I use
Apache web server and I have a problem with the debugging. I use
Aptana PyDev as IDE and i want to use the debugger in the toolbar. I
define the workspace in the the debug configuration as well as the
main module (manage.py). I have 2 APPS defined in INSTALLED_APPS in
settings.py. For example the names of the apps are: "basesite" and
"mysite". "mysite" app is located in the current directory, which
contains manage.py, settings.py, urls.py, etc. On the other hand,
"basesite" is located in another path (../../apps/basesite/). When i
click on Debug, i get an error: "Error no module name basesite". It
seems that it is not visible.
However, the application works properly in a run mode (not debug)
using the apache web server. The only issue is that i do not know what
i have to configure or what i miss in the debugging...

I would appreciate if you could help me.

Thank you in advance!

MLG

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



wikileaks cables on a django site

2010-12-17 Thread ahppub
Check this out, WikiLeaks cables hosted on a Django site :)
http://www.dazzlepod.com/cable/

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



tinymce

2010-12-17 Thread alecx
Hi,

I integrated django-tinymce into my application. Now I can edit the
text in the former textarea field.
But when I submit the form, the field is empty.
I am not able to figure out why the text I wrote in the editor field
is not submitted.
Has someone a tip for me?
Thanks in advance.

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: [OFF-Topic] Cache django and get server datetime with a lighter approach

2010-12-17 Thread Javier Guerra Giraldez
On Fri, Dec 17, 2010 at 5:57 AM, Michel Thadeu Sabchuk
 wrote:
> What do you suggest me? Is django too expensive to serve this datetime
> or may I use another scripting language directly from nginx, Maybe PHP
> or Perl?

PHP/Perl are at least on the same order of magnitude as Python/Django.

If you want to mix nginx-cached content and dynamic content at the
same time, you have to use nginx's SSI (server side includes), there's
an example very similar to your case in nginx website.

in short, you write a small template that includes most of the content
from one (internal) URL and the most variable part from another one.
initially both pieces would be handled separately, calling whatever
handler is registered (likely Django), but each piece would be cached
separately, so only the most variable part would keep calling the
backend scripts.

-- 
Javier

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django as huge image host

2010-12-17 Thread Shamail Tayyab

> Google for X-SendFile
>
Hey! This one looks like exactly what I want... I'll give it a shot.

Thanks

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django as huge image host

2010-12-17 Thread Shamail Tayyab
> Does your CDN offers statistics? I use rackspace cloud files and I
> know there is log files I can rely on. I didn't used it yet but maybe
> it's a choice...

Hi,

   No, we don't yet have a CDN, its a prospect, a costly prospect.
Thanks

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django as huge image host

2010-12-17 Thread Shamail Tayyab

> I'm not sure this is even a task for Django. If your primary concern is 
> performance, try doing this directly in Apache or another web server via 
> rewrite rules and use the access logs to do the accounting. Apache is good at 
> access statistics.
>
> If your primary concern is statistics, there is no way you can get exact 
> figures. There may be any number of caching mechanisms between you and the 
> client that you don't control so GET requests may never reach your server. 
> Anyway, at this level there's no such thing as a "cdn version" because you 
> are supposedly in control of the web server that does the mapping from a GET 
> request to a file on the filesystem.
>

Hi,

   Yes, the site and other functionality is being powered by Django,
its hardly related to Django. True, we are in control of the server,
but we can use another virtual host for CDN or something. Yes, log
files can be a good idea, but not optimal for much of the stats. I'll
get to it as last resort. Thanks

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



[OFF-Topic] Cache django and get server datetime with a lighter approach

2010-12-17 Thread Michel Thadeu Sabchuk
Hi guys,

I'm working on a group buying website like groupon. This page have a
regressive counter that tells the user how many time is available
before the end of the deal publishing.

I want to cache this site: I want to put nginx to serve memcached
directly and only when the page is not found in the memcached, go to
django. I already did it on another project and it worked very well.

The problem here is the current time of the server, caching the site
will broke the regressive counter function.

I planning to cache all the site but the server datetime. I will serve
the datetime as a javascript file and use it on a javascript function,
this way, the cached homepage can refer to the not cached javascript
file.

What do you suggest me? Is django too expensive to serve this datetime
or may I use another scripting language directly from nginx, Maybe PHP
or Perl?

Thanks for any advice!

--
Michel Sabchuk

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django as huge image host

2010-12-17 Thread Tom Evans
On Fri, Dec 17, 2010 at 9:28 AM, Shamail Tayyab  wrote:
> Hi,
>
>    I have this situation..
>
> - We need to serve static files(images), lots of them, probably 100s
> of them per second.
>

Google for X-SendFile


Cheers

Tom

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django as huge image host

2010-12-17 Thread Michel Thadeu Sabchuk
Hi,

> I'm not sure this is even a task for Django. If your primary concern is 
> performance, try doing this directly in Apache or another web server via 
> rewrite rules and use the access logs to do the accounting. Apache is good at 
> access statistics.

Does your CDN offers statistics? I use rackspace cloud files and I
know there is log files I can rely on. I didn't used it yet but maybe
it's a choice...

--
Michel Sabchuk
http://turbosys.com.br/

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django as huge image host

2010-12-17 Thread Erik Cederstrand

Den 17/12/2010 kl. 10.28 skrev Shamail Tayyab:

>I have this situation..
> 
> - We need to serve static files(images), lots of them, probably 100s
> of them per second.
> 
> Our website is in Django and we need to support something like this:
> 
> 1. a URL like /xyz.jpg should open an image.
> 2. image should be accesibe via this path only because we associate
> some data while an image is served, viz number of hits, bandwidth
> consumed, hits per second etc.

I'm not sure this is even a task for Django. If your primary concern is 
performance, try doing this directly in Apache or another web server via 
rewrite rules and use the access logs to do the accounting. Apache is good at 
access statistics.

If your primary concern is statistics, there is no way you can get exact 
figures. There may be any number of caching mechanisms between you and the 
client that you don't control so GET requests may never reach your server. 
Anyway, at this level there's no such thing as a "cdn version" because you are 
supposedly in control of the web server that does the mapping from a GET 
request to a file on the filesystem.

Erik

smime.p7s
Description: S/MIME cryptographic signature


Django as huge image host

2010-12-17 Thread Shamail Tayyab
Hi,

I have this situation..

- We need to serve static files(images), lots of them, probably 100s
of them per second.

Our website is in Django and we need to support something like this:

1. a URL like /xyz.jpg should open an image.
2. image should be accesibe via this path only because we associate
some data while an image is served, viz number of hits, bandwidth
consumed, hits per second etc.

Prospects:
1. create something like cdn.sitename.com and on a hit to /xyz.png we
do something like

def servefile ( request ):
# save hit data
return HttpResponseRedirect ( "http://cdn.sitname.com/images/
identifier.jpg" )
# where identifier is some id for this image.

(problem here is, users may directly start using the cdn version
of URL and we'll never know whats going on)

2. directly serve image, something like

def servefile ( request ):
# save hit data
ofile = file ( os.path.join (settings.UPLOAD_DIR,
"identifier.jpg") )

wrapper = FileWrapper ( file(ofile) )
response = HttpResponse ( wrapper, content_type='image/jpg' )
response['Content-Disposition'] = 'inline; filename=' +
uiImage.filerealname
response['Content-Length'] = os.path.getsize(ofile)
return response

(problem here is:
 1. caching (which can be overcomed by methods like Etag and some
other ones)
 2. super slow. (this, on an Amazon EC2 normal instance cannot
past scale of 3-4images simultaneously :( ))


Please give me some good ways to do this.

Thanks and regards

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.