Multiple django sites under single virtual host in apache - windows

2015-03-20 Thread Shilpa Gaikwad
Hi,

   I want to use single virtual host for multiple django sites. I have 
windows OS and apache2.4 with mod wsgi 3.5. But On windows mod_wsgi does 
not support WSGIDaemonProcess. Please help me to serve multiple django 
sites under single virtual host.

-- 
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/c0c57707-2af1-46cf-8789-26c52fdbb218%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: {{STATIC_URL }} or {% static "...." %} What`s the correct to use?

2015-03-20 Thread Ilya Kazakevich
This one "{% static "" %}" is MUCH better than {{STATIC_URL }}.
It is recommended way. 

You almost never need to use {{STATIC_URL }}.


On Friday, March 20, 2015 at 3:59:08 AM UTC+3, Fellipe Henrique wrote:
>
> Hi,
>
> In my template, when I made a reference to my Static folder.. what's the 
> correct usage?
>
> {{STATIC_URL }} or {% static "" %} 
>
> Django 1.7 and Python 3
>
> Thanks!
>
> T.·.F.·.A.·. S+F
> *Fellipe Henrique P. Soares*
>
> e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 
> 's/(.)/chr(ord($1)-2*3)/ge'
> *Blog: http://fhbash.wordpress.com/ *
> *GitHub: https://github.com/fellipeh *
> *Twitter: @fh_bash*
>  

-- 
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/06ea6d9c-a224-49c9-93b5-4733ceab5111%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: {{STATIC_URL }} or {% static "...." %} What`s the correct to use?

2015-03-20 Thread Fellipe Henrique
So, answer the questions:

- I in Debug mode: DEBUG = True
- Here is my settings.py:
https://gist.github.com/fellipeh/4eb8143f6ac362dff9e0
- Yes, all my folder has the correct permission, I can edit any files there.

- I  my HTML I have:

  

and in source code, in browser show these:

 


- When I try to go:  localhost:8000/static   show these:

Page not found (404)  Request Method: GET  Request URL:
http://localhost:8000/static/

Directory indexes are not allowed here.

You're seeing this error because you have DEBUG = True in your Django
settings file. Change that to False, and Django will display a standard 404
page.



Any thoughts?

T.·.F.·.A.·. S+F
*Fellipe Henrique P. Soares*

e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge'
*Blog: http://fhbash.wordpress.com/ *
*GitHub: https://github.com/fellipeh *
*Twitter: @fh_bash*

On Fri, Mar 20, 2015 at 9:36 AM, Ilya Kazakevich 
wrote:

> This one "{% static "" %}" is MUCH better than {{STATIC_URL }}.
> It is recommended way.
>
> You almost never need to use {{STATIC_URL }}.
>
>
> On Friday, March 20, 2015 at 3:59:08 AM UTC+3, Fellipe Henrique wrote:
>>
>> Hi,
>>
>> In my template, when I made a reference to my Static folder.. what's the
>> correct usage?
>>
>> {{STATIC_URL }} or {% static "" %}
>>
>> Django 1.7 and Python 3
>>
>> Thanks!
>>
>> T.·.F.·.A.·. S+F
>> *Fellipe Henrique P. Soares*
>>
>> e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \
>> 's/(.)/chr(ord($1)-2*3)/ge'
>> *Blog: http://fhbash.wordpress.com/ *
>> *GitHub: https://github.com/fellipeh *
>> *Twitter: @fh_bash*
>>
>  --
> 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/06ea6d9c-a224-49c9-93b5-4733ceab5111%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/CAF1jwZHfddQLPvxA%3D0thjDEP8Nb6OLD4yQPOR60feoDdR7Q67A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: {{STATIC_URL }} or {% static "...." %} What`s the correct to use?

2015-03-20 Thread Frank Bieniek
HI 
check your main urls.py for something like this:

if settings.DEBUG:
urlpatterns += patterns('',
#(r'^media/(?P.*)', 'django.views.static.serve', 
{'document_root': settings.MEDIA_ROOT, 'show_indexes': True}),
(r'^static/(?P.*)', 'django.views.static.serve', 
{'document_root': settings.STATIC_ROOT, 'show_indexes': True}),
)

This allows static file serving from the runserver - only for local 
development!!

thanks
Frank
Am Freitag, 20. März 2015 01:59:08 UTC+1 schrieb Fellipe Henrique:
>
> Hi,
>
> In my template, when I made a reference to my Static folder.. what's the 
> correct usage?
>
> {{STATIC_URL }} or {% static "" %} 
>
> Django 1.7 and Python 3
>
> Thanks!
>
> T.·.F.·.A.·. S+F
> *Fellipe Henrique P. Soares*
>
> e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 
> 's/(.)/chr(ord($1)-2*3)/ge'
> *Blog: http://fhbash.wordpress.com/ *
> *GitHub: https://github.com/fellipeh *
> *Twitter: @fh_bash*
>  

-- 
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/ebff8c7f-b839-40e1-89d9-2365c45520d0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: {{STATIC_URL }} or {% static "...." %} What`s the correct to use?

2015-03-20 Thread Vijay Khemlani
You don't need special rules in the URL config to serve static files in
development as far as I know

so you have a route to "/static/public/css/bootstrap.min.css" and I assume
that when you try to access

http://localhost:8000/static/public/css/bootstrap.min.css

you get a 404 error

Where is bootstrap.min.css located in your project directory?

On Fri, Mar 20, 2015 at 11:19 AM, Frank Bieniek <
frank.bien...@googlemail.com> wrote:

> HI
> check your main urls.py for something like this:
>
> if settings.DEBUG:
> urlpatterns += patterns('',
> #(r'^media/(?P.*)', 'django.views.static.serve',
> {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}),
> (r'^static/(?P.*)', 'django.views.static.serve',
> {'document_root': settings.STATIC_ROOT, 'show_indexes': True}),
> )
>
> This allows static file serving from the runserver - only for local
> development!!
>
> thanks
> Frank
> Am Freitag, 20. März 2015 01:59:08 UTC+1 schrieb Fellipe Henrique:
>>
>> Hi,
>>
>> In my template, when I made a reference to my Static folder.. what's the
>> correct usage?
>>
>> {{STATIC_URL }} or {% static "" %}
>>
>> Django 1.7 and Python 3
>>
>> Thanks!
>>
>> T.·.F.·.A.·. S+F
>> *Fellipe Henrique P. Soares*
>>
>> e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \
>> 's/(.)/chr(ord($1)-2*3)/ge'
>> *Blog: http://fhbash.wordpress.com/ *
>> *GitHub: https://github.com/fellipeh *
>> *Twitter: @fh_bash*
>>
>  --
> 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/ebff8c7f-b839-40e1-89d9-2365c45520d0%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/CALn3ei0FvvB0fwcKhsNBcnfJgACTtLu8vnY94m%2BEV7nNAtR22w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: {{STATIC_URL }} or {% static "...." %} What`s the correct to use?

2015-03-20 Thread Fellipe Henrique
On Fri, Mar 20, 2015 at 11:24 AM, Vijay Khemlani  wrote:

> http://localhost:8000/static/public/css/bootstrap.min.css


In fact, if I type these in firefox, show me the file... :)

but nothing in my HTML..

here is my html,

{% load staticfiles %}





  Test!!




I really don't know, how is the problem here... :(  in my PyCharm Project,
in HTML, show me: Unresolved Reference, to my static files... :(


T.·.F.·.A.·. S+F
*Fellipe Henrique P. Soares*

e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge'
*Blog: http://fhbash.wordpress.com/ *
*GitHub: https://github.com/fellipeh *
*Twitter: @fh_bash*

-- 
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/CAF1jwZEq71rr5PA3BcLKS0Y4RRY5RH7tQW8sPjgjX94yuo477Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: {{STATIC_URL }} or {% static "...." %} What`s the correct to use?

