Re: Django 1.7 has issues rendering pages on laptop

2014-09-11 Thread Michael Martin
opps, I forgot the url
com/watch?v=JZVPbHilwLI

On Thu, Sep 11, 2014 at 11:52 PM, Michael Martin 
wrote:

> I know there has to be something wrong with either jython2.7b3 or with the
> django 1.7 releases.  What I did was follow someones tutorial to show where
> I start experiencing problems with rendering.   If do tutorials 2-5, in the
> middle of tutorial 5 around 6:51 in the video is where Django fails to
> render anything for me.
>
>
>
>
>
>
>
> On Thu, Sep 11, 2014 at 6:21 PM, Lachlan Musicman 
> wrote:
>
>> Did you run
>>
>> python manage.py collectstatic
>>
>> ?
>>
>> cheers
>> L.
>>
>> On 12 September 2014 11:11, Michael A. Martin 
>> wrote:
>> > It seems like when I take all the CSS and JS the html renders with
>> images.
>> > But this site rendered with a previous version. I pretty much ruined
>> this
>> > dev project today trying to figure it out. I don't know why this worked
>> on
>> > the older version but not this version.
>> >
>> > On Sep 11, 2014, at 9:38 AM, Collin Anderson 
>> wrote:
>> >
>> > What happens if you go directly to the url of one of your static files?
>> >
>> > Also, please don't post your SECRET_KEY.
>> >
>> > --
>> > 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/bdcb900b-856c-4ecb-bcea-52298f7dc75a%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/E521B7F1-1449-4EEF-9023-BF708E111801%40gmail.com
>> .
>> > For more options, visit https://groups.google.com/d/optout.
>>
>>
>>
>> --
>> You have to be really clever to come up with a genuinely dangerous
>> thought. I am disheartened that people can be clever enough to do that
>> and not clever enough to do the obvious thing and KEEP THEIR IDIOT
>> MOUTHS SHUT about it, because it is much more important to sound
>> intelligent when talking to your friends.
>> This post was STUPID.
>>
>> ---
>> The Most Terrifying Thought Experiment of All Time
>>
>> http://www.slate.com/articles/technology/bitwise/2014/07/roko_s_basilisk_the_most_terrifying_thought_experiment_of_all_time.html
>>
>> --
>> 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/CAGBeqiN4oFoqM%2BW0-VXryHq8CWLU1H1H-qWWVkLXtXWbb85XSA%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/CAD0urK2O43OFv2M%3Dw6r-ZNJbT7%2B1n2S%3DJQGbPKgG%2B6cjAQLmiw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django 1.7 has issues rendering pages on laptop

2014-09-11 Thread Michael Martin
I know there has to be something wrong with either jython2.7b3 or with the
django 1.7 releases.  What I did was follow someones tutorial to show where
I start experiencing problems with rendering.   If do tutorials 2-5, in the
middle of tutorial 5 around 6:51 in the video is where Django fails to
render anything for me.







On Thu, Sep 11, 2014 at 6:21 PM, Lachlan Musicman  wrote:

> Did you run
>
> python manage.py collectstatic
>
> ?
>
> cheers
> L.
>
> On 12 September 2014 11:11, Michael A. Martin 
> wrote:
> > It seems like when I take all the CSS and JS the html renders with
> images.
> > But this site rendered with a previous version. I pretty much ruined this
> > dev project today trying to figure it out. I don't know why this worked
> on
> > the older version but not this version.
> >
> > On Sep 11, 2014, at 9:38 AM, Collin Anderson 
> wrote:
> >
> > What happens if you go directly to the url of one of your static files?
> >
> > Also, please don't post your SECRET_KEY.
> >
> > --
> > 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/bdcb900b-856c-4ecb-bcea-52298f7dc75a%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/E521B7F1-1449-4EEF-9023-BF708E111801%40gmail.com
> .
> > For more options, visit https://groups.google.com/d/optout.
>
>
>
> --
> You have to be really clever to come up with a genuinely dangerous
> thought. I am disheartened that people can be clever enough to do that
> and not clever enough to do the obvious thing and KEEP THEIR IDIOT
> MOUTHS SHUT about it, because it is much more important to sound
> intelligent when talking to your friends.
> This post was STUPID.
>
> ---
> The Most Terrifying Thought Experiment of All Time
>
> http://www.slate.com/articles/technology/bitwise/2014/07/roko_s_basilisk_the_most_terrifying_thought_experiment_of_all_time.html
>
> --
> 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/CAGBeqiN4oFoqM%2BW0-VXryHq8CWLU1H1H-qWWVkLXtXWbb85XSA%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/CAD0urK1D8LhJeBp4Eg79qFKwekKiNJH7rNHSt5Wr0CktJNfvyg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django 1.7 has issues rendering pages on laptop

2014-09-11 Thread Lachlan Musicman
Did you run

python manage.py collectstatic

?

cheers
L.

