Re: Beginner's question about urls.py

2012-02-22 Thread shartha
Thanks for everyone for their help/time =)

On Feb 22, 10:19 pm, shartha  wrote:
> Jonathan, how did you conclude that?
>
> On Feb 22, 10:00 pm, Jonathan Paugh  wrote:
>
>
>
>
>
>
>
> > What puzzles me is thathttp://chekonam.info/claimsthat uWSGI doesn't
> > know about the project--presumably the one under /admin.
>
> > Is this relevant?
>
> > On 02/22/2012 10:45 PM, shartha wrote:
>
> > > The file I posted above is the actual file on my server. I don't think
> > > I have any conflicts in the urls.py. What are the databases that are
> > > created when you add 'django.contrib.admin' to your INSTALLED_APP and
> > > sync your database?
>
> > > On Feb 22, 9:27 pm, Stanwin Siow  wrote:
> > >> Check your urls.py there could be conflicting statements:
>
> > >>http://stackoverflow.com/questions/4174610/django-admin-page-not-foun...
>
> > >> Check out the stackoverflow question
>
> > >> Best Regards,
>
> > >> Stanwin Siow
>
> > >> On Feb 23, 2012, at 11:20 AM, shartha wrote:
>
> > >>> I have "django.contrib.admin" added to my INSTALLED_APP and database
> > >>> is also sync'ed!
>
> > >>> On Feb 22, 9:04 pm, Stanwin Siow  wrote:
> >  check your settings.py file to ensure that you have the admin line 
> >  uncommented in installed apps.
>
> >  Best Regards,
>
> >  Stanwin Siow
>
> >  On Feb 23, 2012, at 10:58 AM, shartha wrote:
>
> > > Hello,
>
> > > I am trying to deploy a simple django site. The host I have chosen
> > > installed django for me. But the problem is they have modified the
> > > files a little bit and it sometimes gets confusing for a novice person
> > > like me. Here is my question:
>
> > > This is the urls.py on the server:
> > > ===
> > > from django.conf.urls.defaults import patterns, include, url
>
> > > from django.shortcuts import render_to_response
> > > from django.contrib import admin
>
> > > admin.autodiscover()
>
> > > def index(request):
> > >    return render_to_response('index.html', {})
>
> > > urlpatterns = patterns('',
> > >    url(r'^$', 'hello.urls.index'),
> > >    url(r'^admin/', include(admin.site.urls)),
> > > )
> > > 
>
> > > Now I have done the django tutorial part 1 and part 2 up to the point
> > > where it asks you to uncomment 3 lines inthe urls.py. The lines that
> > > are extra in the above files are the ones that were in it by default.
> > > The problem I have is when I try to go to /domain/admin I get the
> > > following error:
>
> > > Page not found (404)
> > > Request Method:    GET
> > > Request URL:      http://chekonam.info/admin
> > > Using the URLconf defined in hello.urls, Django tried these URL
> > > patterns, in this order:
> > > ^$
> > > The current URL, admin, didn't match any of these.
>
> > > The django instance is installed in the hello folder. Could someone
> > > please tell me what's going on here? I could do all other steps in the
> > > tutorial without problem. But this one perplexes me!
>
> > > Thank you!
>
> > > --
> > > 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 
> > > athttp://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-users@googlegroups.com.
> > >>> To unsubscribe from this group, send email to 
> > >>> django-users+unsubscr...@googlegroups.com.
> > >>> For more options, visit this group 
> > >>> athttp://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-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Beginner's question about urls.py

2012-02-22 Thread shartha
PROBLEM SOLVED!
This was a host specific problem and the customer service helped me
solve it. I just needed to restart the application!

On Feb 22, 10:19 pm, shartha  wrote:
> Jonathan, how did you conclude that?
>
> On Feb 22, 10:00 pm, Jonathan Paugh  wrote:
>
>
>
>
>
>
>
> > What puzzles me is thathttp://chekonam.info/claimsthat uWSGI doesn't
> > know about the project--presumably the one under /admin.
>
> > Is this relevant?
>
> > On 02/22/2012 10:45 PM, shartha wrote:
>
> > > The file I posted above is the actual file on my server. I don't think
> > > I have any conflicts in the urls.py. What are the databases that are
> > > created when you add 'django.contrib.admin' to your INSTALLED_APP and
> > > sync your database?
>
> > > On Feb 22, 9:27 pm, Stanwin Siow  wrote:
> > >> Check your urls.py there could be conflicting statements:
>
> > >>http://stackoverflow.com/questions/4174610/django-admin-page-not-foun...
>
> > >> Check out the stackoverflow question
>
> > >> Best Regards,
>
> > >> Stanwin Siow
>
> > >> On Feb 23, 2012, at 11:20 AM, shartha wrote:
>
> > >>> I have "django.contrib.admin" added to my INSTALLED_APP and database
> > >>> is also sync'ed!
>
> > >>> On Feb 22, 9:04 pm, Stanwin Siow  wrote:
> >  check your settings.py file to ensure that you have the admin line 
> >  uncommented in installed apps.
>
> >  Best Regards,
>
> >  Stanwin Siow
>
> >  On Feb 23, 2012, at 10:58 AM, shartha wrote:
>
> > > Hello,
>
> > > I am trying to deploy a simple django site. The host I have chosen
> > > installed django for me. But the problem is they have modified the
> > > files a little bit and it sometimes gets confusing for a novice person
> > > like me. Here is my question:
>
> > > This is the urls.py on the server:
> > > ===
> > > from django.conf.urls.defaults import patterns, include, url
>
> > > from django.shortcuts import render_to_response
> > > from django.contrib import admin
>
> > > admin.autodiscover()
>
> > > def index(request):
> > >    return render_to_response('index.html', {})
>
> > > urlpatterns = patterns('',
> > >    url(r'^$', 'hello.urls.index'),
> > >    url(r'^admin/', include(admin.site.urls)),
> > > )
> > > 
>
> > > Now I have done the django tutorial part 1 and part 2 up to the point
> > > where it asks you to uncomment 3 lines inthe urls.py. The lines that
> > > are extra in the above files are the ones that were in it by default.
> > > The problem I have is when I try to go to /domain/admin I get the
> > > following error:
>
> > > Page not found (404)
> > > Request Method:    GET
> > > Request URL:      http://chekonam.info/admin
> > > Using the URLconf defined in hello.urls, Django tried these URL
> > > patterns, in this order:
> > > ^$
> > > The current URL, admin, didn't match any of these.
>
> > > The django instance is installed in the hello folder. Could someone
> > > please tell me what's going on here? I could do all other steps in the
> > > tutorial without problem. But this one perplexes me!
>
> > > Thank you!
>
> > > --
> > > 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 
> > > athttp://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-users@googlegroups.com.
> > >>> To unsubscribe from this group, send email to 
> > >>> django-users+unsubscr...@googlegroups.com.
> > >>> For more options, visit this group 
> > >>> athttp://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-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: import selenium

2012-02-22 Thread dizzydoc
@xina towner

Hi,
I have been working with selenium from quite a lot time.

There are three things you need to build and run functional test cases
using selenium.

Since selenium is a browser based testing environment you need a
server that serves it. So you need:
1. selenium-server-standalone-2.18.0.jar

For python to understand selenium functions you need a selenium
library. So you need:
2. selenium-2.19.1.tar.gz

And last you need someone to write the test cases for you! So you need
and IDE, a browser plugin that helps you build them
3. Selenium IDE

You may download it from here- http://seleniumhq.org/download/

HOW TO SETUP SELENIUM LIB:
Once you have downloaded selenium-2.19.1.tar.gz, extract it and move
to the extracted directory on command line.
Write the following command once you are in the selenium-2.19.1 dir:
$ python setup.py build
$ python setup.py install

If you encounter a setup tool error, you might need to install setup
tools. Read docs for how to do it or simply google :)