2015-03-20 Thread Néstor
Is it OK to have this syntax?
 href="{% static "public/css/bootstrap.min.css" %}">

Should you not do something like this:
href="{% static 'public/css/bootstrap.min.css' %}">



On Fri, Mar 20, 2015 at 7:13 AM, Fellipe Henrique 
wrote:

> So, answer the questions:
>
> - I in Debug mode: DEBUG = True
> - Here is my settings.py:
> https://gist.github.com/fellipeh/4eb8143f6ac362dff9e0
> - Yes, all my folder has the correct permission, I can edit any files
> there.
>
> - I  my HTML I have:
>
>%}">
>
> and in source code, in browser show these:
>
>  
>
>
> - When I try to go:  localhost:8000/static   show these:
>
> Page not found (404)  Request Method: GET  Request URL:
> http://localhost:8000/static/
>
> Directory indexes are not allowed here.
>
> You're seeing this error because you have DEBUG = True in your Django
> settings file. Change that to False, and Django will display a standard
> 404 page.
>
>
>
> Any thoughts?
>
> T.·.F.·.A.·. S+F
> *Fellipe Henrique P. Soares*
>
> e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \
> 's/(.)/chr(ord($1)-2*3)/ge'
> *Blog: http://fhbash.wordpress.com/ *
> *GitHub: https://github.com/fellipeh *
> *Twitter: @fh_bash*
>
> On Fri, Mar 20, 2015 at 9:36 AM, Ilya Kazakevich  > wrote:
>
>> This one "{% static "" %}" is MUCH better than {{STATIC_URL }}.
>> It is recommended way.
>>
>> You almost never need to use {{STATIC_URL }}.
>>
>>
>> On Friday, March 20, 2015 at 3:59:08 AM UTC+3, Fellipe Henrique wrote:
>>>
>>> Hi,
>>>
>>> In my template, when I made a reference to my Static folder.. what's the
>>> correct usage?
>>>
>>> {{STATIC_URL }} or {% static "" %}
>>>
>>> Django 1.7 and Python 3
>>>
>>> Thanks!
>>>
>>> T.·.F.·.A.·. S+F
>>> *Fellipe Henrique P. Soares*
>>>
>>> e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \
>>> 's/(.)/chr(ord($1)-2*3)/ge'
>>> *Blog: http://fhbash.wordpress.com/ *
>>> *GitHub: https://github.com/fellipeh *
>>> *Twitter: @fh_bash*
>>>
>>  --
>> 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/06ea6d9c-a224-49c9-93b5-4733ceab5111%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/CAF1jwZHfddQLPvxA%3D0thjDEP8Nb6OLD4yQPOR60feoDdR7Q67A%40mail.gmail.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/CAON-vCP%3Dsp%2BMt-F2w7sCp_5i5yFYeGJxTP9dTOiM4Sef7-wchQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: {{STATIC_URL }} or {% static "...." %} What`s the correct to use?

2015-03-20 Thread Vijay Khemlani
Soo when you open your webpage, look at its source code, click on the
"/static/public/css/bootstrap.min.css" path it shows the file in Firefox?


On Fri, Mar 20, 2015 at 11:37 AM, Néstor  wrote:

> Is it OK to have this syntax?
>  href="{% static "public/css/bootstrap.min.css" %}">
>
> Should you not do something like this:
> href="{% static 'public/css/bootstrap.min.css' %}">
>
>
>
> On Fri, Mar 20, 2015 at 7:13 AM, Fellipe Henrique 
> wrote:
>
>> So, answer the questions:
>>
>> - I in Debug mode: DEBUG = True
>> - Here is my settings.py:
>> https://gist.github.com/fellipeh/4eb8143f6ac362dff9e0
>> - Yes, all my folder has the correct permission, I can edit any files
>> there.
>>
>> - I  my HTML I have:
>>
>>   > %}">
>>
>> and in source code, in browser show these:
>>
>>  
>>
>>
>> - When I try to go:  localhost:8000/static   show these:
>>
>> Page not found (404)  Request Method: GET  Request URL:
>> http://localhost:8000/static/
>>
>> Directory indexes are not allowed here.
>>
>> You're seeing this error because you have DEBUG = True in your Django
>> settings file. Change that to False, and Django will display a standard
>> 404 page.
>>
>>
>>
>> Any thoughts?
>>
>> T.·.F.·.A.·. S+F
>> *Fellipe Henrique P. Soares*
>>
>> e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \
>> 's/(.)/chr(ord($1)-2*3)/ge'
>> *Blog: http://fhbash.wordpress.com/ *
>> *GitHub: https://github.com/fellipeh *
>> *Twitter: @fh_bash*
>>
>> On Fri, Mar 20, 2015 at 9:36 AM, Ilya Kazakevich <
>> kazakevichi...@gmail.com> wrote:
>>
>>> This one "{% static "" %}" is MUCH better than {{STATIC_URL }}.
>>> It is recommended way.
>>>
>>> You almost never need to use {{STATIC_URL }}.
>>>
>>>
>>> On Friday, March 20, 2015 at 3:59:08 AM UTC+3, Fellipe Henrique wrote:

 Hi,

 In my template, when I made a reference to my Static folder.. what's
 the correct usage?

 {{STATIC_URL }} or {% static "" %}

 Django 1.7 and Python 3

 Thanks!

 T.·.F.·.A.·. S+F
 *Fellipe Henrique P. Soares*

 e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \
 's/(.)/chr(ord($1)-2*3)/ge'
 *Blog: http://fhbash.wordpress.com/ *
 *GitHub: https://github.com/fellipeh *
 *Twitter: @fh_bash*

>>>  --
>>> 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/06ea6d9c-a224-49c9-93b5-4733ceab5111%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/CAF1jwZHfddQLPvxA%3D0thjDEP8Nb6OLD4yQPOR60feoDdR7Q67A%40mail.gmail.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/CAON-vCP%3Dsp%2BMt-F2w7sCp_5i5yFYeGJxTP9dTOiM4Sef7-wchQ%40mail.gmail.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

Re: {{STATIC_URL }} or {% static "...." %} What`s the correct to use?

2015-03-20 Thread Tom Lockhart
On Mar 20, 2015, at 7:37 AM, Néstor  wrote:

> Is it OK to have this syntax?
>  href=“{% static "public/css/bootstrap.min.css" %}">

fwiw yes it is OK to have that syntax with double quotes inside another set of 
double quotes.

- Tom

> 
> Should you not do something like this:
> href="{% static 'public/css/bootstrap.min.css' %}">

-- 
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/D69B6CA8-A48C-42E1-8AF1-DBB5162F1B65%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: newbie question

2015-03-20 Thread David Gleba
Does part 3 of the tutorial cover how to make a form, get the values 
without storing them in a database, perform the arithmetic and then display 
the result? I didn't see that in there.


On Thursday, March 19, 2015 at 11:58:14 AM UTC-4, Andrew Farrell wrote:
>
> The other commenters are right that reading the tutorial is a good use of 
> your time.
> https://docs.djangoproject.com/en/1.7/intro/tutorial03/
> is the section relevant to your question.
>
> On Thu, Mar 19, 2015 at 10:39 AM, Javier Guerra Giraldez <
> jav...@guerrag.com > wrote:
>
>> On Wed, Mar 18, 2015 at 9:41 PM, VMD > > wrote:
>> > I have skimmed the tutorial and didn't find (notice) the answer. Why not
>> > point me to an answer to my question?
>>
>>
>> that's exactly the point.  your question assumes Django works in some
>> specific way, and there should be a simple answer for a simple need.
>>
>> but i don't think you assumptions are correct, if you knew how Django
>> (and frameworks in general) work, your question might be very
>> different, and the answer much simpler and better in general.
>>
>> really, doing the tutorial is a very good investment of your time.
>>
>>
>> --
>> Javier
>>
>> --
>> 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/CAFkDaoQ0MOT57JCKfTjxWn6CkypeP2POm%3DF90Vn%3DF88dYDDQdg%40mail.gmail.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/d7071e54-27f5-45f5-b183-1bdcce76820d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Maximum database connections exceeded

