Re: Get secret key from django settings

2014-03-25 Thread Errfan Wadia
Yes because it takes the settings instance using the lazysettings.


On Tue, Mar 25, 2014 at 10:06 PM, François Schiettecatte <
fschietteca...@gmail.com> wrote:

> 110-130 milliseconds to 'import' something, sounds very suspect to me.
>
> François
>
> On Mar 25, 2014, at 12:08 PM, Errfan Wadia 
> wrote:
>
> > Hi Daniel,
> >
> > When I try to get the SECRET_KEY from settings.py in one of the app, it
> takes around 110-130 millisec. Here I am talking about execution time.
> >
> > On Tuesday, 25 March 2014 18:31:01 UTC+5:30, Daniel Roseman wrote:
> > On Tuesday, 25 March 2014 06:36:53 UTC, Errfan Wadia wrote:
> > Hi,
> >
> > I am using from django.conf import settings
> > Is there any faster way to get the SECRET_KEY in one of my app from
> settings.py ?
> >
> > What do you mean, faster? In what way is that slow?
> > --
> > DR.
> >
> > --
> > You received this message because you are subscribed to the Google
> Groups "Django users" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> an email to django-users+unsubscr...@googlegroups.com.
> > To post to this group, send email to django-users@googlegroups.com.
> > Visit this group at http://groups.google.com/group/django-users.
> > To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/be8a456f-1f0e-47bd-9116-94ac54304b3d%40googlegroups.com
> .
> > For more options, visit https://groups.google.com/d/optout.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CABY3faf-OHZi%2BZGpwsJKGSjsC29og-8bfqLQSa6yD10R%2BZu8Jw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Geodjango and Python 3.3

2014-03-25 Thread Sam Lai
I'm developing a site using Python 3.3, Django, Geodjango and
PostgreSQL. It is a bit tricky getting all the libraries to work, but
the stack does work. I installed GEOS using OSGeo4W, but I had to
explicitly specify the GEOS_LIBRARY_PATH and GDAL_LIBRARY_PATH in
settings.py.