On 12 September 2014 11:11, Michael A. Martin  wrote:
> It seems like when I take all the CSS and JS the html renders with images.
> But this site rendered with a previous version. I pretty much ruined this
> dev project today trying to figure it out. I don't know why this worked on
> the older version but not this version.
>
> On Sep 11, 2014, at 9:38 AM, Collin Anderson  wrote:
>
> What happens if you go directly to the url of one of your static files?
>
> Also, please don't post your SECRET_KEY.
>
> --
> 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/bdcb900b-856c-4ecb-bcea-52298f7dc75a%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/E521B7F1-1449-4EEF-9023-BF708E111801%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
You have to be really clever to come up with a genuinely dangerous
thought. I am disheartened that people can be clever enough to do that
and not clever enough to do the obvious thing and KEEP THEIR IDIOT
MOUTHS SHUT about it, because it is much more important to sound
intelligent when talking to your friends.
This post was STUPID.
---
The Most Terrifying Thought Experiment of All Time
http://www.slate.com/articles/technology/bitwise/2014/07/roko_s_basilisk_the_most_terrifying_thought_experiment_of_all_time.html

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


Re: Django 1.7 has issues rendering pages on laptop

2014-09-11 Thread Michael A. Martin
It seems like when I take all the CSS and JS the html renders with images. But 
this site rendered with a previous version. I pretty much ruined this dev 
project today trying to figure it out. I don't know why this worked on the 
older version but not this version. 

> On Sep 11, 2014, at 9:38 AM, Collin Anderson  wrote:
> 
> What happens if you go directly to the url of one of your static files?
> 
> Also, please don't post your SECRET_KEY.
> -- 
> 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/bdcb900b-856c-4ecb-bcea-52298f7dc75a%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/E521B7F1-1449-4EEF-9023-BF708E111801%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Three Django forms in different tabs in one template?

2014-09-11 Thread Mario Gudelj
K. Another option would be to render all the forms in GET and then use Ajax
and 3 different views to process POST requests from those forms.

Or you can add different values to each of the form's submit button and
check which form form is being submitted by that value. That's if you want
to use the same view to process all 3 forms. Example:

if request.method == "POST":
if request.POST['submit_button_name'] == "Submit Button Value":


On 12 September 2014 04:11, Andrew Pinkham  wrote:

> Hi Franco, Faridul, Stodge,
>
> There are actually quite a few problems being asked. I've split them up
> into discrete questions.
>
> 1. Can a single view function print three forms in a template?
>
> Yes.
>
> WARNING: I am coding all of this off the top of my head. The code is
> likely riddled with typos and errors. Sorry. Hopefully the example will
> demonstrate enough of the idea.
>
> # VIEW FUNCTION
> # Start by invoking the forms you want
> # remember to pass POST or initial data if necessary
> form1 = FormClassOne()
> # etc for as many forms as you'd like.
>
> # Create a Context or Request Context
> c = Context({"foo": [form1, form2, form3]})
>
> # or, more easily, use the `render` shortcut
> render(
> request,
> template_name_vsr,
> {'forms' : [form1, form2, form3]})
>
> # TEMPLATE
> 
> {% for form in forms %}
>   
>  method="post">
> {% csrf_token %}
> {{ form.as_p }}
> 
> 
>   
> {% endfor %}
> 
>
> 2. How should I handle the submission process (POST data)? With one view
> function, or with three view functions?
>
> Both are valid ways of doing it, but I heavily favor the method with three
> POST processing views. The reason is that by combining all this logic in
> one location, you are increasing the complexity of your site drastically.
> Debugging that will be no fun in the event of a problem. Having a place
> where the forms are as simple as possible is quite desirable. Remember to
> write tests.
>
> I would recommend starting with the three view method, and then moving
> into the single view function method, if so desired.
>
> 3. How do I program three view functions to handle POST requests from
> forms in a single view function?
>
> Start by creating a basic view function that handles both the GET (display
> of form) and POST (submission of data) for all of the forms (just as you
> would regularly). A Generic Class Based View might be all you need here,
> but it might be wise to start with a simple Class Based View.
>
> Now, simply point the forms above to these webpage urls. There are many
> ways to do this. I would consider: (1) adding the action URL to the form
> class as an instance variable, or else (2) simply building the URL in the
> single form view and passing it to the URL.
>
> Note: you may have/want to account for the URL referring to these forms. I
> am fuzzy on the details
>
> Consider that having a separate view/page for each form will help debug
> any issues, as you have a place where the complexity of the form/view is as
> low as possible.
>
> 4. How do I program a single view function to handle POST requests from
> all three forms?
>
> The first problem is that you need to know which form has been submitted
> from the single view page. Using a hidden form field may provide that
> information, or checking the keys of the POST querydict may also work.
> However, in both cases, you are relying on information provided by the
> user, which is a Bad Idea. This is the biggest reason not to follow this
> method.
>
> However, once you know which form is being submitted, you may then process
> it according to the rules set forth in the three views your previously
> programmed. Remember to adhere to DRY (ie: split the functionality into
> small, reusable pieces)!
>
> I realize that's a lot of info, but again, there was quite a lot being
> asked. I hope that helps clarify the issue.
>
> Andrew
>
> --
> 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/24D6792A-4316-4806-8D10-470EAD15BCFD%40andrewsforge.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 