2015-03-20 Thread Hans Kristian Flaatten
My Django application is exceeding the maximum number of simultaneous 
database
connections (100) to the Postgres database when running through Gunicorn 
with
async eventlet workers. When the limit it exceeded it starts returning
500-errors until new connections can be established.

Setting `CONN_MAX_AGE` to 0, 60, 600, or None does not appear to solve this 
issue.

*This is my database configuration:*

DATABASES = { 
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': 'django',
'USER': 'django',
'HOST': 'postgres',
'PORT': 5432,
'CONN_MAX_AGE': 60, 
}   
}

*This is my Gunicorn configuration:*

gunicorn --bind 0.0.0.0:8080 --worker-class eventlet --workers 5 myapp.wsgi:
application

*These are the installed packages:*

   -  djano v1.7
   -  gunicorn v19.3
   -  eventlet v0.17
   -  psycopg2 v2.6

Any hints or tips on where to go from here? Is Django's ORM supposed to 
offer
connection pooling/reuse, or is this something I have to get else where?

-- 
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/a5bd0b59-638c-466d-9f85-aadd5edda500%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: newbie question

2015-03-20 Thread VMD
On Friday, March 20, 2015 at 9:58:23 AM UTC-6, David Gleba wrote:
>
> Does part 3 of the tutorial cover how to make a form, get the values 
> without storing them in a database, perform the arithmetic and then display 
> the result? I didn't see that in there.
>
 
I don't what to store them in a database. Just do the calculation. Is this 
explained in the tutorial?

I have been sick = brain not working well. maybe I'll get this figured out 
today or actually do the whole tutorial.

VMD

 
>

> On Thursday, March 19, 2015 at 11:58:14 AM UTC-4, Andrew Farrell wrote:
>>
>> The other commenters are right that reading the tutorial is a good use of 
>> your time.
>> https://docs.djangoproject.com/en/1.7/intro/tutorial03/
>> is the section relevant to your question.
>>
>> On Thu, Mar 19, 2015 at 10:39 AM, Javier Guerra Giraldez <
>> jav...@guerrag.com> wrote:
>>
>>> On Wed, Mar 18, 2015 at 9:41 PM, VMD  wrote:
>>> > I have skimmed the tutorial and didn't find (notice) the answer. Why 
>>> not
>>> > point me to an answer to my question?
>>>
>>>
>>> that's exactly the point.  your question assumes Django works in some
>>> specific way, and there should be a simple answer for a simple need.
>>>
>>> but i don't think you assumptions are correct, if you knew how Django
>>> (and frameworks in general) work, your question might be very
>>> different, and the answer much simpler and better in general.
>>>
>>> really, doing the tutorial is a very good investment of your time.
>>>
>>>
>>> --
>>> Javier
>>>
>>> --
>>> 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/CAFkDaoQ0MOT57JCKfTjxWn6CkypeP2POm%3DF90Vn%3DF88dYDDQdg%40mail.gmail.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/fb4e5744-9b31-4408-9e08-47507cc3e29f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Testing migrations

2015-03-20 Thread Gergely Polonkai
Hello,

I just wrote a migration class with RunPython. When I run my tests, my
coverage value drops to to ninety-something percents, because the initial
database created by the test runner is (obviously) empty, thus, my
migration function’s for iteration won’t run.

Is there a way to test such migrations? Not just because of coverage
values, but I’d like to check if my migration function runs correctly.
Basically I create a new column which will have a generated initial value
based on other fields.

Thanks in advance!

Best,
Gergely

-- 
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/CACczBUKBu-8W7hS6b4_EXGnZGGq1jYuDshOU8q4NPbvp%2B_wVOQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: {{STATIC_URL }} or {% static "...." %} What`s the correct to use?

2015-03-20 Thread Fellipe Henrique
On Fri, Mar 20, 2015 at 11:43 AM, Vijay Khemlani  wrote:

> Soo when you open your webpage, look at its source code, click on the
> "/static/public/css/bootstrap.min.css" path it shows the file in Firefox?
>

Yes.. when I open source code in firefox, click them.. show me the file..
but, nothing to appears correctly my HTML...

I really upset about these... I really don't know what's happen here...

T.·.F.·.A.·. S+F
*Fellipe Henrique P. Soares*

e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge'
*Blog: http://fhbash.wordpress.com/ *
*GitHub: https://github.com/fellipeh *
*Twitter: @fh_bash*

-- 
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/CAF1jwZG78iexn0uLign0Rj-d_dvi61%2BtrNHTnVxXMkUxOi_gSg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: newbie question

2015-03-20 Thread David Gleba
I will try to answer your question here another way.

I searched google for: form to add two numbers

I see: 
 http://stackoverflow.com/questions/14496531/adding-two-numbers-using-javascript

This example uses an HTML form and javascript to perform the task on the 
input.

You don't actually need python or django to get form input and do something 
with the input.

Also, I am not an expert in Django yet, but I think you can use html and 
javascript in views.



On Friday, March 20, 2015 at 12:03:51 PM UTC-4, VMD wrote:
>
> On Friday, March 20, 2015 at 9:58:23 AM UTC-6, David Gleba wrote:
>>
>> Does part 3 of the tutorial cover how to make a form, get the values 
>> without storing them in a database, perform the arithmetic and then display 
>> the result? I didn't see that in there.
>>
>  
> I don't what to store them in a database. Just do the calculation. Is this 
> explained in the tutorial?
>
> I have been sick = brain not working well. maybe I'll get this figured out 
> today or actually do the whole tutorial.
>
> VMD
>
>  
>>
>
>> On Thursday, March 19, 2015 at 11:58:14 AM UTC-4, Andrew Farrell wrote:
>>>
>>> The other commenters are right that reading the tutorial is a good use 
>>> of your time.
>>> https://docs.djangoproject.com/en/1.7/intro/tutorial03/
>>> is the section relevant to your question.
>>>
>>> On Thu, Mar 19, 2015 at 10:39 AM, Javier Guerra Giraldez <
>>> jav...@guerrag.com> wrote:
>>>
 On Wed, Mar 18, 2015 at 9:41 PM, VMD  wrote:
 > I have skimmed the tutorial and didn't find (notice) the answer. Why 
 not
 > point me to an answer to my question?


 that's exactly the point.  your question assumes Django works in some
 specific way, and there should be a simple answer for a simple need.

 but i don't think you assumptions are correct, if you knew how Django
 (and frameworks in general) work, your question might be very
 different, and the answer much simpler and better in general.

 really, doing the tutorial is a very good investment of your time.


 --
 Javier

 --
 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/CAFkDaoQ0MOT57JCKfTjxWn6CkypeP2POm%3DF90Vn%3DF88dYDDQdg%40mail.gmail.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/1dea13f1-aeb4-4dca-8179-afa7bc7efda1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: newbie question

2015-03-20 Thread john
I'm not aware that you can use javascript in views.py.  In the Template 
- I believe you mean.


Johnf
On 03/20/2015 09:35 AM, David Gleba wrote:
Also, I am not an expert in Django yet, but I think you can use html 
and javascript in views.


--
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/550C5523.1030103%40jfcomputer.com.
For more options, visit https://groups.google.com/d/optout.


Re: {{STATIC_URL }} or {% static "...." %} What`s the correct to use?

2015-03-20 Thread Vijay Khemlani
OK, this is officially no longer a Django problem xD

Try adding the type="text/css" attribute to the link tag, also remember to
close it just in case