And if this doesnt work!! simply open the directory copy selenium py
(location: selenium-2.19.1/py/selenium/selenium.py) and paste it in
your dist-packages. Since selenium.py doesn't come with much
dependencies copying works, although its not ethical.

Hope this helps.

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



Re: Beginner's question about urls.py

2012-02-22 Thread shartha
Jonathan, how did you conclude that?

On Feb 22, 10:00 pm, Jonathan Paugh  wrote:
> What puzzles me is thathttp://chekonam.info/claims that uWSGI doesn't
> know about the project--presumably the one under /admin.
>
> Is this relevant?
>
> On 02/22/2012 10:45 PM, shartha wrote:
>
>
>
>
>
>
>
> > The file I posted above is the actual file on my server. I don't think
> > I have any conflicts in the urls.py. What are the databases that are
> > created when you add 'django.contrib.admin' to your INSTALLED_APP and
> > sync your database?
>
> > On Feb 22, 9:27 pm, Stanwin Siow  wrote:
> >> Check your urls.py there could be conflicting statements:
>
> >>http://stackoverflow.com/questions/4174610/django-admin-page-not-foun...
>
> >> Check out the stackoverflow question
>
> >> Best Regards,
>
> >> Stanwin Siow
>
> >> On Feb 23, 2012, at 11:20 AM, shartha wrote:
>
> >>> I have "django.contrib.admin" added to my INSTALLED_APP and database
> >>> is also sync'ed!
>
> >>> On Feb 22, 9:04 pm, Stanwin Siow  wrote:
>  check your settings.py file to ensure that you have the admin line 
>  uncommented in installed apps.
>
>  Best Regards,
>
>  Stanwin Siow
>
>  On Feb 23, 2012, at 10:58 AM, shartha wrote:
>
> > Hello,
>
> > I am trying to deploy a simple django site. The host I have chosen
> > installed django for me. But the problem is they have modified the
> > files a little bit and it sometimes gets confusing for a novice person
> > like me. Here is my question:
>
> > This is the urls.py on the server:
> > ===
> > from django.conf.urls.defaults import patterns, include, url
>
> > from django.shortcuts import render_to_response
> > from django.contrib import admin
>
> > admin.autodiscover()
>
> > def index(request):
> >    return render_to_response('index.html', {})
>
> > urlpatterns = patterns('',
> >    url(r'^$', 'hello.urls.index'),
> >    url(r'^admin/', include(admin.site.urls)),
> > )
> > 
>
> > Now I have done the django tutorial part 1 and part 2 up to the point
> > where it asks you to uncomment 3 lines inthe urls.py. The lines that
> > are extra in the above files are the ones that were in it by default.
> > The problem I have is when I try to go to /domain/admin I get the
> > following error:
>
> > Page not found (404)
> > Request Method:    GET
> > Request URL:      http://chekonam.info/admin
> > Using the URLconf defined in hello.urls, Django tried these URL
> > patterns, in this order:
> > ^$
> > The current URL, admin, didn't match any of these.
>
> > The django instance is installed in the hello folder. Could someone
> > please tell me what's going on here? I could do all other steps in the
> > tutorial without problem. But this one perplexes me!
>
> > Thank you!
>
> > --
> > 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 
> > athttp://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-users@googlegroups.com.
> >>> To unsubscribe from this group, send email to 
> >>> django-users+unsubscr...@googlegroups.com.
> >>> For more options, visit this group 
> >>> athttp://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-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Beginner's question about urls.py

2012-02-22 Thread Jonathan Paugh
What puzzles me is that http://chekonam.info/ claims that uWSGI doesn't
know about the project--presumably the one under /admin.

Is this relevant?

On 02/22/2012 10:45 PM, shartha wrote:
> The file I posted above is the actual file on my server. I don't think
> I have any conflicts in the urls.py. What are the databases that are
> created when you add 'django.contrib.admin' to your INSTALLED_APP and
> sync your database?
> 
> 
> On Feb 22, 9:27 pm, Stanwin Siow  wrote:
>> Check your urls.py there could be conflicting statements:
>>
>> http://stackoverflow.com/questions/4174610/django-admin-page-not-foun...
>>
>> Check out the stackoverflow question
>>
>> Best Regards,
>>
>> Stanwin Siow
>>
>> On Feb 23, 2012, at 11:20 AM, shartha wrote:
>>
>>
>>
>>
>>
>>
>>
>>> I have "django.contrib.admin" added to my INSTALLED_APP and database
>>> is also sync'ed!
>>
>>> On Feb 22, 9:04 pm, Stanwin Siow  wrote:
 check your settings.py file to ensure that you have the admin line 
 uncommented in installed apps.
>>
 Best Regards,
>>
 Stanwin Siow
>>
 On Feb 23, 2012, at 10:58 AM, shartha wrote:
>>
> Hello,
>>
> I am trying to deploy a simple django site. The host I have chosen
> installed django for me. But the problem is they have modified the
> files a little bit and it sometimes gets confusing for a novice person
> like me. Here is my question:
>>
> This is the urls.py on the server:
> ===
> from django.conf.urls.defaults import patterns, include, url
>>
> from django.shortcuts import render_to_response
> from django.contrib import admin
>>
> admin.autodiscover()
>>
> def index(request):
>return render_to_response('index.html', {})
>>
> urlpatterns = patterns('',
>url(r'^$', 'hello.urls.index'),
>url(r'^admin/', include(admin.site.urls)),
> )
> 
>>
> Now I have done the django tutorial part 1 and part 2 up to the point
> where it asks you to uncomment 3 lines inthe urls.py. The lines that
> are extra in the above files are the ones that were in it by default.
> The problem I have is when I try to go to /domain/admin I get the
> following error:
>>
> Page not found (404)
> Request Method:GET
> Request URL:  http://chekonam.info/admin
> Using the URLconf defined in hello.urls, Django tried these URL
> patterns, in this order:
> ^$
> The current URL, admin, didn't match any of these.
>>
> The django instance is installed in the hello folder. Could someone
> please tell me what's going on here? I could do all other steps in the
> tutorial without problem. But this one perplexes me!
>>
> Thank you!
>>
> --
> 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 
> athttp://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-users@googlegroups.com.
>>> To unsubscribe from this group, send email to 
>>> django-users+unsubscr...@googlegroups.com.
>>> For more options, visit this group 
>>> athttp://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-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Beginner's question about urls.py

2012-02-22 Thread shartha
The file I posted above is the actual file on my server. I don't think
I have any conflicts in the urls.py. What are the databases that are
created when you add 'django.contrib.admin' to your INSTALLED_APP and
sync your database?