Re: How to allow editing m2m relationship with nice widget on both models in admin interface?

2014-09-11 Thread Daniel Oźminkowski
Thanks. I saw it, but thought that there would be a better way to do this. 
because this was asked 2 years ago. I'll give it a tree.
What do you think about splitting models that depend on each another into 
separate apps? Is that the right thing to do?

W dniu środa, 10 września 2014 15:37:15 UTC+2 użytkownik Collin Anderson 
napisał:
>
> There's an ancient ticket about this:
>
> https://code.djangoproject.com/ticket/897
>
> and a workaround on stackoverflow:
>
> http://stackoverflow.com/questions/9879687/adding-a-manytomanywidget-to-the-reverse-of-a-manytomanyfield-in-the-django-admi
>

-- 
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/590f0004-9a06-4c81-a0d4-2144621c3a11%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Three Django forms in different tabs in one template?

2014-09-11 Thread Andrew Pinkham
Hi Franco, Faridul, Stodge,

There are actually quite a few problems being asked. I've split them up into 
discrete questions.

1. Can a single view function print three forms in a template?

Yes.

WARNING: I am coding all of this off the top of my head. The code is likely 
riddled with typos and errors. Sorry. Hopefully the example will demonstrate 
enough of the idea.

# VIEW FUNCTION
# Start by invoking the forms you want
# remember to pass POST or initial data if necessary 
form1 = FormClassOne()
# etc for as many forms as you'd like.

# Create a Context or Request Context
c = Context({"foo": [form1, form2, form3]})

# or, more easily, use the `render` shortcut
render(
request,
template_name_vsr,
{'forms' : [form1, form2, form3]})

# TEMPLATE

{% for form in forms %}
  

{% csrf_token %}
{{ form.as_p }}


  
{% endfor %}


2. How should I handle the submission process (POST data)? With one view 
function, or with three view functions?

Both are valid ways of doing it, but I heavily favor the method with three POST 
processing views. The reason is that by combining all this logic in one 
location, you are increasing the complexity of your site drastically. Debugging 
that will be no fun in the event of a problem. Having a place where the forms 
are as simple as possible is quite desirable. Remember to write tests.

I would recommend starting with the three view method, and then moving into the 
single view function method, if so desired.

3. How do I program three view functions to handle POST requests from forms in 
a single view function?

Start by creating a basic view function that handles both the GET (display of 
form) and POST (submission of data) for all of the forms (just as you would 
regularly). A Generic Class Based View might be all you need here, but it might 
be wise to start with a simple Class Based View.

Now, simply point the forms above to these webpage urls. There are many ways to 
do this. I would consider: (1) adding the action URL to the form class as an 
instance variable, or else (2) simply building the URL in the single form view 
and passing it to the URL.

Note: you may have/want to account for the URL referring to these forms. I am 
fuzzy on the details

Consider that having a separate view/page for each form will help debug any 
issues, as you have a place where the complexity of the form/view is as low as 
possible.

4. How do I program a single view function to handle POST requests from all 
three forms?

The first problem is that you need to know which form has been submitted from 
the single view page. Using a hidden form field may provide that information, 
or checking the keys of the POST querydict may also work. However, in both 
cases, you are relying on information provided by the user, which is a Bad 
Idea. This is the biggest reason not to follow this method.

However, once you know which form is being submitted, you may then process it 
according to the rules set forth in the three views your previously programmed. 
Remember to adhere to DRY (ie: split the functionality into small, reusable 
pieces)!

I realize that's a lot of info, but again, there was quite a lot being asked. I 
hope that helps clarify the issue.

Andrew

-- 
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/24D6792A-4316-4806-8D10-470EAD15BCFD%40andrewsforge.com.
For more options, visit https://groups.google.com/d/optout.


Re: Excel Sorting

2014-09-11 Thread Gregory Strydom
Thanks very much for the help! Those look exactly like what im looking for
:) I will start on them once im back at work tomorrow.


On Thu, Sep 11, 2014 at 3:39 PM, François Schiettecatte <
fschietteca...@gmail.com> wrote:

> You have three ways you can do this:
>
> - In the browser with Javascript, with all the data stored in the page (as
> a javascript array).
>
> - In the browser with Javascript and a REST call to Django to get the data
> (in JSON for example).
>
> - With a url that reloads the page with different parameters to
> sort/filter the data.
>
> François
>
> On Sep 11, 2014, at 9:33 AM, Gregory Strydom 
> wrote:
>
> > Sorry i forgot to mention the filtering/sorting should be done in the
> view so the user can simply click on a button and sort by date, category etc
> >
> > --
> > 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/af02ef85-eb9d-4537-93d0-da6a02ebd488%40googlegroups.com
> .
> > For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/BA7LsOHsVGw/unsubscribe.
> To unsubscribe from this group and all its topics, 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/C8467525-0FCE-41FA-8A63-440AFF1BD309%40gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
 - Best Wishes
   Gregory Strydom

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


What is this "l" folder when running makemessages/compilemessages?

2014-09-11 Thread Malte Beckmann
When running those commands:
$ django-admin.py makemessages --all
$ django-admin.py compilemessages

A "l" folder is generated (/var/django/jnj/jnj/locale/l/LC_MESSAGES) - what 
does that l folder contain? The base locale from which everything is 
translated?

-- 
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/bca179e6-9078-4b1e-a197-5be91678e682%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Excel Sorting

2014-09-11 Thread James Schneider
Also check out django-tables2, which includes the sorting magic you are
looking for. It uses the third option that François outlined below.

http://django-tables2.readthedocs.org/en/latest/

-James

On Thursday, September 11, 2014, François Schiettecatte <
fschietteca...@gmail.com> wrote:

> You have three ways you can do this:
>
> - In the browser with Javascript, with all the data stored in the page (as
> a javascript array).
>
> - In the browser with Javascript and a REST call to Django to get the data
> (in JSON for example).
>
> - With a url that reloads the page with different parameters to
> sort/filter the data.
>
> François
>
> On Sep 11, 2014, at 9:33 AM, Gregory Strydom  > wrote:
>
> > Sorry i forgot to mention the filtering/sorting should be done in the
> view so the user can simply click on a button and sort by date, category etc
> >
> > --
> > 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/af02ef85-eb9d-4537-93d0-da6a02ebd488%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/C8467525-0FCE-41FA-8A63-440AFF1BD309%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/CA%2Be%2BciVBTpH%2BMa1oyhBFfwcQWnk%2B0zkaDwdT-_g6aaPt5-Snxg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django 1.7 has issues rendering pages on laptop

2014-09-11 Thread Collin Anderson
What happens if you go directly to the url of one of your static files?

Also, please don't post your SECRET_KEY.

-- 
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/bdcb900b-856c-4ecb-bcea-52298f7dc75a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django 1.7 has issues rendering pages on laptop

2014-09-11 Thread Michael Martin
Here is an example of a template that use to work.


{% load static %}


  







Launch with Code













  

  




  
Hello, world!
This is a template for a simple marketing or informational
website. It includes a large callout called a jumbotron and three
supporting pieces of content. Use it as a starting point to create
something more unique.
Learn more
»
  



{% block content %}

  {% endblock %}
 

  

  
© Company 2014
  
 




https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js";>



  



On Thu, Sep 11, 2014 at 9:32 AM, Michael Martin 
wrote:

> I just sent my settings, but as you can see I have debug turned on and
> django.contrib.staticfiles in the installed apps.
>
>  Someone please help me, I can't do any development like this.
>
> On Thu, Sep 11, 2014 at 9:29 AM, Michael Martin 
> wrote:
>
>> """
>> Django settings for lwc project.
>>
>> For more information on this file, see
>> https://docs.djangoproject.com/en/dev/topics/settings/
>>
>> For the full list of settings and their values, see
>> https://docs.djangoproject.com/en/dev/ref/settings/
>> """
>>
>> # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
>> import os
>> BASE_DIR = os.path.dirname(os.path.dirname(__file__))
>>
>> # Quick-start development settings - unsuitable for production
>> # See https://docs.djangoproject.com/en/dev/howto/deployment/checklist/
>>
>> # SECURITY WARNING: keep the secret key used in production secret!
>> SECRET_KEY = '#(8-z@j1-h1hzs2a+(8p9ns(g0x3e@japhuvg!9k$bjyo4ao*e'
>>
>> # SECURITY WARNING: don't run with debug turned on in production!
>> DEBUG = True
>>
>> TEMPLATE_DEBUG = True
>>
>> ALLOWED_HOSTS = []
>>
>>
>> # Application definition
>>
>> INSTALLED_APPS = (
>> 'django.contrib.admin',
>> 'django.contrib.auth',
>> 'django.contrib.contenttypes',
>> 'django.contrib.sessions',
>> 'django.contrib.messages',
>> 'django.contrib.staticfiles',
>> 'doj',
>> 'joins',
>> )
>>
>> MIDDLEWARE_CLASSES = (
>> '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',
>> )
>>
>> ROOT_URLCONF = 'lwc.urls'
>>
>> WSGI_APPLICATION = 'lwc.wsgi.application'
>>
>>
>> # Database
>> # https://docs.djangoproject.com/en/dev/ref/settings/#databases
>>
>> DATABASES = {
>> 'default': {
>> 'ENGINE': 'doj.db.backends.postgresql',
>> 'NAME': 'lwc',
>> 'USER': 'lwc',
>> 'PASSWORD': 'SD!betaNEW1',
>> 'HOST': '127.0.0.1',
>> 'PORT': '5432',
>> }
>> }
>>
>> #DATABASES = {
>> #'default': {
>> #'ENGINE': 'doj.db.backends.mysql',
>> #'NAME': 'lwc',
>> #'USER': 'root',
>> #'PASSWORD': 'SD!betaNEW1',
>> #'HOST': '127.0.0.1',
>> #'PORT': '3306',
>> #   }
>> #}
>> # Internationalization
>> # https://docs.djangoproject.com/en/dev/topics/i18n/
>>
>> LANGUAGE_CODE = 'en-us'
>>
>> TIME_ZONE = 'UTC'
>>
>> USE_I18N = True
>>
>> USE_L10N = True
>>
>> USE_TZ = True
>>
>>
>> # Static files (CSS, JavaScript, Images)
>> # https://docs.djangoproject.com/en/dev/howto/static-files/
>> #C:\Users\michmar3\workspace\lwc
>> TEMPLATE_DIRS = [os.path.join(BASE_DIR, 'templates')]
>>
>> STATIC_URL = '/static/'
>>
>> STATICFILES_DIRS = [ os.path.join(BASE_DIR, "static")]
>>
>> On Thu, Sep 11, 2014 at 9:17 AM, Collin Anderson 
>> wrote:
>>
>>> and do you have the "staticfiles" app in your INSTALLED_APPS?
>>>
>>> --
>>> 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/5064fed6-a927-4a48-8a35-ef0534c75e2d%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@googleg