Other than that you may have problems in your HTML

On Fri, Mar 20, 2015 at 1:59 PM, Fellipe Henrique 
wrote:

>
> On Fri, Mar 20, 2015 at 11:43 AM, Vijay Khemlani 
> wrote:
>
>> Soo when you open your webpage, look at its source code, click on the
>> "/static/public/css/bootstrap.min.css" path it shows the file in Firefox?
>>
>
> Yes.. when I open source code in firefox, click them.. show me the file..
> but, nothing to appears correctly my HTML...
>
> I really upset about these... I really don't know what's happen here...
>
> T.·.F.·.A.·. S+F
> *Fellipe Henrique P. Soares*
>
> e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \
> 's/(.)/chr(ord($1)-2*3)/ge'
> *Blog: http://fhbash.wordpress.com/ *
> *GitHub: https://github.com/fellipeh *
> *Twitter: @fh_bash*
>
> --
> 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/CAF1jwZG78iexn0uLign0Rj-d_dvi61%2BtrNHTnVxXMkUxOi_gSg%40mail.gmail.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/CALn3ei3BrMwrHAFewa_qriSMKM4dxmeQmm891sVPLS61zmsR-A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: {{STATIC_URL }} or {% static "...." %} What`s the correct to use?

2015-03-20 Thread Tom Lockhart
On Mar 20, 2015, at 9:59 AM, Fellipe Henrique  wrote:

> 
> On Fri, Mar 20, 2015 at 11:43 AM, Vijay Khemlani  wrote:
> Soo when you open your webpage, look at its source code, click on the 
> "/static/public/css/bootstrap.min.css" path it shows the file in Firefox?
> 
> Yes.. when I open source code in firefox, click them.. show me the file.. 
> but, nothing to appears correctly my HTML...
> 
> I really upset about these... I really don’t know what's happen here... 

Your original problem statement included:

  …
  - When I try to go:  localhost:8000/static   show these:
  Page not found (404)
  …

In my debug setup, I have the same result, and this is normal. You *should* be 
able to take a specific static resource and put it into the browser as a URL. 
For example, I can put http://localhost:8000/static/fz/img/loadingAnimation.gif 
into my browser and that *does* find the gif.

This is compatible with your observation that you can take the link in your 
html and that *does* work when pasted into your browser.

I’m guessing that there is a problem with your HTML, not with your static 
setup. Can you distill the problem down to a simple HTML template and resulting 
page and post both?

When debugging html template troubles you may want to play around with {% 
comment %}…{% endcomment %} blocks to get rid of code for testing.

hth

- Tom


> 
> T.·.F.·.A.·. S+F
> Fellipe Henrique P. Soares
> 
> e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge'
> Blog: http://fhbash.wordpress.com/
> GitHub: https://github.com/fellipeh
> Twitter: @fh_bash
> 
> -- 
> 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/CAF1jwZG78iexn0uLign0Rj-d_dvi61%2BtrNHTnVxXMkUxOi_gSg%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

Please consider the environment before printing this message.
This message may be privileged and/or confidential, and the sender does not 
waive any related rights and obligations.  Any distribution, use or copying of 
this message or the information it contains by other than an intended recipient 
is unauthorized.  If you received this message in error, please immediately 
advise me by return e-mail or phone.  All information, references, images, 
programs, source code, or other materials whatsoever contained in, or supplied 
with, this document are TRADE SECRETS and governed by the Uniform Trade Secrets 
Act.  User assumes all direct and consequential liabilities and costs that 
result from any unauthorized disclosure or use of this information.

-- 
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/28DCD048-9BFB-4AD5-BCD8-9AEB585813B4%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: in db/models/query.py - TypeError: 'exceptions.IndexError' object is not callable

2015-03-20 Thread gkelly
For anyone who might come across this old problem, this stack overflow 
question solves it:

http://stackoverflow.com/questions/7877340/typeerror-doesnotexist-object-is-not-callable


On Wednesday, December 31, 2008 at 8:58:41 PM UTC-8, gkelly wrote:
>
> I am having the following error sent to my email from a live site. I 
> haven't been able to reproduce the error myself, but was hoping 
> someone could point me in the right direction as to how to solve this. 
>
> First of all, is it something in my code, or in Django? The last line 
> of the traceback says Django, but I think it's probably something I'm 
> doing. 
>
> Any ideas? 
> Thanks, 
> Grant 
>
>
> Traceback (most recent call last): 
>
>   File "/usr/lib/python2.5/site-packages/django/core/handlers/ 
> base.py", line 86, in get_response 
> response = callback(request, *callback_args, **callback_kwargs) 
>
>   File "/usr/lib/python2.5/site-packages/django/contrib/auth/ 
> decorators.py", line 67, in __call__ 
> return self.view_func(request, *args, **kwargs) 
>
>   File "/usr/local/src/wxcoder/observations/views.py", line 160, in 
> enter 
> if form.is_valid(): 
>
>   File "/usr/lib/python2.5/site-packages/django/forms/forms.py", line 
> 120, in is_valid 
> return self.is_bound and not bool(self.errors) 
>
>   File "/usr/lib/python2.5/site-packages/django/forms/forms.py", line 
> 111, in _get_errors 
> self.full_clean() 
>
>   File "/usr/lib/python2.5/site-packages/django/forms/forms.py", line 
> 241, in full_clean 
> self.cleaned_data = self.clean() 
>
>   File "/usr/local/src/wxcoder/observations/forms.py", line 104, in 
> clean 
> self.validate() 
>
>   File "/usr/local/src/wxcoder/observations/forms.py", line 462, in 
> validate 
> ]: validator(self.cleaned_data) 
>
>   File "/usr/local/src/wxcoder/observations/forms.py", line 257, in 
> ValidateGrossLimit 
> e = Element.objects.get(elementID=e_id) 
>
>   File "/usr/lib/python2.5/site-packages/django/db/models/manager.py", 
> line 93, in get 
> return self.get_query_set().get(*args, **kwargs) 
>
>   File "/usr/lib/python2.5/site-packages/django/db/models/query.py", 
> line 309, in get 
> % self.model._meta.object_name) 
>
> TypeError: 'exceptions.IndexError' object is not callable 
>
>
>  path:/wxcoder/observations/enter/, 
> GET:, 
> POST: [u'.04'], u'TX': [u'32'], u'date_month': [u'12'], u'station_id': 
> [u'6933'], u'TN': [u'30'], u'PPO_prev': [u''], u'SD': [u'13'], 
> u'date_minute': [u'0'], u'submit': [u'Submit'], u'date_year': 
> [u'2008'], u'date_day': [u'7'], u'type': [u'daily'], u'SF': [u'0'], 
> u'TA': [u'32']}>, 
> COOKIES:{'__utma': 
> '145837938.4275713312103283000.1230773473.1230773473.1230773473.1', 
>  '__utmb': '145837938.47.10.1230773473', 
>  '__utmc': '145837938', 
>  '__utmz': '145837938.1230773473.1.1.utmcsr=(direct)|utmccn=(direct)| 
> utmcmd=(none)', 
>  'sessionid': '2678e9af381ca6ae35cb0a020b6818fb', 
>  'username': 'eklutna.waterplant'}, 
> META:{'AUTH_TYPE': None, 
>  'CONTENT_LENGTH': 0L, 
>  'CONTENT_TYPE': None, 
>  'GATEWAY_INTERFACE': 'CGI/1.1', 
>  'HTTP_ACCEPT': 'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, 
> application/x-shockwave-flash, application/xaml+xml, application/ 
> vnd.ms-xpsdocument, application/x-ms-xbap, application/x-ms- 
> application, application/vnd.ms-excel, application/vnd.ms-powerpoint, 
> application/msword, */*', 
>  'HTTP_ACCEPT_LANGUAGE': 'en-us', 
>  'HTTP_CONNECTION': 'Keep-Alive', 
>  'HTTP_CONTENT_LENGTH': '166', 
>  'HTTP_CONTENT_TYPE': 'application/x-www-form-urlencoded', 
>  'HTTP_COOKIE': 'sessionid=2678e9af381ca6ae35cb0a020b6818fb; 
> __utma=145837938.4275713312103283000.1230773473.1230773473.1230773473.1; 
> __utmb=145837938.47.10.1230773473; __utmc=145837938; 
> __utmz=145837938.1230773473.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd= 
> (none); username=eklutna.waterplant', 
>  'HTTP_HOST': 'wxcoder.org', 
>  'HTTP_PRAGMA': 'no-cache', 
>  'HTTP_REFERER': 'http://wxcoder.org/wxcoder/observations/enter/? 
> date=20081207 
> ', 
>  'HTTP_UA_CPU': 'x86', 
>  'HTTP_USER_AGENT': 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 
> 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 
> 3.0.04506.30; .NET CLR 3.0.04506.648)', 
>  'HTTP_VIA': '1.0 AWWUPROX3', 
>  'PATH_INFO': u'/wxcoder/observations/enter/', 
>  'PATH_TRANSLATED': None, 
>  'QUERY_STRING': None, 
>  'REMOTE_ADDR': '209.112.193.38', 
>  'REMOTE_HOST': None, 
>  'REMOTE_IDENT': None, 
>  'REMOTE_USER': None, 
>  'REQUEST_METHOD': 'POST', 
>  'SCRIPT_NAME': '', 
>  'SERVER_NAME': 'wxcoder.org', 
>  'SERVER_PORT': 0, 
>  'SERVER_PROTOCOL': 'HTTP/1.1', 
>  'SERVER_SOFTWARE': 'mod_python'}>

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

Re: newbie question

2015-03-20 Thread VMD

On Friday, March 20, 2015 at 11:09:57 AM UTC-6, David Gleba wrote:
>
>
> You don't actually need python or django to get form input and do 
> something with the input.
>

My function is not as simple as adding two numbers and for various reasons 
I am not interested in using Javascript. I just used myadder(x,y)  as an 
example.


>
>
> On Friday, March 20, 2015 at 12:03:51 PM UTC-4, VMD wrote:
>>
>> On Friday, March 20, 2015 at 9:58:23 AM UTC-6, David Gleba wrote:
>>>
>>> Does part 3 of the tutorial cover how to make a form, get the values 
>>> without storing them in a database, perform the arithmetic and then display 
>>> the result? I didn't see that in there.
>>>
>>  
>> I don't what to store them in a database. Just do the calculation. Is 
>> this explained in the tutorial?
>>
>> I have been sick = brain not working well. maybe I'll get this figured 
>> out today or actually do the whole tutorial.
>>
>> VMD
>>
>>  
>>>
>>
>>> On Thursday, March 19, 2015 at 11:58:14 AM UTC-4, Andrew Farrell wrote:

 The other commenters are right that reading the tutorial is a good use 
 of your time.
 https://docs.djangoproject.com/en/1.7/intro/tutorial03/
 is the section relevant to your question.

 On Thu, Mar 19, 2015 at 10:39 AM, Javier Guerra Giraldez <
 jav...@guerrag.com> wrote:

> On Wed, Mar 18, 2015 at 9:41 PM, VMD  wrote:
> > I have skimmed the tutorial and didn't find (notice) the answer. Why 
> not
> > point me to an answer to my question?
>
>
> that's exactly the point.  your question assumes Django works in some
> specific way, and there should be a simple answer for a simple need.
>
> but i don't think you assumptions are correct, if you knew how Django
> (and frameworks in general) work, your question might be very
> different, and the answer much simpler and better in general.
>
> really, doing the tutorial is a very good investment of your time.
>
>
> --
> Javier
>
> --
> 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/CAFkDaoQ0MOT57JCKfTjxWn6CkypeP2POm%3DF90Vn%3DF88dYDDQdg%40mail.gmail.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/0fb52afc-17ec-4301-add2-85fc962f73b4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Maximum database connections exceeded

2015-03-20 Thread Andreas Kuhne
Hi Hans,

I know this isn't really solving your issue, but it can remove a symptom. I
have successfully used pgBouncer to pool the connections, so that
connections aren't handled by django directly, but you connect to a
connection pool, so that it can create and reuse connections more
efficiently. See https://wiki.postgresql.org/wiki/PgBouncer.

That would probably solve the symptoms of your problem, but not the problem
itself.

Regards,

Andréas

2015-03-20 16:52 GMT+01:00 Hans Kristian Flaatten :

> My Django application is exceeding the maximum number of simultaneous
> database
> connections (100) to the Postgres database when running through Gunicorn
> with
> async eventlet workers. When the limit it exceeded it starts returning
> 500-errors until new connections can be established.
>
> Setting `CONN_MAX_AGE` to 0, 60, 600, or None does not appear to solve
> this issue.
>
> *This is my database configuration:*
>
> DATABASES = {
> 'default': {
> 'ENGINE': 'django.contrib.gis.db.backends.postgis',
> 'NAME': 'django',
> 'USER': 'django',
> 'HOST': 'postgres',
> 'PORT': 5432,
> 'CONN_MAX_AGE': 60,
> }
> }
>
> *This is my Gunicorn configuration:*
>
> gunicorn --bind 0.0.0.0:8080 --worker-class eventlet --workers 5 myapp.
> wsgi:application
>
> *These are the installed packages:*
>
>-  djano v1.7
>-  gunicorn v19.3
>-  eventlet v0.17
>-  psycopg2 v2.6
>
> Any hints or tips on where to go from here? Is Django's ORM supposed to
> offer
> connection pooling/reuse, or is this something I have to get else where?
>
> --
> 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/a5bd0b59-638c-466d-9f85-aadd5edda500%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/CALXYUbnWG-%2BpjoS6vmHvBmGdJZMpKQw8%3DaV0kw6d0eHDPCGq3w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: newbie question

2015-03-20 Thread john
Maybe another way to reply to your question is to break down how it 
would work normally.

There are two sides of this question - the server side and the client side.

In general client side stuff is done in javascript.
Server side requests are done in python.

So you have to decide where you want this to happen.  If you chose the 
server side realize that a round trip has to occur.  This can be done 
and was done often but not normally used when dealing with direct user 
input (javascript is used) on the client side (in the browser).  You can 
in fact create a button that retrieves the data (executes a view 
function) and then returns a new view.  But that is very old school and 
normally not used.  You might want to look at how the django forms works 
under the hood and use similar code.


That said, the above is not the norm of today.  Within your template you 
add div id's that relate to javascript code.  When the action occurs the 
javascript is run (all on the client side) saving a round trip.  Today's 
javascript is able to retrieve data (execute a python function via a 
view), display data, insert new objects, etc..  So of course most use 
the best tool for the job.


Johnf

On 03/20/2015 10:32 AM, VMD wrote:


On Friday, March 20, 2015 at 11:09:57 AM UTC-6, David Gleba wrote:


You don't actually need python or django to get form input and do
something with the input.


My function is not as simple as adding two numbers and for various 
reasons I am not interested in using Javascript. I just used 
myadder(x,y)  as an example.





On Friday, March 20, 2015 at 12:03:51 PM UTC-4, VMD wrote:

On Friday, March 20, 2015 at 9:58:23 AM UTC-6, David Gleba wrote:

Does part 3 of the tutorial cover how to make a form, get
the values without storing them in a database, perform the
arithmetic and then display the result? I didn't see that
in there.

I don't what to store them in a database. Just do the
calculation. Is this explained in the tutorial?

I have been sick = brain not working well. maybe I'll get this
figured out today or actually do the whole tutorial.

VMD


On Thursday, March 19, 2015 at 11:58:14 AM UTC-4, Andrew
Farrell wrote:

The other commenters are right that reading the
tutorial is a good use of your time.
https://docs.djangoproject.com/en/1.7/intro/tutorial03/ 

is the section relevant to your question.

On Thu, Mar 19, 2015 at 10:39 AM, Javier Guerra
Giraldez  wrote:

On Wed, Mar 18, 2015 at 9:41 PM, VMD
 wrote:
> I have skimmed the tutorial and didn't find
(notice) the answer. Why not
> point me to an answer to my question?


that's exactly the point.  your question assumes
Django works in some
specific way, and there should be a simple answer
for a simple need.

but i don't think you assumptions are correct, if
you knew how Django
(and frameworks in general) work, your question
might be very
different, and the answer much simpler and better
in general.

really, doing the tutorial is a very good
investment of your time.


--
Javier

--
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/CAFkDaoQ0MOT57JCKfTjxWn6CkypeP2POm%3DF90Vn%3DF88dYDDQdg%40mail.gmail.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...@g

Re: newbie question

2015-03-20 Thread Vincent Davis
On Friday, March 20, 2015, john  wrote:

>  Maybe another way to reply to your question is to break down how it would
> work normally.
> There are two sides of this question - the server side and the client side.
>
> In general client side stuff is done in javascript.
> Server side requests are done in python.
>
> So you have to decide where you want this to happen.  If you chose the
> server side realize that a round trip has to occur.  This can be done and
> was done often but not normally used when dealing with direct user input
> (javascript is used) on the client side (in the browser).  You can in fact
> create a button that retrieves the data (executes a view function) and then
> returns a new view.  But that is very old school and normally not used.
> You might want to look at how the django forms works under the hood and use
> similar code.
>

The Python functions I wish to execute use numpy and other Python packages
I would like like to convert to JavaScript.


>
> That said, the above is not the norm of today.  Within your template you
> add div id's that relate to javascript code.  When the action occurs the
> javascript is run (all on the client side) saving a round trip.  Today's
> javascript is able to retrieve data (execute a python function via a view),
> display data, insert new objects, etc..  So of course most use the best
> tool for the job.
>
> Johnf
>


>
>
> On 03/20/2015 10:32 AM, VMD wrote:
>
>
> On Friday, March 20, 2015 at 11:09:57 AM UTC-6, David Gleba wrote:
>>
>>
>>  You don't actually need python or django to get form input and do
>> something with the input.
>>
>
>  My function is not as simple as adding two numbers and for various
> reasons I am not interested in using Javascript. I just used myadder(x,y)
>  as an example.
>
>
>>
>>
>> On Friday, March 20, 2015 at 12:03:51 PM UTC-4, VMD wrote:
>>>
>>> On Friday, March 20, 2015 at 9:58:23 AM UTC-6, David Gleba wrote:

 Does part 3 of the tutorial cover how to make a form, get the values
 without storing them in a database, perform the arithmetic and then display
 the result? I didn't see that in there.

>>>
>>> I don't what to store them in a database. Just do the calculation. Is
>>> this explained in the tutorial?
>>>
>>>  I have been sick = brain not working well. maybe I'll get this figured
>>> out today or actually do the whole tutorial.
>>>
>>>  VMD
>>>
>>>

>>>
 On Thursday, March 19, 2015 at 11:58:14 AM UTC-4, Andrew Farrell wrote:
>
> The other commenters are right that reading the tutorial is a good use
> of your time.
> https://docs.djangoproject.com/en/1.7/intro/tutorial03/
>  is the section relevant to your question.
>
> On Thu, Mar 19, 2015 at 10:39 AM, Javier Guerra Giraldez <
> jav...@guerrag.com> wrote:
>
>> On Wed, Mar 18, 2015 at 9:41 PM, VMD  wrote:
>> > I have skimmed the tutorial and didn't find (notice) the answer.
>> Why not
>> > point me to an answer to my question?
>>
>>
>> that's exactly the point.  your question assumes Django works in some
>> specific way, and there should be a simple answer for a simple need.
>>
>> but i don't think you assumptions are correct, if you knew how Django
>> (and frameworks in general) work, your question might be very
>> different, and the answer much simpler and better in general.
>>
>> really, doing the tutorial is a very good investment of your time.
>>
>>
>> --
>> Javier
>>
>> --
>> 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/CAFkDaoQ0MOT57JCKfTjxWn6CkypeP
>> 2POm%3DF90Vn%3DF88dYDDQdg%40mail.gmail.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/0fb52afc-17ec-4301-add2-85fc962f73b4%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
>


>  --
> You received this message because you are subscribed to 

HTML6 proposal for single-page apps without Javascript

2015-03-20 Thread Bobby Mozumder
Hi everbody,

I submitted a proposal to the W3C for browsers to implement a 
model-view-controller design pattern so that we don’t need to build them using 
Javascript frameworks for our sites.

The message is here:
https://lists.w3.org/Archives/Public/public-whatwg-archive/2015Mar/0071.html 


This should fit right in with Django on the server side.  Meanwhile, packages 
like Node.js are starting to implementthe back-end framework, because they 
already have the MVC framework in place on the front-end.

As a Python/Django coder, I’m pretty sure nobody here wants to write 
Javascript, so please provide feedback to that mailing list for this proposal.  

Thank you,

-bobby

-- 
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/62B49FE4-4D54-4928-8409-8CBD6DF0114F%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: newbie question

2015-03-20 Thread Tom Lockhart
> The Python functions I wish to execute use numpy and other Python packages I 
> would like like to convert to JavaScript.

As has been suggested, the tutorial is where you want to start. By the time you 
finish part 4 you will have a good idea how to bypass references to a data 
model and use forms and views to call something in numpy and return results.

Trying to skip the tutorial just means that you will be missing information 
required to be comfortable starting with Django. We pretty much all started 
there and do not regret it.

hth

- 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/15165428-D0C6-47B2-9F23-AC92B2D54BBB%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


templates tags works in scripts sections of the html?

2015-03-20 Thread dk
I am trying to create an autocomplete tag with jquery UI
http://jqueryui.com/autocomplete/



in my view I got a list of commands,   in the meant time I am just testing 
it, so I have a list with ["a", "aaa", "b", "bbb"]

 $(function() {
 var avaibleTags = [
  {% for i in list_commands %}
  {{ i }}
  {% endfor %}
 ];
 $( "#tags" ).autocomplete({
  source: avaibleTags
 });
});


but it doesn't work,   does the string replacement of the template tags 
works on the script part ?  or I might be missing something?  thanks =)

-- 
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/09c05edc-dd45-4c66-bae1-e30cd3bbdbf6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


key error raised using modelformset inside a wizardform

2015-03-20 Thread Alfredo Becerra
hello everybody! ^-^

i'm dealing with this:

Environment:


Request Method: GET
Request URL: 
http://localhost:8000/alta_socies/proces_alta_projecte_autoocupat/adreces/

Django Version: 1.7.7
Python Version: 2.7.9
Installed Applications:
('django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.formtools',
 'inici',
 'alta_socies',
 'empreses',
 'socies')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware')


Template error:
In template 
/home/usergci/gestioci/alta_socies/templates/alta_socies/proces_alta_autoocupat.html,
 
error at line 59
   0
   49 : 


   50 : 


   51 : 


   52 : 


   53 : 


   54 : {{ projecte.pas }}


   55 : {% block explicacio_pas %}{% endblock %}


   56 : 


   57 : {% csrf_token %}


   58 : {{ wizard.management_form }}


   59 :  {% if wizard.form.forms %} 


   60 : {{ wizard.form.management_form }}


   61 : {% for form in wizard.form.forms %}


   62 : {% block step_factory_form %}


   63 : {% endblock %}


   64 : {% endfor %}


   65 : {% else %}


   66 : {% block step_single_form %}


   67 : {% endblock %}


   68 : {% endif %}


   69 : 


Traceback:
File 
"/home/usergci/.virtualenvs/heteroceras/local/lib/python2.7/site-packages/django/core/handlers/base.py"
 
in get_response
  137. response = response.render()
File 
"/home/usergci/.virtualenvs/heteroceras/local/lib/python2.7/site-packages/django/template/response.py"
 
in render
  103. self.content = self.rendered_content
File 
"/home/usergci/.virtualenvs/heteroceras/local/lib/python2.7/site-packages/django/template/response.py"
 
in rendered_content
  80. content = template.render(context)
File 
"/home/usergci/.virtualenvs/heteroceras/local/lib/python2.7/site-packages/django/template/base.py"
 
in render
  148. return self._render(context)
File 
"/home/usergci/.virtualenvs/heteroceras/local/lib/python2.7/site-packages/django/template/base.py"
 
in _render
  142. return self.nodelist.render(context)
File 
"/home/usergci/.virtualenvs/heteroceras/local/lib/python2.7/site-packages/django/template/base.py"
 
in render
  844. bit = self.render_node(node, context)
File 
"/home/usergci/.virtualenvs/heteroceras/local/lib/python2.7/site-packages/django/template/debug.py"
 
in render_node
  80. return node.render(context)
File 
"/home/usergci/.virtualenvs/heteroceras/local/lib/python2.7/site-packages/django/template/loader_tags.py"
 
in render
  126. return compiled_parent._render(context)
File 
"/home/usergci/.virtualenvs/heteroceras/local/lib/python2.7/site-packages/django/template/base.py"
 
in _render
  142. return self.nodelist.render(context)
File 
"/home/usergci/.virtualenvs/heteroceras/local/lib/python2.7/site-packages/django/template/base.py"
 
in render
  844. bit = self.render_node(node, context)
File 
"/home/usergci/.virtualenvs/heteroceras/local/lib/python2.7/site-packages/django/template/debug.py"
 
in render_node
  80. return node.render(context)
File 
"/home/usergci/.virtualenvs/heteroceras/local/lib/python2.7/site-packages/django/template/loader_tags.py"
 
in render
  126. return compiled_parent._render(context)
File 
"/home/usergci/.virtualenvs/heteroceras/local/lib/python2.7/site-packages/django/template/base.py"
 
in _render
  142. return self.nodelist.render(context)
File 
"/home/usergci/.virtualenvs/heteroceras/local/lib/python2.7/site-packages/django/template/base.py"
 
in render
  844. bit = self.render_node(node, context)
File 
"/home/usergci/.virtualenvs/heteroceras/local/lib/python2.7/site-packages/django/template/debug.py"
 
in render_node
  80. return node.render(context)
File 
"/home/usergci/.virtualenvs/heteroceras/local/lib/python2.7/site-packages/django/template/loader_tags.py"
 
in render
  126. return compiled_parent._render(context)
File 
"/home/usergci/.virtualenvs/heteroceras/local/lib/python2.7/site-packages/django/template/base.py"
 
in _render
  142. return self.nodelist.render(context)
File 
"/home

How to supply parameters to "python manage.py syncdb" from a script?

2015-03-20 Thread Dan Dong
Hi,
  Does anybody know how to supply the input parameters to "python manage.py 
syncdb" from a script? E.g, to set the the followings parameters:

Would you like to create one now? (yes/no): yes
Username (leave blank to use 'root'): 
Email address: x
Password: xx
Password (again): xx


Cheers,
Dan

-- 
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/8f07775c-341f-40af-b25d-6364dfaaf966%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


key error when using modelformsets inside a wizardform

2015-03-20 Thread Alfredo Becerra
hello everybody!

i'm running in this error while using modelformsets inside a wizardform.

Environment:


Request Method: GET
Request URL: 
http://localhost:8000/alta_socies/proces_alta_projecte_autoocupat/adreces/

Django Version: 1.7.7
Python Version: 2.7.9
Installed Applications:
('django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.formtools',
 'inici',
 'alta_socies',
 'empreses',
 'socies')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware')


Template error:
In template 
/home/usergci/gestioci/alta_socies/templates/alta_socies/proces_alta_autoocupat.html,
 
error at line 59
   0
   49 : 


   50 : 


   51 : 


   52 : 


   53 : 


   54 : {{ projecte.pas }}


   55 : {% block explicacio_pas %}{% endblock %}


   56 : 


   57 : {% csrf_token %}


   58 : {{ wizard.management_form }}


   59 :  {% if wizard.form.forms %} 


   60 : {{ wizard.form.management_form }}


   61 : {% for form in wizard.form.forms %}


   62 : {% block step_factory_form %}


   63 : {% endblock %}


   64 : {% endfor %}


   65 : {% else %}


   66 : {% block step_single_form %}


   67 : {% endblock %}


   68 : {% endif %}


   69 : 


Traceback:
> File 
> "/home/usergci/.virtualenvs/heteroceras/local/lib/python2.7/site-packages/django/core/handlers/base.py"
>  
> in get_response
>   137. response = response.render()
> File 
> "/home/usergci/.virtualenvs/heteroceras/local/lib/python2.7/site-packages/django/template/response.py"
>  
> in render
>   103. self.content = self.rendered_content
> File 
> "/home/usergci/.virtualenvs/heteroceras/local/lib/python2.7/site-packages/django/template/response.py"
>  
> in rendered_content
>   80. content = template.render(context)
> File 
> "/home/usergci/.virtualenvs/heteroceras/local/lib/python2.7/site-packages/django/template/base.py"
>  
> in render
>   148. return self._render(context)
> File 
> "/home/usergci/.virtualenvs/heteroceras/local/lib/python2.7/site-packages/django/template/base.py"
>  
> in _render
>   142. return self.nodelist.render(context)
> File 
> "/home/usergci/.virtualenvs/heteroceras/local/lib/python2.7/site-packages/django/template/base.py"
>  
> in render
>   844. bit = self.render_node(node, context)
> File 
> "/home/usergci/.virtualenvs/heteroceras/local/lib/python2.7/site-packages/django/template/debug.py"
>  
> in render_node
>   80. return node.render(context)
> File 
> "/home/usergci/.virtualenvs/heteroceras/local/lib/python2.7/site-packages/django/template/loader_tags.py"
>  
> in render
>   126. return compiled_parent._render(context)
> File 
> "/home/usergci/.virtualenvs/heteroceras/local/lib/python2.7/site-packages/django/template/base.py"
>  
> in _render
>   142. return self.nodelist.render(context)
> File 
> "/home/usergci/.virtualenvs/heteroceras/local/lib/python2.7/site-packages/django/template/base.py"
>  
> in render
>   844. bit = self.render_node(node, context)
> File 
> "/home/usergci/.virtualenvs/heteroceras/local/lib/python2.7/site-packages/django/template/debug.py"
>  
> in render_node
>   80. return node.render(context)
> File 
> "/home/usergci/.virtualenvs/heteroceras/local/lib/python2.7/site-packages/django/template/loader_tags.py"
>  
> in render
>   126. return compiled_parent._render(context)
> File 
> "/home/usergci/.virtualenvs/heteroceras/local/lib/python2.7/site-packages/django/template/base.py"
>  
> in _render
>   142. return self.nodelist.render(context)
> File 
> "/home/usergci/.virtualenvs/heteroceras/local/lib/python2.7/site-packages/django/template/base.py"
>  
> in render
>   844. bit = self.render_node(node, context)
> File 
> "/home/usergci/.virtualenvs/heteroceras/local/lib/python2.7/site-packages/django/template/debug.py"
>  
> in render_node
>   80. return node.render(context)
> File 
> "/home/usergci/.virtualenvs/heteroceras/local/lib/python2.7/site-packages/django/template/loader_tags.py"
>  
> in render
>   126. return compiled_

Supply parameters to "manage.py syncdb" from a script?

2015-03-20 Thread Dan Dong
Hi, All,
  Does anybody know how to supply input parameters to "python manage.py 
syncdb" from a script? E.g. in a bash/python script, to set the following 
parameters:

Would you like to create one now? (yes/no): yes
Username (leave blank to use 'root'): 
Email address: x...@xxx.xxx
Password: x
Password (again): x


Cheers,
Dan

-- 
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/92eba9eb-1494-4b14-bbb5-482f002e5748%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: templates tags works in scripts sections of the html?

2015-03-20 Thread Stephen J. Butler
They do work. But did you check the generated page? I bet you get an
error in your browser's JavaScript console about syntax.

On Fri, Mar 20, 2015 at 4:59 PM, dk  wrote:
> I am trying to create an autocomplete tag with jquery UI
> http://jqueryui.com/autocomplete/
>
>
>
> in my view I got a list of commands,   in the meant time I am just testing
> it, so I have a list with ["a", "aaa", "b", "bbb"]
> 
>  $(function() {
>  var avaibleTags = [
>   {% for i in list_commands %}
>   {{ i }}
>   {% endfor %}
>  ];
>  $( "#tags" ).autocomplete({
>   source: avaibleTags
>  });
> });
> 
>
> but it doesn't work,   does the string replacement of the template tags
> works on the script part ?  or I might be missing something?  thanks =)
>
> --
> 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/09c05edc-dd45-4c66-bae1-e30cd3bbdbf6%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/CAD4ANxWJEfceeVuxmaX4hrWYFHg%2B09xWLk4NT%2BjbmiCvrTJvHA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: templates tags works in scripts sections of the html?

2015-03-20 Thread Vijay Khemlani
It works, but the javascript you are generating has syntax errors.

For example, you are missing the commas after every element.

Either way, dumping variables directly from django templates to JavaScript
is not very elegant, you could make a JSON object in the view beforehand

json_tags = json.dumps(list_commands)

and then ouputting them in the template

var avaibleTags = {{ json_tags|safe }}

On Fri, Mar 20, 2015 at 7:14 PM, Stephen J. Butler  wrote:

> They do work. But did you check the generated page? I bet you get an
> error in your browser's JavaScript console about syntax.
>
> On Fri, Mar 20, 2015 at 4:59 PM, dk  wrote:
> > I am trying to create an autocomplete tag with jquery UI
> > http://jqueryui.com/autocomplete/
> >
> >
> >
> > in my view I got a list of commands,   in the meant time I am just
> testing
> > it, so I have a list with ["a", "aaa", "b", "bbb"]
> > 
> >  $(function() {
> >  var avaibleTags = [
> >   {% for i in list_commands %}
> >   {{ i }}
> >   {% endfor %}
> >  ];
> >  $( "#tags" ).autocomplete({
> >   source: avaibleTags
> >  });
> > });
> > 
> >
> > but it doesn't work,   does the string replacement of the template tags
> > works on the script part ?  or I might be missing something?  thanks =)
> >
> > --
> > 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/09c05edc-dd45-4c66-bae1-e30cd3bbdbf6%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/CAD4ANxWJEfceeVuxmaX4hrWYFHg%2B09xWLk4NT%2BjbmiCvrTJvHA%40mail.gmail.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/CALn3ei2OQsKNgGCFBHJss%3DSCPgDqQ5VVpASQqBCi2wN8hUrjpA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to supply parameters to "python manage.py syncdb" from a script?

2015-03-20 Thread Russell Keith-Magee
On Sat, Mar 21, 2015 at 5:25 AM, Dan Dong  wrote:

> Hi,
>   Does anybody know how to supply the input parameters to "python
> manage.py syncdb" from a script? E.g, to set the the followings parameters:
>
> Would you like to create one now? (yes/no): yes
> Username (leave blank to use 'root'):
> Email address: x
> Password: xx
> Password (again): xx
>
> You don't - and that's by design.

If you're putting a password into a script, then that script is in plain
text, and so is your password - so you've just lost your security.

So - you don't pass input parameters to the script. You run the script with
the --noinput flag, which will prevent the script from prompting for user
input.

If you want to have an initial user in your database after syncdb, put that
user's data in a fixture, and load the fixture as part of the script. The
fixture will contain the password in a hashed format, so the password will
be protected.

Yours,
Russ Magee %-)

-- 
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/CAJxq84-TH5btiZjTBM1j704WhYmLGFdG0jFuAHHPrH0snBRUVw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: {{STATIC_URL }} or {% static "...." %} What`s the correct to use?