On Feb 22, 9:27 pm, Stanwin Siow  wrote:
> Check your urls.py there could be conflicting statements:
>
> http://stackoverflow.com/questions/4174610/django-admin-page-not-foun...
>
> Check out the stackoverflow question
>
> Best Regards,
>
> Stanwin Siow
>
> On Feb 23, 2012, at 11:20 AM, shartha wrote:
>
>
>
>
>
>
>
> > I have "django.contrib.admin" added to my INSTALLED_APP and database
> > is also sync'ed!
>
> > On Feb 22, 9:04 pm, Stanwin Siow  wrote:
> >> check your settings.py file to ensure that you have the admin line 
> >> uncommented in installed apps.
>
> >> Best Regards,
>
> >> Stanwin Siow
>
> >> On Feb 23, 2012, at 10:58 AM, shartha wrote:
>
> >>> Hello,
>
> >>> I am trying to deploy a simple django site. The host I have chosen
> >>> installed django for me. But the problem is they have modified the
> >>> files a little bit and it sometimes gets confusing for a novice person
> >>> like me. Here is my question:
>
> >>> This is the urls.py on the server:
> >>> ===
> >>> from django.conf.urls.defaults import patterns, include, url
>
> >>> from django.shortcuts import render_to_response
> >>> from django.contrib import admin
>
> >>> admin.autodiscover()
>
> >>> def index(request):
> >>>    return render_to_response('index.html', {})
>
> >>> urlpatterns = patterns('',
> >>>    url(r'^$', 'hello.urls.index'),
> >>>    url(r'^admin/', include(admin.site.urls)),
> >>> )
> >>> 
>
> >>> Now I have done the django tutorial part 1 and part 2 up to the point
> >>> where it asks you to uncomment 3 lines inthe urls.py. The lines that
> >>> are extra in the above files are the ones that were in it by default.
> >>> The problem I have is when I try to go to /domain/admin I get the
> >>> following error:
>
> >>> Page not found (404)
> >>> Request Method:    GET
> >>> Request URL:      http://chekonam.info/admin
> >>> Using the URLconf defined in hello.urls, Django tried these URL
> >>> patterns, in this order:
> >>> ^$
> >>> The current URL, admin, didn't match any of these.
>
> >>> The django instance is installed in the hello folder. Could someone
> >>> please tell me what's going on here? I could do all other steps in the
> >>> tutorial without problem. But this one perplexes me!
>
> >>> Thank you!
>
> >>> --
> >>> 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 
> >>> athttp://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-users@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://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-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: psycopg2, postgres9.1, Mac OS - problem with psycopg2

2012-02-22 Thread Will Tuladhar-Douglas
And to whomever wrote and applied those very patches, _thank you_. I discovered 
them after shifting to 1.4a and suddenly lots of things just work.

-WBTD.

On 23 Feb 2012, at 01:26, Jeff Heard wrote:

> Just as a followup to this, there are a few problems that have been patched 
> on Django with regards to Postgres 9.1.  They're not in the stable release, 
> but if you're using custom binary fields, such as PostGIS geometry, you will 
> need to search for the patch and apply it.  You may see '\x00' is not a UTF-8 
> code or something like that.  
> 
> On Wed, Feb 22, 2012 at 1:28 PM, Shawn Milochik  wrote:
> You can either add the proper path of pg_config to your PATH, or just extract 
> the psycopg2 and add the full path to pg_config into the config file it 
> contains then run 'python setup.py install' on the setup.py in the package.
> 


- - -- --- -  -
Will Tuladhar-Douglas 
Anthropology of Environments and Religions
Wellcome Trust Research Fellow, Nepal, 2011-12.
Visiting Scientist, ICIMOD SL/PR group.
tending.to/garden

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



Re: Beginner's question about urls.py

2012-02-22 Thread Stanwin Siow
Check your urls.py there could be conflicting statements:


http://stackoverflow.com/questions/4174610/django-admin-page-not-found-at-admin

Check out the stackoverflow question



Best Regards,

Stanwin Siow



On Feb 23, 2012, at 11:20 AM, shartha wrote:

> I have "django.contrib.admin" added to my INSTALLED_APP and database
> is also sync'ed!
> 
> On Feb 22, 9:04 pm, Stanwin Siow  wrote:
>> check your settings.py file to ensure that you have the admin line 
>> uncommented in installed apps.
>> 
>> Best Regards,
>> 
>> Stanwin Siow
>> 
>> On Feb 23, 2012, at 10:58 AM, shartha wrote:
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>>> Hello,
>> 
>>> I am trying to deploy a simple django site. The host I have chosen
>>> installed django for me. But the problem is they have modified the
>>> files a little bit and it sometimes gets confusing for a novice person
>>> like me. Here is my question:
>> 
>>> This is the urls.py on the server:
>>> ===
>>> from django.conf.urls.defaults import patterns, include, url
>> 
>>> from django.shortcuts import render_to_response
>>> from django.contrib import admin
>> 
>>> admin.autodiscover()
>> 
>>> def index(request):
>>>return render_to_response('index.html', {})
>> 
>>> urlpatterns = patterns('',
>>>url(r'^$', 'hello.urls.index'),
>>>url(r'^admin/', include(admin.site.urls)),
>>> )
>>> 
>> 
>>> Now I have done the django tutorial part 1 and part 2 up to the point
>>> where it asks you to uncomment 3 lines inthe urls.py. The lines that
>>> are extra in the above files are the ones that were in it by default.
>>> The problem I have is when I try to go to /domain/admin I get the
>>> following error:
>> 
>>> Page not found (404)
>>> Request Method:GET
>>> Request URL:  http://chekonam.info/admin
>>> Using the URLconf defined in hello.urls, Django tried these URL
>>> patterns, in this order:
>>> ^$
>>> The current URL, admin, didn't match any of these.
>> 
>>> The django instance is installed in the hello folder. Could someone
>>> please tell me what's going on here? I could do all other steps in the
>>> tutorial without problem. But this one perplexes me!
>> 
>>> Thank you!
>> 
>>> --
>>> 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 
>>> athttp://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-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-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Beginner's question about urls.py

2012-02-22 Thread shartha
I have "django.contrib.admin" added to my INSTALLED_APP and database
is also sync'ed!

On Feb 22, 9:04 pm, Stanwin Siow  wrote:
> check your settings.py file to ensure that you have the admin line 
> uncommented in installed apps.
>
> Best Regards,
>
> Stanwin Siow
>
> On Feb 23, 2012, at 10:58 AM, shartha wrote:
>
>
>
>
>
>
>
> > Hello,
>
> > I am trying to deploy a simple django site. The host I have chosen
> > installed django for me. But the problem is they have modified the
> > files a little bit and it sometimes gets confusing for a novice person
> > like me. Here is my question:
>
> > This is the urls.py on the server:
> > ===
> > from django.conf.urls.defaults import patterns, include, url
>
> > from django.shortcuts import render_to_response
> > from django.contrib import admin
>
> > admin.autodiscover()
>
> > def index(request):
> >    return render_to_response('index.html', {})
>
> > urlpatterns = patterns('',
> >    url(r'^$', 'hello.urls.index'),
> >    url(r'^admin/', include(admin.site.urls)),
> > )
> > 
>
> > Now I have done the django tutorial part 1 and part 2 up to the point
> > where it asks you to uncomment 3 lines inthe urls.py. The lines that
> > are extra in the above files are the ones that were in it by default.
> > The problem I have is when I try to go to /domain/admin I get the
> > following error:
>
> > Page not found (404)
> > Request Method:    GET
> > Request URL:      http://chekonam.info/admin
> > Using the URLconf defined in hello.urls, Django tried these URL
> > patterns, in this order:
> > ^$
> > The current URL, admin, didn't match any of these.
>
> > The django instance is installed in the hello folder. Could someone
> > please tell me what's going on here? I could do all other steps in the
> > tutorial without problem. But this one perplexes me!
>
> > Thank you!
>
> > --
> > 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 
> > athttp://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-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Beginner's question about urls.py

2012-02-22 Thread Stanwin Siow
check your settings.py file to ensure that you have the admin line uncommented 
in installed apps.



Best Regards,

Stanwin Siow



On Feb 23, 2012, at 10:58 AM, shartha wrote:

> Hello,
> 
> I am trying to deploy a simple django site. The host I have chosen
> installed django for me. But the problem is they have modified the
> files a little bit and it sometimes gets confusing for a novice person
> like me. Here is my question:
> 
> This is the urls.py on the server:
> ===
> from django.conf.urls.defaults import patterns, include, url
> 
> from django.shortcuts import render_to_response
> from django.contrib import admin
> 
> admin.autodiscover()
> 
> def index(request):
>return render_to_response('index.html', {})
> 
> urlpatterns = patterns('',
>url(r'^$', 'hello.urls.index'),
>url(r'^admin/', include(admin.site.urls)),
> )
> 
> 
> Now I have done the django tutorial part 1 and part 2 up to the point
> where it asks you to uncomment 3 lines inthe urls.py. The lines that
> are extra in the above files are the ones that were in it by default.
> The problem I have is when I try to go to /domain/admin I get the
> following error:
> 
> Page not found (404)
> Request Method:   GET
> Request URL:  http://chekonam.info/admin
> Using the URLconf defined in hello.urls, Django tried these URL
> patterns, in this order:
> ^$
> The current URL, admin, didn't match any of these.
> 
> 
> The django instance is installed in the hello folder. Could someone
> please tell me what's going on here? I could do all other steps in the
> tutorial without problem. But this one perplexes me!
> 
> Thank you!
> 
> -- 
> 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-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.