On 25 March 2014 23:28, rgreene  wrote:
> Good day,
>
> I'm developing under Windows against a PostGIS database. On
> https://docs.djangoproject.com/en/1.7/ref/contrib/gis/install/#windows,
> Python 2.7 is shown in the installation steps. I've been reading up on
> Python 3.3 (for instance, https://wiki.python.org/moin/Python2orPython3),
> and as the development is just getting started I would like to go this route
> if possible. Are their any packages/libraries in the typical
> Geodjango/PostGIS statck that are not compatible with Python 3.3?
>
> Thanks in advance,
> Randal
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/5831a490-c1b6-4804-a09e-d99d79648a19%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CABxbXqUwyjyAbbF4_-HpTs3dtVBwBh2h0saeoQt_gqGiR2zZfg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Get secret key from django settings

2014-03-25 Thread François Schiettecatte
110-130 milliseconds to 'import' something, sounds very suspect to me.

François

On Mar 25, 2014, at 12:08 PM, Errfan Wadia  wrote:

> Hi Daniel,
> 
> When I try to get the SECRET_KEY from settings.py in one of the app, it takes 
> around 110-130 millisec. Here I am talking about execution time.
> 
> On Tuesday, 25 March 2014 18:31:01 UTC+5:30, Daniel Roseman wrote:
> On Tuesday, 25 March 2014 06:36:53 UTC, Errfan Wadia wrote:
> Hi,
> 
> I am using from django.conf import settings
> Is there any faster way to get the SECRET_KEY in one of my app from 
> settings.py ?
> 
> What do you mean, faster? In what way is that slow?
> --
> DR. 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/be8a456f-1f0e-47bd-9116-94ac54304b3d%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: Get secret key from django settings

2014-03-25 Thread Errfan Wadia
Hi Daniel,

When I try to get the SECRET_KEY from settings.py in one of the app, it 
takes around 110-130 millisec. Here I am talking about execution time.

On Tuesday, 25 March 2014 18:31:01 UTC+5:30, Daniel Roseman wrote:
>
> On Tuesday, 25 March 2014 06:36:53 UTC, Errfan Wadia wrote:
>>
>> Hi,
>>
>> I am using from django.conf import settings
>> Is there any faster way to get the SECRET_KEY in one of my app from 
>> settings.py ?
>>
>
> What do you mean, faster? In what way is that slow?
> --
> DR. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/be8a456f-1f0e-47bd-9116-94ac54304b3d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Get secret key from django settings

2014-03-25 Thread Errfan Wadia
Hey Shai 

it worked, reduced the time to 10 millisec from 120 millisec.

On Tuesday, 25 March 2014 17:48:12 UTC+5:30, Shai Efrati wrote:
>
> Hi Errfan,
> You can get the SECRET_KEY through the environment variables. Just use:
>
> from os import environ
> SECRET_KEY = environ.get('SECRET_KEY')
>
> Good luck!
>
>
> Shai.
>
>
> On Tue, Mar 25, 2014 at 8:36 AM, Errfan Wadia 
>  > wrote:
>
>> Hi,
>>
>> I am using from django.conf import settings
>> Is there any faster way to get the SECRET_KEY in one of my app from 
>> settings.py ?
>>  
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com
>> .
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/255c4e5c-65ad-43bf-9be0-4760c35de785%40googlegroups.com
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/64bf5fdd-0196-4383-a6df-9836123a5a6a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Geodjango and Python 3.3

2014-03-25 Thread rgreene
Good day,

I'm developing under Windows against a PostGIS database. On 
https://docs.djangoproject.com/en/1.7/ref/contrib/gis/install/#windows, 
Python 2.7 is shown in the installation steps. I've been reading up on 
Python 3.3 (for instance, https://wiki.python.org/moin/Python2orPython3), and 
as the development is just getting started I would like to go this route if 
possible. Are their any packages/libraries in the typical Geodjango/PostGIS 
statck that are not compatible with Python 3.3?

Thanks in advance,
Randal

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5831a490-c1b6-4804-a09e-d99d79648a19%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Get secret key from django settings

2014-03-25 Thread Daniel Roseman
On Tuesday, 25 March 2014 06:36:53 UTC, Errfan Wadia wrote:
>
> Hi,
>
> I am using from django.conf import settings
> Is there any faster way to get the SECRET_KEY in one of my app from 
> settings.py ?
>

What do you mean, faster? In what way is that slow?
--
DR. 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/40401cea-4b94-4a43-a2f8-a45d3f491e16%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Get secret key from django settings

2014-03-25 Thread Shai Efrati
Hi Errfan,
You can get the SECRET_KEY through the environment variables. Just use:

from os import environ
SECRET_KEY = environ.get('SECRET_KEY')

Good luck!


Shai.


On Tue, Mar 25, 2014 at 8:36 AM, Errfan Wadia wrote:

> Hi,
>
> I am using from django.conf import settings
> Is there any faster way to get the SECRET_KEY in one of my app from
> settings.py ?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/255c4e5c-65ad-43bf-9be0-4760c35de785%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALr%3D9OW7iYCgZa5i5bx7nioCnPYPK1bQ2hwkwEM5cKC6Nsk4tA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Get secret key from django settings

2014-03-25 Thread Errfan Wadia
Hi,

I am using from django.conf import settings
Is there any faster way to get the SECRET_KEY in one of my app from 
settings.py ?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/255c4e5c-65ad-43bf-9be0-4760c35de785%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: run manage.py commands within app

2014-03-25 Thread Tom Evans
On Sun, Mar 23, 2014 at 11:46 PM, judy wawira  wrote:
> Hello I have a django app using haystack and a solr backend to power
> searches
>
> There is dynamic addition of data and wonder if there are other ways to
> automatically rebuild the solr index without manually going to the command
> line to run manage.py rebuild_index
>
> Thanks

from django.core import management
management.call_command('rebuild_index',)


Cheers

Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFHbX1J%3DW_rfQSG7_zfR0EHvk-R89GVR3AWmjmop7ezSL085NQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.