Re: Django 1.5.1 - Mysql - Setting

2014-09-11 Thread Fred Stluka

Ahmed,

For connecting Django to MySQL, I use MySQL-python, installed
via pip as:
pip install MySQL-python

My settings file contains:

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME'  : 'name of our database',
'USER'  : 'username to access the database',
'PASSWORD'  : 'password to access the database',
# Required for Windows; Harmless (same as default) for Linux
'HOST'  : '127.0.0.1',
# Required for Windows; Harmless (same as default) for Linux
'PORT'  : '3306',
},

--Fred

Fred Stluka -- mailto:f...@bristle.com -- http://bristle.com/~fred/
Bristle Software, Inc -- http://bristle.com -- Glad to be of service!
Open Source: Without walls and fences, we need no Windows or Gates.

On 9/11/14 9:34 AM, Muhammad Ahmed wrote:

Hi,

I have been trying to launch my Django Model using a tutorial. but 
unfortunately the tutorial is about Django 1.1.


Kindly guide me that what configuration (in setting.py) will be 
required if I use Python27 / Django 1.5.1 with Mysql.


please also guide towards the appropriate "MySql Adoptor" for Django 
1.5.1.



Thanks in advance :)


Ahmed
--
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/881464cf-d4aa-4934-9915-3830ebafd4e6%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/5411CEF6.7090702%40bristle.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django 1.7 has issues rendering pages on laptop

2014-09-11 Thread Michael Martin
I just sent my settings, but as you can see I have debug turned on and
django.contrib.staticfiles in the installed apps.

 Someone please help me, I can't do any development like this.

On Thu, Sep 11, 2014 at 9:29 AM, Michael Martin 
wrote:

> """
> Django settings for lwc project.
>
> For more information on this file, see
> https://docs.djangoproject.com/en/dev/topics/settings/
>
> For the full list of settings and their values, see
> https://docs.djangoproject.com/en/dev/ref/settings/
> """
>
> # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
> import os
> BASE_DIR = os.path.dirname(os.path.dirname(__file__))
>
> # Quick-start development settings - unsuitable for production
> # See https://docs.djangoproject.com/en/dev/howto/deployment/checklist/
>
> # SECURITY WARNING: keep the secret key used in production secret!
> SECRET_KEY = '#(8-z@j1-h1hzs2a+(8p9ns(g0x3e@japhuvg!9k$bjyo4ao*e'
>
> # SECURITY WARNING: don't run with debug turned on in production!
> DEBUG = True
>
> TEMPLATE_DEBUG = True
>
> ALLOWED_HOSTS = []
>
>
> # Application definition
>
> INSTALLED_APPS = (
> 'django.contrib.admin',
> 'django.contrib.auth',
> 'django.contrib.contenttypes',
> 'django.contrib.sessions',
> 'django.contrib.messages',
> 'django.contrib.staticfiles',
> 'doj',
> 'joins',
> )
>
> MIDDLEWARE_CLASSES = (
> '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',
> )
>
> ROOT_URLCONF = 'lwc.urls'
>
> WSGI_APPLICATION = 'lwc.wsgi.application'
>
>
> # Database
> # https://docs.djangoproject.com/en/dev/ref/settings/#databases
>
> DATABASES = {
> 'default': {
> 'ENGINE': 'doj.db.backends.postgresql',
> 'NAME': 'lwc',
> 'USER': 'lwc',
> 'PASSWORD': 'SD!betaNEW1',
> 'HOST': '127.0.0.1',
> 'PORT': '5432',
> }
> }
>
> #DATABASES = {
> #'default': {
> #'ENGINE': 'doj.db.backends.mysql',
> #'NAME': 'lwc',
> #'USER': 'root',
> #'PASSWORD': 'SD!betaNEW1',
> #'HOST': '127.0.0.1',
> #'PORT': '3306',
> #   }
> #}
> # Internationalization
> # https://docs.djangoproject.com/en/dev/topics/i18n/
>
> LANGUAGE_CODE = 'en-us'
>
> TIME_ZONE = 'UTC'
>
> USE_I18N = True
>
> USE_L10N = True
>
> USE_TZ = True
>
>
> # Static files (CSS, JavaScript, Images)
> # https://docs.djangoproject.com/en/dev/howto/static-files/
> #C:\Users\michmar3\workspace\lwc
> TEMPLATE_DIRS = [os.path.join(BASE_DIR, 'templates')]
>
> STATIC_URL = '/static/'
>
> STATICFILES_DIRS = [ os.path.join(BASE_DIR, "static")]
>
> On Thu, Sep 11, 2014 at 9:17 AM, Collin Anderson 
> wrote:
>
>> and do you have the "staticfiles" app in your INSTALLED_APPS?
>>
>> --
>> 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/5064fed6-a927-4a48-8a35-ef0534c75e2d%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/CAD0urK1hp%3DqGUqPMeFbH_6tXDMwGqm2ErdiHv%2BMsch5%2Bt%3Dtz5g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django 1.7 has issues rendering pages on laptop

2014-09-11 Thread Michael Martin
"""
Django settings for lwc project.

For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"""

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))

# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/dev/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '#(8-z@j1-h1hzs2a+(8p9ns(g0x3e@japhuvg!9k$bjyo4ao*e'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

TEMPLATE_DEBUG = True

ALLOWED_HOSTS = []


# Application definition

INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'doj',
'joins',
)

MIDDLEWARE_CLASSES = (
'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',
)

ROOT_URLCONF = 'lwc.urls'

WSGI_APPLICATION = 'lwc.wsgi.application'


# Database
# https://docs.djangoproject.com/en/dev/ref/settings/#databases

DATABASES = {
'default': {
'ENGINE': 'doj.db.backends.postgresql',
'NAME': 'lwc',
'USER': 'lwc',
'PASSWORD': 'SD!betaNEW1',
'HOST': '127.0.0.1',
'PORT': '5432',
}
}

#DATABASES = {
#'default': {
#'ENGINE': 'doj.db.backends.mysql',
#'NAME': 'lwc',
#'USER': 'root',
#'PASSWORD': 'SD!betaNEW1',
#'HOST': '127.0.0.1',
#'PORT': '3306',
#   }
#}
# Internationalization
# https://docs.djangoproject.com/en/dev/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/dev/howto/static-files/
#C:\Users\michmar3\workspace\lwc
TEMPLATE_DIRS = [os.path.join(BASE_DIR, 'templates')]

STATIC_URL = '/static/'

STATICFILES_DIRS = [ os.path.join(BASE_DIR, "static")]

On Thu, Sep 11, 2014 at 9:17 AM, Collin Anderson 
wrote:

> and do you have the "staticfiles" app in your INSTALLED_APPS?
>
> --
> 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/5064fed6-a927-4a48-8a35-ef0534c75e2d%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/CAD0urK2Wu%3D%2BNVm2-aLy69pF3PVe5NY6MmOsq82T_e5LLWVY7dg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django admin list sort error

2014-09-11 Thread Collin Anderson
Yes, it does sound like a bug. Can you reproduce it with a minimal project?

-- 
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/c5289fa0-b5ee-4ad2-806a-1a311166a23d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Issue with models.FilePathField in Django 1.7 Admin?

2014-09-11 Thread Collin Anderson
try checking os.listdir(settings.BASE_SFTP_DIRECTORY) to see if python can 
actually see your files.

-- 
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/d3a4e9b1-9e8a-4270-84de-5a339ec2cdd8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django 1.7 has issues rendering pages on laptop

2014-09-11 Thread Collin Anderson
and do you have the "staticfiles" app in your INSTALLED_APPS?

-- 
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/5064fed6-a927-4a48-8a35-ef0534c75e2d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django 1.7 has issues rendering pages on laptop

2014-09-11 Thread Collin Anderson
Do you have DEBUG = True?

-- 
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/9573d28a-7a2e-4cec-b603-2f879f79b52b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Long-running process using Django ORM maxes out psql connections

2014-09-11 Thread Paco de Kumite

>
> This may not be the cleanest, but it works:
>