Beginner's question about urls.py

2012-02-22 Thread shartha
Hello,

I am trying to deploy a simple django site. The host I have chosen
installed django for me. But the problem is they have modified the
files a little bit and it sometimes gets confusing for a novice person
like me. Here is my question:

This is the urls.py on the server:
===
from django.conf.urls.defaults import patterns, include, url

from django.shortcuts import render_to_response
from django.contrib import admin

admin.autodiscover()

def index(request):
return render_to_response('index.html', {})

urlpatterns = patterns('',
url(r'^$', 'hello.urls.index'),
url(r'^admin/', include(admin.site.urls)),
)


Now I have done the django tutorial part 1 and part 2 up to the point
where it asks you to uncomment 3 lines inthe urls.py. The lines that
are extra in the above files are the ones that were in it by default.
The problem I have is when I try to go to /domain/admin I get the
following error:

Page not found (404)
Request Method: GET
Request URL:http://chekonam.info/admin
Using the URLconf defined in hello.urls, Django tried these URL
patterns, in this order:
^$
The current URL, admin, didn't match any of these.


The django instance is installed in the hello folder. Could someone
please tell me what's going on here? I could do all other steps in the
tutorial without problem. But this one perplexes me!

Thank you!

-- 
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.



Requesting suggestions on layout for simple "name" catalogs

2012-02-22 Thread Jair Trejo
I've got a system with three main tables, say "offices", "commercial
spaces" and "industrial properties". Many of their features, like the
type of glass of their windows, need to come from a catalog, so I have
a base class like:

class SimpleNameCatalog(models.Model):
name = models.CharField()
class Meta:
abstract = True


And a bunch of subclasses like:

class GlassType(SimpleNameCatalog):
pass

And add foreign keys from the three main tables to GlassType.

However, now I need separate glass types for each of "offices",
"commercial spaces" and "industrial properties". ¿How should I
implemente this?

Right now I'm using:

class GlassTypeOffice(SimpleNameCatalog):
pass
class GlassTypeIndustrialProperty(SimpleNameCatalog):
pass
class GlassTypeCommercialSpace(SimpleNameCatalog):
pass

for each catalog property, but it seems silly and exceedingly verbose.
Should I add a "type" field to SimpleNameCatalog and filter by that? I
don't like that option very much because I want to keep the separate
catalogs distinct in the admin interface.

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



Re: Converting a string representation of query to Django object (Q).

2012-02-22 Thread gowthaman ramasamy
True. But, Michael, your answer actually taught me another cool way i did 
not know before. So, thanks a bunch for that.

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



Re: Converting a string representation of query to Django object (Q).

2012-02-22 Thread Michael Elkins

On Wed, Feb 22, 2012 at 02:04:37PM -0800, Matt Schinckel wrote:

The other option, which should work in your case:

   expcodes = ['...', '...']

Result.objects.filter(analysis__experiment__experiment_code__in=expcodes)

Q objects are great, but not always needed.


I agree that this is the better solution since the Q objects are 
all testing the same field.


/me not seeing the forest through the trees

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



Re: Converting a string representation of query to Django object (Q).

2012-02-22 Thread gowthaman ramasamy
Wonderful! Both of them worked. Very importantly, both answers taught me 
new things. Thanks Matt. Thanks Michael.

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



Re: About managing dependencies in a collaborative development team and good practices.

2012-02-22 Thread Matt Schinckel
Not sure if it was mentioned earlier in this thread (couldn't find it), but 
what some people miss is that virtualenv is not just for development. You 
can, and should, deploy to a virtualenv on your server too.

Matt.

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



Re: Converting a string representation of query to Django object (Q).

2012-02-22 Thread Matt Schinckel
The other option, which should work in your case:

expcodes = ['...', '...']

Result.objects.filter(analysis__experiment__experiment_code__in=expcodes)

Q objects are great, but not always needed.

Matt.

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



Re: Converting a string representation of query to Django object (Q).

2012-02-22 Thread Michael Elkins

On Wed, Feb 22, 2012 at 01:15:04PM -0800, gowthaman ramasamy wrote:

I am trying to construct the following query at the end.
Result.objects.filter(Q(analysis__experiment__experiment_code="PyLS24")
|Q(analysis__experiment__experiment_code="PyLS40"))

How I do now:
The values are passed from a from(post) using checkboxes (#expcodes =
request.POST.getlist('expcode')
). So I get a list of:
expcodes = ['PyLS24', 'PyLS40']
then use the for loop to construct string representation of Q object.
expcodes = ['PyLS24', 'PyLS40']
k=''
c=0
for e in expcodes:
j=e.join(['Q(analysis__experiment__experiment_code="','") '])
if c == 0:
k = j
else:
k='|'.join([k, j])
c = c+1

k in this gives me 'Q(analysis__experiment__experiment_code="PyLS24")
|Q(analysis__experiment__experiment_code="PyLS40")  '.
When i use this to query the model as following... Result.objects.filter(k)I get 
"ValueError: too many values to unpack" error. But, exact string, if
I copy paste into Results.object.filter(here) it works.

When I checked the type, k constructed from for loop is in string format
(obviously). But, when I copy paste the pint out of k, it automatically
becomes Django's Q object.


The issue is that you can't use a string to generate the Q object 
passed to filter().  Instead, you need to build them up in a list, 
and then use the bitwise-OR operator.  You can either do that in a 
loop, or this way:


import operator

q_objs = [ Q(analysis__experiment__experiment_code=code) for code in expcodes ]
arg = reduce(operator.or_, q_objs)  # do bitwise-OR of all objects in the list
Results.object.filter(arg)

--
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.



Login failing

2012-02-22 Thread Aryeh Leib Taurog
I'm seeing a very strange intermittent problem with logging in.  The login
appears to be successful, because the response to the login POST is a 302
redirect.  However sometimes the user doesn't seem to be stored in the
session.

Here's a snippet from my http access log where my testing app was
redirected to a page which generates an error if the specified user isn't
logged in:

"POST /accounts/login/?next=/check_login/logintest/ HTTP/1.1" 302
"GET /check_login/logintest/ HTTP/1.1" 500

This happened 14 consecutive times yesterday and then it started working
again.

I compared the data collected on the server with the http headers logged
by the client and I can see that the cookies are transmitted correctly.  I
can retrieve the session records using manage.py whois, but it reports "No
user associated with session."  In some of the error cases the raw session
data is empty and in some cases it looks like this:
{'testcookie': 'worked'}

I see a few old threads that seemed to describe such a problem, but no
resolution is mentioned there.  I wonder if anyone has successfully
diagnosed and rectified a similar problem?  Any help getting this fixed
would be very appreciated!


Thanks,
Aryeh Leib

I'm running:
django 1.2.4
python 2.6.5 (ubuntu 10.4)
lighttpd 1.4.26 via fcgi (with flup)
postgresql 8.4 via psycopg2 (2.0.13-2ubuntu2)

session engine is db (all session-related settings are default)
The login view is django.contrib.auth.views.login

MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.doc.XViewMiddleware',
'django.middleware.transaction.TransactionMiddleware',
 ...
)

INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.admin',
'django.contrib.humanize',
'django.contrib.admindocs',
'django_extensions',
...
)


-- 
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.



Converting a string representation of query to Django object (Q).

2012-02-22 Thread gowthaman ramasamy
Hi List,
I am just starting to build an application using Django. And my first 
attempt outside of procedural PHP and Perl-CGI. I am already loving it so 
much (and ditched other two already).

I am trying to construct the following query at the end.
Result.objects.filter(Q(analysis__experiment__experiment_code="PyLS24") 
|Q(analysis__experiment__experiment_code="PyLS40"))

How I do now:
The values are passed from a from(post) using checkboxes (#expcodes = 
request.POST.getlist('expcode')
). So I get a list of:
expcodes = ['PyLS24', 'PyLS40']
then use the for loop to construct string representation of Q object.
expcodes = ['PyLS24', 'PyLS40'] 
k=''
c=0
for e in expcodes:
j=e.join(['Q(analysis__experiment__experiment_code="','") '])
if c == 0:
k = j
else:
k='|'.join([k, j])
c = c+1

k in this gives me 'Q(analysis__experiment__experiment_code="PyLS24") 
|Q(analysis__experiment__experiment_code="PyLS40")  '.
When i use this to query the model as following... Result.objects.filter(k)I 
get "ValueError: too many values to unpack" error. But, exact string, if 
I copy paste into Results.object.filter(here) it works. 

When I checked the type, k constructed from for loop is in string format 
(obviously). But, when I copy paste the pint out of k, it automatically 
becomes Django's Q object.

Can anyone help me to sort this out. Or is there altogether a better way to 
do this query. I would really appreciate any help.


Gowthaman






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



Re: psycopg2, postgres9.1, Mac OS - problem with psycopg2

2012-02-22 Thread Jeff Heard
Just as a followup to this, there are a few problems that have been patched
on Django with regards to Postgres 9.1.  They're not in the stable release,
but if you're using custom binary fields, such as PostGIS geometry, you
will need to search for the patch and apply it.  You may see '\x00' is not
a UTF-8 code or something like that.

On Wed, Feb 22, 2012 at 1:28 PM, Shawn Milochik  wrote:

> You can either add the proper path of pg_config to your PATH, or just
> extract the psycopg2 and add the full path to pg_config into the config
> file it contains then run 'python setup.py install' on the setup.py in the
> package.
>
>
> --
> 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+unsubscribe@**
> 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-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: psycopg2, postgres9.1, Mac OS - problem with psycopg2

2012-02-22 Thread Shawn Milochik
You can either add the proper path of pg_config to your PATH, or just 
extract the psycopg2 and add the full path to pg_config into the config 
file it contains then run 'python setup.py install' on the setup.py in 
the package.


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



Re: Need help on a (maybe complex) query with aggregate/annotate

2012-02-22 Thread Enrico
Works like a charm.

Thanks!

Ciao
Enrico