2015-03-20 Thread Fellipe Henrique
Man!!!

You don't believe what's the problem is!!?!

The problem is my Firefox!! For some reason, firefox make a huge cache..
and it's using very old version of CSS and JS... I clean All my data, and
work!!!


Thanks Again!

T.·.F.·.A.·. S+F
*Fellipe Henrique P. Soares*

e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge'
*Blog: http://fhbash.wordpress.com/ *
*GitHub: https://github.com/fellipeh *
*Twitter: @fh_bash*

On Fri, Mar 20, 2015 at 2:20 PM, Tom Lockhart 
wrote:

> On Mar 20, 2015, at 9:59 AM, Fellipe Henrique  wrote:
>
>
> On Fri, Mar 20, 2015 at 11:43 AM, Vijay Khemlani 
> wrote:
>
>> Soo when you open your webpage, look at its source code, click on the
>> "/static/public/css/bootstrap.min.css" path it shows the file in Firefox?
>>
>
> Yes.. when I open source code in firefox, click them.. show me the file..
> but, nothing to appears correctly my HTML...
>
> I really upset about these... I really don’t know what's happen here...
>
>
> Your original problem statement included:
>
>   …
>   - When I try to go:  localhost:8000/static   show these:
>   Page not found (404)
>   …
>
> In my debug setup, I have the same result, and this is normal. You
> *should* be able to take a specific static resource and put it into the
> browser as a URL. For example, I can put
> http://localhost:8000/static/fz/img/loadingAnimation.gif into my browser
> and that *does* find the gif.
>
> This is compatible with your observation that you can take the link in
> your html and that *does* work when pasted into your browser.
>
> I’m guessing that there is a problem with your HTML, not with your static
> setup. Can you distill the problem down to a simple HTML template and
> resulting page and post both?
>
> When debugging html template troubles you may want to play around with {%
> comment %}…{% endcomment %} blocks to get rid of code for testing.
>
> hth
>
> - Tom
>
>
>
> T.·.F.·.A.·. S+F
> *Fellipe Henrique P. Soares*
>
> e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \
> 's/(.)/chr(ord($1)-2*3)/ge'
> *Blog: http://fhbash.wordpress.com/ *
> *GitHub: https://github.com/fellipeh *
> *Twitter: @fh_bash*
>
> --
> 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/CAF1jwZG78iexn0uLign0Rj-d_dvi61%2BtrNHTnVxXMkUxOi_gSg%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
> Please consider the environment before printing this message.
> *This message may be privileged and/or confidential, and the sender does
> not waive any related rights and obligations.  Any distribution, use or
> copying of this message or the information it contains by other than an
> intended recipient is unauthorized.  If you received this message in error,
> please immediately advise me by return e-mail or phone.  All information,
> references, images, programs, source code, or other materials whatsoever
> contained in, or supplied with, this document are TRADE SECRETS and
> governed by the Uniform Trade Secrets Act.  User assumes all direct and
> consequential liabilities and costs that result from any unauthorized
> disclosure or use of this information.*
>
>  --
> 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/28DCD048-9BFB-4AD5-BCD8-9AEB585813B4%40gmail.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/CAF1jwZFm