First make a decorator, like this:

import django.db
from functools import wraps

def close_dbconn(func):
@wraps(func)
def close_dbconn_func(*args, **kwargs):
func(*args,**kwargs)
django.db.close_old_connections()

return close_dbconn_func

Then any function in the script that makes db queries needs to be decorated 
with @close_dbconn

 

-- 
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/cd4f91f6-4ddb-4ecd-827a-94b3e4187488%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django 1.7 has issues rendering pages on laptop

2014-09-11 Thread Pitchblack
Hello,

I have installed Debian 7, Jython 2.7b3 and Django 1.7.  After installing 
everything, I ran jython manage.py runserver.  If I have css files and js 
files referenced in the html, the pages don't render.  But the pages use to 
render in the older version of Django.  Does anyone have any ideas?

-- 
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/2e632f5b-4af8-4045-a3b4-242a7af9cf50%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Three Django forms in different tabs in one template?

2014-09-11 Thread Franco H
Hi im from Argentina im in the same situation, do u find a answer? can u 
shared it with me?

On Thursday, October 24, 2013 3:56:29 PM UTC-3, Faridul Islam wrote:
>
> Hello Stodge,
>  
> I was searching for an example of mutli-tab pages within a single view 
> using Django and found your post which almost three years old. I am not 
> sure whether you still work with Django or not. If you do, I will 
> appreciate if you can share one example of it with me. FYI, this is my 
> first time working with Django.
>  
> Thanks.
>
> On Monday, September 13, 2010 6:48:21 AM UTC-5, Stodge wrote:
>
>> I'm working through a nice little feature for my website that will 
>> bring all user editable preferences/profile options together into a 
>> single web page using tabs. I have the tabs working and I can display 
>> a different Django form on each tab but I'm confused how to tie it all 
>> together using a view. 
>>
>> Typically each form would be on a separate page using different views. 
>> But how would I support say three forms on one page (in three tabs)? I 
>> need one view to generate all of the tabs but one view can't support 
>> three forms? What's the best way to implement this? 
>>
>> Should I have three views to handle the POST requests for the three 
>> forms and then a reusable function that renders the template? 
>>
>> 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/ed5aa54a-67f1-4d47-b024-85ce45bf3dda%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Long-running process using Django ORM maxes out psql connections

2014-09-11 Thread Paco de Kumite
Hello.  I have a standalone script that is long-running (i.e is supposed to 
run in a loop forever).  This script uses the Django ORM for work on a 
database.  For example, every two seconds it does a MyModel.objects.all().

Works awesome, but after a while I get

OperationalError: FATAL:  remaining connection slots are reserved for 
non-replication superuser connections

The db in use is postgresql with psycopg2 backend.  If I watch the number 
of connections in psql I see the number go up and up and up.  So it's like 
the above query creates a NEW connection every time through the loop.  I 
read that in django connections get closed at the end of  "request", but 
since this is a long running process with no request the signal that causes 
the connection to close doesn't ever get triggered and the connections 
never close.

Ideally I think I would want to create a single connection for the process 
and keep it open forever (or at least a long time) and somehow "pass" that 
connection to the ORM to use, rather than opening a new connection for 
every query.

There is also connection 
pooling http://www.craigkerstiens.com/2013/03/07/Fixing-django-db-connections/, 
but now that I got this error I remember that I had this same problem in 
the past with a long-running script that uses django orm.  In that case I 
tried using connection pooling, but it didn't work.  In the end I migrated 
all the db stuff to use pymongo and handled connections manually (which 
ended up working like a charm).  I'd like to avoid this route this time.

Any insight on how to handle this would be great.


-- 
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/c853ab92-9389-4e65-b33e-2b82ce4eaca3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Excel Sorting

2014-09-11 Thread François Schiettecatte
You have three ways you can do this:

- In the browser with Javascript, with all the data stored in the page (as a 
javascript array).

- In the browser with Javascript and a REST call to Django to get the data (in 
JSON for example).

- With a url that reloads the page with different parameters to sort/filter the 
data.

François

On Sep 11, 2014, at 9:33 AM, Gregory Strydom  
wrote:

> Sorry i forgot to mention the filtering/sorting should be done in the view so 
> the user can simply click on a button and sort by date, category etc
> 
> -- 
> 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/af02ef85-eb9d-4537-93d0-da6a02ebd488%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/C8467525-0FCE-41FA-8A63-440AFF1BD309%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Django 1.5.1 - Mysql - Setting

2014-09-11 Thread Muhammad Ahmed
Hi, 

I have been trying to launch my Django Model using a tutorial. but 
unfortunately the tutorial is about Django 1.1.

Kindly guide me that what configuration (in setting.py) will be required if 
I use Python27 / Django 1.5.1 with Mysql. 

please also guide towards the appropriate "MySql Adoptor" for Django 1.5.1. 


Thanks in advance :) 


Ahmed