On Feb 21, 11:06 pm, Michael Elkins  wrote:
> On Tue, Feb 21, 2012 at 01:10:28PM -0800, Enrico wrote:
> >But your query counts all the books, even the bad ones. I only need to
> >count the good ones...
>
> >For example, if my books are:
>
> >1. name: LOTR, rating: 10, publisher: A ...
> >2. name: ASOIAF, rating: 10, publisher: A ...
> >3. name: Twilight, rating 1, publisher: B ...
>
> >and my publishers are:
> >A and B
>
> >Your query returns:
> >[A, num_book=2]
> >[B, num_book=1]
>
> >the query on my first message returns:
> >[A, num_book=2]
>
> >and what I need is:
> >[A, num_book=2]
> >[B, num_book=0]
>
> >where num_books means number of good books.
>
> Sorry, I missed that detail in your question.  You need to use the
> .extra() queryset method to do what you are attempting.  The
> following will add a 'num_good_books' attribute to each Publisher
> object:
>
> qs = Publisher.objects.extra(select={'num_good_books': 'select count(*) from 
> publisher_book where publisher_book.publisher_id = publisher_publisher.id and 
> publisher_book.rating > 3.0'})
> for o in qs:
>    print o.name, o.num_good_books
>
> Note that the "publisher_" prefix in the SQL is the name of the
> Django application in which your models reside.  So if your Django
> application is named "myapp", then you'd need to change the
> "publisher_" prefix to "myapp_".

-- 
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.



psycopg2, postgres9.1, Mac OS - problem with psycopg2

2012-02-22 Thread Anna
Hello,
I'm trying to install psycopg2 with PostgresSQL 9.1 using Python 2.6
on a Mac OS X 10.6.8 with Django.  I placed the psycopg2 folder under
Python 2.6 and added the following lines to setup.cfg
include_dirs=/Library/PostgreSQL/9.1/include
library_dirs=/Library/PostgreSQL/9.1/lib
pg_config=/Library/PostgresSQL/9.1/bin/pg_config

I cd to the psycopg2 directory and typed 'sudo python setup.py
install.  The following:
running install
running build
running build_py
running build_ext
Error:  Unable to find 'pg_config' file in '/Library/PostgresSQL/9.1/
bin/pg_config'

Can anyone help?  I'm using the Python 2.6 that came installed on my
Mac.
Anna

-- 
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.



How to soft delete many to many relation with Django

2012-02-22 Thread trudoe
A couple of days ago, I asked a question on StackOverflow about many-
to-many relation and soft deletion (see 
http://stackoverflow.com/q/9374962/42024).
I got a single answer telling me that I most likely bumped into a bug
and filed one (see https://code.djangoproject.com/ticket/17746). It
was later resolved as duplicate of an another bug opened more than a
year ago (see https://code.djangoproject.com/ticket/14891).

What is the process to get that bug resolved? I would try to do it
myself, but I am new to Django. Is there any workaround? Can someone
please take a look at my question on StackOverflow and see if I am
doing something wrong?

Thank you all!

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



Re: django 1.1: nonexistent URLs display 500.html instead of 404.html

2012-02-22 Thread Ian Clelland
On Tue, Feb 21, 2012 at 5:33 PM, rabousha  wrote:

> Yes, only for TEMPLATE_CONTEXT_PROCESSORS, the commas aren't added by
> default after the strings. I suspect it's an old bug.
>
> TEMPLATE_CONTEXT_PROCESSORS = (
>'django.core.context_processors.auth'
>'django.core.context_processors.debug'
>'django.core.context_processors.i18n'
>'django.core.context_processors.media'
> )
>

Interesting... my mistake for thinking that this was a syntax error -- this
is equivalent to the declaration

TEMPLATE_CONTEXT_PROCESSORS = (

'django.core.context_processors.authdjango.core.context_processors.debugdjango.core.context_processors.i18ndjango.core.context_processors.media'
)

since the Python interpreter will concatenate string literals.

Either way, this should raise an error -- an ImproperlyConfiguredError, to
be precise. I don't know of any bugs in Django 1.1 that would cause this to
raise a 404 instead -- there is likely a problem with your particular
settings.

I'm pretty sure that, even if there was a legitimate bug here, it would not
get fixed. The last update to the 1.1 series was over a year ago, and even
at that time, only security-related issues were being addressed.

If this is a serious issue for you (and it shouldn't be, if the 'fix' is to
correct the errors in your settings.py), then the recommended solution is
almost certainly going to be to upgrade. Django 1.3 is almost a year old,
and is still the current version -- if you can wait a couple of weeks,
you'll see 1.4 released as well.


> With the commas missing, all requests to nonexistent URLs returned a
> 500 error.
>
>
> On Feb 22, 12:31 am, Ian Clelland  wrote:
> > By 'missing commas', do you mean that there are *syntax errors* in your
> > settings.py file?
> >
> > That will definitely cause a 500 error, and I would be surprised if it
> > didn't do it on *every* request.
> > It seems odd that you would get a 404 when Debug is turned on, but that
> may
> > be related to the handling of the 500 error template, or possibly
> indicates
> > another error in your application settings.
> >
> > Ian
> >
> > On Tue, Feb 21, 2012 at 10:36 AM, rabousha  >wrote:
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > > I am using django 1.1, with DEBUG = False, and
> > > TEMPLATE_CONTEXT_PROCESSORS is missing commas, all nonexistent URLs
> > > display 500.html instead of 404.html. If I set DEBUG to True, it
> > > displays the default 404 page. if I add the commas to
> > > TEMPLATE_CONTEXT_PROCESSORS, then it displays the 404 page. The commas
> > > are not added by default. All pages do exist, so I am not missing
> > > anything.
> >
> > > Is this a known bug?
> >
> > > --
> > > 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.
> >
> > --
> > Regards,
> > Ian Clelland
> > 
>
> --
> 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.
>
>


-- 
Regards,
Ian Clelland


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



Re: About managing dependencies in a collaborative development team and good practices.

2012-02-22 Thread Javier Guerra Giraldez
On Wed, Feb 22, 2012 at 9:17 AM, Santiago Basulto
 wrote:
> I'm unsing virtualenvs and Pip. Seems great, is really easy that way.
>
> What about deployment? Will it be simple? Or should i care about the
> specific webserver?

on deployment there should be a 'real' webserver (as opposed to the
development server) and probably some wsgi server, database, cache,
queues, whatever your project needs.

besides that 'platform' needs, you also have the webapp itself: your
project and all the python dependencies (django, and extra apps like
South, celery, tagging, etc.)  for this, it's (almost) the same as for
development: create a virtualenv, pull from repository, and
pip-install all dependencies.

the main difference is that instead of you running the dev-server, the
infrastructure (including your wsgi server) will execute your app.
exactly how that's done is different for each deployment architecture.

-- 
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-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django and social network

2012-02-22 Thread Alec Taylor
k

If you have issues, read the docs.

If you still have issues, ask on pinax-users mailing-list not django-users.

On Thu, Feb 23, 2012 at 3:57 AM, Lewis Satini wrote:

> and I can only install basic, I had problem getting the advance install
>
>
> On Wed, Feb 22, 2012 at 11:57 AM, Lewis Satini wrote:
>
>> How much experience do you have on pinax. Did you implemented before? do
>> you have the sample site, that I might able to look at? it is difficult to
>> install, because it have some requirement before you install it.
>>
>>
>> On Wed, Feb 22, 2012 at 11:04 AM, Alec Taylor wrote:
>>
>>> Pinax
>>>
>>> http://pinaxproject.com/
>>>
>>> On Thu, Feb 23, 2012 at 1:50 AM, Lewis  wrote:
>>> > I am new in Django. I know it is a good platform.
>>> > I want to know if there's any plug-ins or script that do social
>>> > networking. I research on Pinax, but it seem very difficult to set it
>>> > up. These are the feature that I want to implement:
>>> > 1. Profile system that link to their facebook or google profile that
>>> > they have.
>>> > 2. Login with gmail account or facebook account
>>> > 3. able to store they login and password to local database
>>> > 4. able to do rating and comments
>>> >
>>> > Can someone suggest anything?
>>> >
>>> > Thanks for your 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-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-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.
>>>
>>>
>>
>>
>> --
>>
>>
>> Artistbean.com 
>> SMS at (646) 450-6756
>>
>>
>>
>
>
> --
>
>
> Artistbean.com 
> SMS at (646) 450-6756
>
>
>  --
> 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-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: social networks

2012-02-22 Thread yati sagade
I have always used the FB API using core Python urllib and other
helpers(after reading the FB API docs, of course), but you may find this
this  and
thishelpful.
On Wed, Feb 22, 2012 at 10:27 PM, dummyman dummyman wrote:

> hi,
>
> How to access facebook apis inside python script  ? I am using django
> framework
>
> --
> 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.
>



-- 
Yati Sagade 

(@yati_itay )

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



Re: Calling "manage.py shell" from the Python Shell in Tutorial Part 1

2012-02-22 Thread Bill Freeman
1.  There is more information in that traceback (that you didn't
include) that could help
you find your indentation error.

2.  It is quite useful, presuming that you are also a python beginner,
to do the tutorial
at:

   http://docs.python.org/tutorial/index.html

Bill

On Tue, Feb 21, 2012 at 6:41 PM, Django_for_SB  wrote:
> Django Gurus,
>
> I'm an absolute beginner using Python in Django. I'm currently going
> through the tutorial, part 1, on the djangoproject.com main website:
> https://docs.djangoproject.com/en/1.3/intro/tutorial01/. I keep trying
> to complete part 1 of the tutorial, step by step, meaning, I'll go
> through the tutorial part 1, progress up to a certain point, then
> close my shell command and shut-down my computer. Then, when I get
> back to opening up the project in which I initially began working on,
> namely, "mysite" (as the tutorial instructs us to name), my shell
> commands aren't valid anymore.
>
> Example:
>
> manage.py shell                                     -> This
> initially works if I start the project from scratch
>
> manage.py shell                                     -> This won't
> work if I leave my project, then go back to continue to
>
> work on it later
>
> This is the error I keep getting:
>
> Traceback(most recent call last):
>
> IndentationError: unexpected Indent
>
>
>
> I'm not quite sure what's going on. Any assistance would be more than
> appreciated. What am I missing here? Thank you.
>
> Best,
>
> SB
>
> --
> 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-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django and social network

2012-02-22 Thread Lewis Satini
and I can only install basic, I had problem getting the advance install

On Wed, Feb 22, 2012 at 11:57 AM, Lewis Satini wrote:

> How much experience do you have on pinax. Did you implemented before? do
> you have the sample site, that I might able to look at? it is difficult to
> install, because it have some requirement before you install it.
>
>
> On Wed, Feb 22, 2012 at 11:04 AM, Alec Taylor wrote:
>
>> Pinax
>>
>> http://pinaxproject.com/
>>
>> On Thu, Feb 23, 2012 at 1:50 AM, Lewis  wrote:
>> > I am new in Django. I know it is a good platform.
>> > I want to know if there's any plug-ins or script that do social
>> > networking. I research on Pinax, but it seem very difficult to set it
>> > up. These are the feature that I want to implement:
>> > 1. Profile system that link to their facebook or google profile that
>> > they have.
>> > 2. Login with gmail account or facebook account
>> > 3. able to store they login and password to local database
>> > 4. able to do rating and comments
>> >
>> > Can someone suggest anything?
>> >
>> > Thanks for your 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-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-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.
>>
>>
>
>
> --
>
>
> Artistbean.com 
> SMS at (646) 450-6756
>
>
>


-- 


Artistbean.com 
SMS at (646) 450-6756

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



Re: Django and social network

2012-02-22 Thread Lewis Satini
How much experience do you have on pinax. Did you implemented before? do
you have the sample site, that I might able to look at? it is difficult to
install, because it have some requirement before you install it.

On Wed, Feb 22, 2012 at 11:04 AM, Alec Taylor wrote:

> Pinax
>
> http://pinaxproject.com/
>
> On Thu, Feb 23, 2012 at 1:50 AM, Lewis  wrote:
> > I am new in Django. I know it is a good platform.
> > I want to know if there's any plug-ins or script that do social
> > networking. I research on Pinax, but it seem very difficult to set it
> > up. These are the feature that I want to implement:
> > 1. Profile system that link to their facebook or google profile that
> > they have.
> > 2. Login with gmail account or facebook account
> > 3. able to store they login and password to local database
> > 4. able to do rating and comments
> >
> > Can someone suggest anything?
> >
> > Thanks for your 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-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-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.
>
>


-- 


Artistbean.com 
SMS at (646) 450-6756

-- 
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.



social networks

2012-02-22 Thread dummyman dummyman
hi,

How to access facebook apis inside python script  ? I am using django
framework

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



Re: Django and social network

2012-02-22 Thread Alec Taylor
Pinax

http://pinaxproject.com/

On Thu, Feb 23, 2012 at 1:50 AM, Lewis  wrote:
> I am new in Django. I know it is a good platform.
> I want to know if there's any plug-ins or script that do social
> networking. I research on Pinax, but it seem very difficult to set it
> up. These are the feature that I want to implement:
> 1. Profile system that link to their facebook or google profile that
> they have.
> 2. Login with gmail account or facebook account
> 3. able to store they login and password to local database
> 4. able to do rating and comments
>
> Can someone suggest anything?
>
> Thanks for your 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-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-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django TypeError

2012-02-22 Thread Tom Evans
On Wed, Feb 22, 2012 at 2:28 PM, coded kid  wrote:
> I've changed it!
> def get_absolute_url(self):
>        #return u"%s" % (self.user)
>        return u"/%i/%i/%i/%s/" % (self.date.year, self.date.month,
> self.date.day, self.id)
> but I'm getting page not found,

This URL must match a URL in your urls.py

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-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django TypeError

2012-02-22 Thread coded kid
 (r'^comments/posted/$', 'myweb.meekapp.views.comment_posted' ),

On Feb 22, 3:37 pm, Ejah  wrote:
> How does your urls.py look?
>
> On 22 feb, 15:28, coded kid  wrote:
>
>
>
>
>
>
>
> > I've changed it!
> > def get_absolute_url(self):
> >         #return u"%s" % (self.user)
> >         return u"/%i/%i/%i/%s/" % (self.date.year, self.date.month,
> > self.date.day, self.id)
> > but I'm getting page not found,
>
> > Page not found (404)
> > Request Method:         GET
> > Request URL:    http://127.0.0.1:8000/2012/2/20/6/
>
> > Any idea?
>
> > On Feb 22, 3:15 pm, Thomas Rega  wrote:
>
> > > Am 22.02.12 15:11, schrieb coded kid:
>
> > > >   return u"/%i/%i/%i/sol/%i/%s/" % (self.date.year,
> > > > self.date.month, self.date.day, self.id)
>
> > > 5 != 4
>
> > > cheers ...
>
> > > --
>
> > >http://thoreg.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.



Django and social network

2012-02-22 Thread Lewis
I am new in Django. I know it is a good platform.
I want to know if there's any plug-ins or script that do social
networking. I research on Pinax, but it seem very difficult to set it
up. These are the feature that I want to implement:
1. Profile system that link to their facebook or google profile that
they have.
2. Login with gmail account or facebook account
3. able to store they login and password to local database
4. able to do rating and comments

Can someone suggest anything?

Thanks for your 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-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django TypeError

2012-02-22 Thread Ejah
How does your urls.py look?

On 22 feb, 15:28, coded kid  wrote:
> I've changed it!
> def get_absolute_url(self):
>         #return u"%s" % (self.user)
>         return u"/%i/%i/%i/%s/" % (self.date.year, self.date.month,
> self.date.day, self.id)
> but I'm getting page not found,
>
> Page not found (404)
> Request Method:         GET
> Request URL:    http://127.0.0.1:8000/2012/2/20/6/
>
> Any idea?
>
> On Feb 22, 3:15 pm, Thomas Rega  wrote:
>
>
>
> > Am 22.02.12 15:11, schrieb coded kid:
>
> > >   return u"/%i/%i/%i/sol/%i/%s/" % (self.date.year,
> > > self.date.month, self.date.day, self.id)
>
> > 5 != 4
>
> > cheers ...
>
> > --
>
> >http://thoreg.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.



Re: Django TypeError

2012-02-22 Thread coded kid
I've changed it!
def get_absolute_url(self):
#return u"%s" % (self.user)
return u"/%i/%i/%i/%s/" % (self.date.year, self.date.month,
self.date.day, self.id)
but I'm getting page not found,

Page not found (404)
Request Method: GET
Request URL:http://127.0.0.1:8000/2012/2/20/6/

Any idea?

On Feb 22, 3:15 pm, Thomas Rega  wrote:
> Am 22.02.12 15:11, schrieb coded kid:
>
> >   return u"/%i/%i/%i/sol/%i/%s/" % (self.date.year,
> > self.date.month, self.date.day, self.id)
>
> 5 != 4
>
> cheers ...
>
> --
>
> http://thoreg.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.



Re: Django TypeError

2012-02-22 Thread coded kid
Thanks for the reply! But it's still not working. Should I put 5 !=4
below the return in models.py?

On Feb 22, 3:15 pm, Thomas Rega  wrote:
> Am 22.02.12 15:11, schrieb coded kid:
>
> >   return u"/%i/%i/%i/sol/%i/%s/" % (self.date.year,
> > self.date.month, self.date.day, self.id)
>
> 5 != 4
>
> cheers ...
>
> --
>
> http://thoreg.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.



Re: About managing dependencies in a collaborative development team and good practices.

2012-02-22 Thread Santiago Basulto
Thank you guys.

I'm unsing virtualenvs and Pip. Seems great, is really easy that way.

What about deployment? Will it be simple? Or should i care about the
specific webserver?

Thanks!

On Feb 21, 1:21 pm, Tom Evans  wrote:
> On Tue, Feb 21, 2012 at 3:54 PM, Shawn Milochik  wrote:
> > On 02/21/2012 10:53 AM, Javier Guerra Giraldez wrote:
>
> >> i do exactly that.  just a tip: to create and maintain the pip
> >> requirements file do:
>
> >> pip freeze>  piprequirementsfile.txt
>
> > +1
>
> > And it's checked into version control.
>
> > Shawn
>
> How else would one do Software Change Management? :)
>
> 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-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django TypeError

2012-02-22 Thread Thomas Rega

Am 22.02.12 15:11, schrieb coded kid:

  return u"/%i/%i/%i/sol/%i/%s/" % (self.date.year,
self.date.month, self.date.day, self.id)


5 != 4

cheers ...


--


http://thoreg.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.



Django TypeError

2012-02-22 Thread coded kid
Hi Guys, I’m trying to override django comments by not redirecting
users to “Thanks For The Comment” page. After inserting the codes, I’m
getting an Error:

TypeError at /comments/posted/
not enough arguments for format string
Request Method: GET
Request URL: http://127.0.0.1:8000/comments/posted/?c=23
Django Version: 1.3.1
Exception Type: TypeError Exception Value:
not enough arguments for format string
Exception Location: C:\Python27\Scripts\myweb\meekapp\models.py in
get_absolute_url, line40 Python Executable: C:\Python27\python.exe
Python Version: 2.7.2


In my Models:
class sol(models.Model):
body=models.TextField(max_length=1)
user=models.ForeignKey(User)
date=models.DateTimeField()
state_province=models.CharField(max_length=50)
avatar=models.ImageField("Profile Pic", upload_to="photologue/
photos/", blank=True, null=True)
 def __unicode__(self):
return u"%s" % (self.body)

def get_absolute_url(self):
#return u"%s" % (self.user)
return u"/%i/%i/%i/sol/%i/%s/" % (self.date.year,
self.date.month, self.date.day, self.id)  #this is where python is
pointing to concerning the error.

In Views:
def comment_posted(request):
if request.GET['c']:
comment_id = request.GET['c']
comment = Comment.objects.get( pk=comment_id )
Sol = sol.objects.get(id=comment.object_pk)
if Sol:
return HttpResponseRedirect( Sol.get_absolute_url() )
return HttpResponseRedirect( "/" )

How can I get rid of 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-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.



Update primary key and update child tables

2012-02-22 Thread Thomas Guettler

I wrote a small snippet to update a primary key and update all child tables, 
which have a foreign-key to this table:

http://djangosnippets.org/snippets/2691/

Usage: manage.py update_primary_key table_name column_name value_old value_new

It uses the django db introspection (not the ORM ).

  Thomas Güttler

--
Thomas Guettler, http://www.thomas-guettler.de/
E-Mail: guettli (*) thomas-guettler + de

--
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.



TemplateResponse way of handling RequestContext

2012-02-22 Thread dizzydoc
Hi,

I was working around with middleware to use process_template_response
which is triggered when a view returns a TemplateReponse obj. I simply
tried using TemplateReponse to replace render_to_response so that i
get a handle of my view data in the middleware definition
process_template_response whichy  i otherwise dont get in case i use
render_to_response.

What I cant understand is how does TemplateResponse handle context
processing. Unlike render_to_response i dont see any option of passing
RequestContext(request) as a third argument to my TemplateResponse
call.

Suggest me if anyone figures 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-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: import selenium

2012-02-22 Thread Sébastien Billion
Sorry for that

2012/2/22 Tom Evans 

> On Wed, Feb 22, 2012 at 11:49 AM, Sébastien Billion
>  wrote:
> > Hi,
> >
> > Maybe you missed to add selenium in INSTALLED_APP in settings.py ...
> >
>
> selenium is not a django app, it is a python library:
>
> http://pypi.python.org/pypi/selenium
>
> Only django apps need to go in INSTALLED_APPS. Please don't blindly
> recommend people to put stuff into INSTALLED_APPS unless you know what
> it is for.
>
> OP: It works for me (see log below). Try reinstalling?
>
> Cheers
>
> Tom
>
> tom@voncount '11:57:01' '~/tmp/selenium'
> > $ virtualenv environ
> New python executable in environ/bin/python2.7
> Also creating executable in environ/bin/python
> Installing setuptoolsdone.
> Installing pip...done.
> tom@voncount '11:57:08' '~/tmp/selenium'
> > $ . ./environ/bin/activate
> (environ)tom@voncount '11:57:14' '~/tom/tmp/selenium'
> > $ pip install selenium
> Downloading/unpacking selenium
>  Downloading selenium-2.19.1.tar.gz (4.0Mb): 4.0Mb downloaded
>  Running setup.py egg_info for package selenium
>/usr/local/lib/python2.7/distutils/dist.py:267: UserWarning:
> Unknown distribution option: 'src_root'
>  warnings.warn(msg)
>
>warning: no files found matching 'docs/api/py/index.rst'
> Installing collected packages: selenium
>  Running setup.py install for selenium
>/usr/local/lib/python2.7/distutils/dist.py:267: UserWarning:
> Unknown distribution option: 'src_root'
>  warnings.warn(msg)
>
>warning: no files found matching 'docs/api/py/index.rst'
> Successfully installed selenium
> Cleaning up...
> (environ)tom@voncount '11:57:33' '~/tmp/selenium'
> > $ python
> Python 2.7.1 (r271:86832, Dec 13 2010, 15:52:15)
> [GCC 4.2.1 20070719  [FreeBSD]] on freebsd8
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import selenium
> >>> selenium.__version__
> '2.19.0'
> >>>
>
> --
> 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-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: import selenium

2012-02-22 Thread Tom Evans
On Wed, Feb 22, 2012 at 11:49 AM, Sébastien Billion
 wrote:
> Hi,
>
> Maybe you missed to add selenium in INSTALLED_APP in settings.py ...
>

selenium is not a django app, it is a python library:

http://pypi.python.org/pypi/selenium

Only django apps need to go in INSTALLED_APPS. Please don't blindly
recommend people to put stuff into INSTALLED_APPS unless you know what
it is for.

OP: It works for me (see log below). Try reinstalling?

Cheers

Tom

tom@voncount '11:57:01' '~/tmp/selenium'
> $ virtualenv environ
New python executable in environ/bin/python2.7
Also creating executable in environ/bin/python
Installing setuptoolsdone.
Installing pip...done.
tom@voncount '11:57:08' '~/tmp/selenium'
> $ . ./environ/bin/activate
(environ)tom@voncount '11:57:14' '~/tom/tmp/selenium'
> $ pip install selenium
Downloading/unpacking selenium
  Downloading selenium-2.19.1.tar.gz (4.0Mb): 4.0Mb downloaded
  Running setup.py egg_info for package selenium
/usr/local/lib/python2.7/distutils/dist.py:267: UserWarning:
Unknown distribution option: 'src_root'
  warnings.warn(msg)

warning: no files found matching 'docs/api/py/index.rst'
Installing collected packages: selenium
  Running setup.py install for selenium
/usr/local/lib/python2.7/distutils/dist.py:267: UserWarning:
Unknown distribution option: 'src_root'
  warnings.warn(msg)

warning: no files found matching 'docs/api/py/index.rst'
Successfully installed selenium
Cleaning up...
(environ)tom@voncount '11:57:33' '~/tmp/selenium'
> $ python
Python 2.7.1 (r271:86832, Dec 13 2010, 15:52:15)
[GCC 4.2.1 20070719  [FreeBSD]] on freebsd8
Type "help", "copyright", "credits" or "license" for more information.
>>> import selenium
>>> selenium.__version__
'2.19.0'
>>>

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



Re: import selenium

2012-02-22 Thread Sébastien Billion
Hi,

Maybe you missed to add selenium in INSTALLED_APP in settings.py ...

2012/2/22 xina towner 

> Hello, I've problems importing selenium module, I try this:
>
> from selenium import webdriver
>
> and it says it can resolve. I've installed selenium using pip install
> selenium.
>
> What am I missing?
>
> --
> Thanks,
>
> Rubén
>
>  --
> 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-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.



import selenium

2012-02-22 Thread xina towner
Hello, I've problems importing selenium module, I try this:

from selenium import webdriver

and it says it can resolve. I've installed selenium using pip install
selenium.

What am I missing?

-- 
Thanks,

Rubén

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



Re: Validation For all form fields in Django templates

2012-02-22 Thread Sébastien Billion
Hi,
You can generate a form easily with django ModelForm and add jquery ajax
validation over.

2012/2/22 shaini sasidhar 

> How can I do the automatic client side form validation in django?
>
> --
> 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-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: import error

2012-02-22 Thread Sébastien Billion
Hi,

I didn't know this tip! Shame on me.
Thanks for this

2012/2/22 dummyman dummyman 

> Hi i fixed the error . I didnt add the parent directory of project to
> sys.path.append in the standalone script thanks
>
>
> On Wed, Feb 22, 2012 at 10:35 AM, kalyani ram wrote:
>
>> every time you import something, plz done forget to include that in
>> installed_apps. this mostly solves the import errors and
>> templatedoesnotexist errors problem
>>
>> On Feb 21, 2:28 pm, dummyman efiles and directories securely between
>> remote hosts without starting an FTP session or logging into the remote
>> systems explicitly. The scp command uses SSH to transfer data, so it
>> requires a password or passphrase for authentication. Unlike rcp or FTP,
>> scp encrypts both the file and any passwords exchanged so that anyone
>> snooping on the network can't view them.
>>
>> Warning: Be careful when copying between hosts frdummyman <
>> tempo...@gmail.com> wrote:
>> > Hi ,
>> >
>> > I have a django project and a standalone python script . From the view
>> > function, i have invoked the standalone script. I am getting the error
>> ."
>> > No module named 
>> >
>> > this is my code for standalone script
>> >
>> > import os
>> >
>> > os.environ['DJANGO_SETTINGS_MODULE'] = 'myproject.settings'
>> >
>> > from django.conf import settings
>> >
>> > after that i ve imported the app inside this
>> > .
>> >
>> > from mysite.app.models import some
>> > but still i am getting the error no module  named mysite
>> > Please help in finding the reason for the error
>>
>> --
>> 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-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-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.