-- 
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/881464cf-d4aa-4934-9915-3830ebafd4e6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Excel Sorting

2014-09-11 Thread Gregory Strydom
Sorry i forgot to mention the filtering/sorting should be done in the view 
so the user can simply click on a button and sort by date, category etc

-- 
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/af02ef85-eb9d-4537-93d0-da6a02ebd488%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Excel Sorting

2014-09-11 Thread Gregory Strydom
Sorry i forgot to mention the filtering should be done while viewing the 
template so the user can simple choose sort by date, category etc on the 
fly.

On Thursday, 11 September 2014 15:29:21 UTC+2, Gregory Strydom wrote:
>
> Hey all.
>
> I am just curious, is there any to do Excel style filtering in Django? Eg: 
> Sort by date , category etc
>
> The closest thing i have seen which resembles something like that is 
> dictsort() or regroup(), but i have no idea how that would work for what i 
> want. The only other option i could think of would be javascript, but again 
> i dont know if that is needed if django does it naturally.
>
> Thank you for any help with this!
>

-- 
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/5a96b96e-1df1-43e0-8035-1b00ed2ffc03%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Excel Sorting

2014-09-11 Thread Gregory Strydom
Hey all.

I am just curious, is there any to do Excel style filtering in Django? Eg: 
Sort by date , category etc

The closest thing i have seen which resembles something like that is 
dictsort() or regroup(), but i have no idea how that would work for what i 
want. The only other option i could think of would be javascript, but again 
i dont know if that is needed if django does it naturally.

Thank you for any help with this!

-- 
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/7ea2fbc7-8763-48ad-b316-d8e9a44cd041%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: heroku django

2014-09-11 Thread ngangsia akumbo
Thanks very much bro 

can we meet online my skype

ngangsi.richard

On Thursday, September 11, 2014 1:21:06 PM UTC+1, Kevin Ndung'u wrote:
>
> Yes, you can. You can develop locally then when the time comes to deploy 
> it then add it to Github and subsequently to Heroku.
>
> I personally prefer this since you get to focus on the app first and 
> deploy later.
>
> On Thursday, September 11, 2014 11:29:39 AM UTC+3, ngangsia akumbo wrote:
>>
>> i have a problem
>> can i create a complete django application on my machine before deplying 
>> it to heroku
>>
>> that is i start by creating the django app on my local linux machine 
>> before trying to deploy it online
>> i a confused here a bit pleas i need some help
>>
>

-- 
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/4ff8c27e-61c1-49ad-8d78-244df29c7447%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: heroku django

2014-09-11 Thread Kevin Ndung'u
There is really no difference when you add it to Github or Heroku, in my 
opinion. Achieves the same result in the end.

On Thursday, September 11, 2014 11:42:12 AM UTC+3, ngangsia akumbo wrote:
>
> or should i create my app locally add it on git hub and clone it on heroku
> if that is a better process please can some one guide me through?
>
> On Thursday, September 11, 2014 9:29:39 AM UTC+1, ngangsia akumbo wrote:
>>
>> i have a problem
>> can i create a complete django application on my machine before deplying 
>> it to heroku
>>
>> that is i start by creating the django app on my local linux machine 
>> before trying to deploy it online
>> i a confused here a bit pleas i need some help
>>
>

-- 
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/98f85c8a-19be-4796-8ee8-42b89e8206bc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: heroku django

2014-09-11 Thread Kevin Ndung'u
Yes, you can. You can develop locally then when the time comes to deploy it 
then add it to Github and subsequently to Heroku.

I personally prefer this since you get to focus on the app first and deploy 
later.

On Thursday, September 11, 2014 11:29:39 AM UTC+3, ngangsia akumbo wrote:
>
> i have a problem
> can i create a complete django application on my machine before deplying 
> it to heroku
>
> that is i start by creating the django app on my local linux machine 
> before trying to deploy it online
> i a confused here a bit pleas i need some help
>

-- 
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/7becb5b4-4da0-4ac3-9aba-8a893075a846%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: heroku django

2014-09-11 Thread ngangsia akumbo
or should i create my app locally add it on git hub and clone it on heroku
if that is a better process please can some one guide me through?

On Thursday, September 11, 2014 9:29:39 AM UTC+1, ngangsia akumbo wrote:
>
> i have a problem
> can i create a complete django application on my machine before deplying 
> it to heroku
>
> that is i start by creating the django app on my local linux machine 
> before trying to deploy it online
> i a confused here a bit pleas i need some help
>

-- 
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/60ccde59-d60f-4996-9fc8-ba4bf3a7ddb8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


heroku django

2014-09-11 Thread ngangsia akumbo
i have a problem
can i create a complete django application on my machine before deplying it 
to heroku

that is i start by creating the django app on my local linux machine before 
trying to deploy it online
i a confused here a bit pleas i need some help

-- 
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/3bb112fb-3540-4eb2-af5a-4af264f801b1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.