Re: How can I print form errors from inside the test

2012-03-13 Thread Daniel Roseman
On Tuesday, 13 March 2012 19:06:13 UTC-7, somecallitblues wrote:
>
> I preload the data into the form and when I validate it returns False.
>
>
*How* do you "preload" the data? How do you validate it?
--
DR. 

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



Post url incorrect on syndication

2012-03-13 Thread cubells

Hi all:

In order to show my feeds blog I have a class:

class BlogFeed(Feed):
title = "MySite"
description = "Some ramblings of mine"
link = "/blog/feed/"

def items(self):
return Post.objects.all().order_by("-created")[:2]
def item_title(self, item):
return item.title
def item_description(self, item):
return item.body
def item_link(self, item):
return u"/blog/%d" % item.id

And the url for the feed is:

url(r'^feed/$', BlogFeed()),

All works fine but the post url.

The post url that is shown in feeds is
http://example.com/blog/4

when It should be
http://vcubells.net/blog/4

What's the problem? I don't see what I'm doing wrong.

Thanks a lot!


--

cubells

web: vcubells.net
microblogging: identi.ca/cubells
xmpp: cube...@jabber.org

--

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



Re: templates couple apps to a site; how do you separate them?

2012-03-13 Thread Nick
When writing an app one of the things you do is set limitations. It's
the same for people who choose to use pluggable apps, you're trading
customization for convenience.

The way I would go about it is to write multiple outputs that are
handled primarily in the view. You could set up a keyword parameter
that checks the template type, if it's html, serve up the information
with HTML, if the type is JSON, then send JSON to the template or
other view. You could also allow for different wrappers for your
content. Many Wordpress plugins (interchangeable with the term apps)
allow you to set the before and after html for the entire list of
objects and even set HTML elements for the individual objects in the
list. You then deliver the HTML as a variable to the template and the
template just outputs the HTML.

I wouldn't rely on a separate template file to create my output. If
you do go that route then try adding a keyword that would allow a
template override so someone could customize the presentation from the
ground up if they wanted.




On Mar 13, 7:31 pm, Ken  wrote:
> I'm struggling with how I should go about writing "pluggable" apps.  I
> haven't found a satisfactory way of decoupling apps from a site and
> the primary sticking point is templates.  I've combed through some
> discussions but have not found any that have helped.
>
> A site's templates determine the look and feel.  If an app is to play
> nice, then it needs to know a site's templates.  If an app uses its
> own templates, then it can override the site's look and feel.
>
> One approach is for an app to provide only functionality.  A site that
> uses an app then has the responsibility of developing views for an app
> it chooses to use.  This seems to me the best way forward.
>
> How do you go about solving this problem?
>
> Thanks.

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



Re: urllib2

2012-03-13 Thread hack
Yes, I added @csrf_exempt and not I get a 500 error instead.  I'm not sure 
what the deal is.

On Tuesday, March 13, 2012 10:09:37 PM UTC-4, Matt Schinckel wrote:
>
> That response indicates you do not have permission to access that resource 
> on that server. Are you sure you are hitting the correct URL?
>
> You may want to look into requests, it is a nicer interface for 
> interacting with http servers.
>
> Matt.
>

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



Re: urllib2

2012-03-13 Thread hack
Hmmm, perhaps this might help: @csrf_exempt

On Tuesday, March 13, 2012 9:54:30 PM UTC-4, hack wrote:
>
> This stuff is killing me.  LOL  I think I just don't understand the 
> urllib2 yet. 
>
> I'm trying something very simple, but am having a terrible time 
> figuring out how to get it to work in python and django.  All I want 
> to do is post to my site with params.  Here is what I have: 
>
> def test(request): 
> test = " NOTHING " 
> if request.method=='POST': 
> test = request.POST.get('test',None) 
> print 'data posted' 
> print 'test param: ',test 
>
> return HttpResponse("Text only, please."+str(test), 
> content_type="text/plain") 
>
> Here is how I'm trying to call it via IDLE: 
>
> >>> parms = urllib.urlencode([('test','testing'),('test2','testing2')]) 
> >>> print parms 
> test=testing=testing2 
>
> >>> response = urllib2.urlopen('http://my.ip.address:8080/myapp/test/',parms) 
>
>
> Heres the error: 
> Traceback (most recent call last): 
>   File "", line 1, in  
>   File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/ 
> python2.6/urllib2.py", line 124, in urlopen 
> return _opener.open(url, data, timeout) 
>   File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/ 
> python2.6/urllib2.py", line 389, in open 
> response = meth(req, response) 
>   File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/ 
> python2.6/urllib2.py", line 502, in http_response 
> 'http', request, response, code, msg, hdrs) 
>   File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/ 
> python2.6/urllib2.py", line 427, in error 
> return self._call_chain(*args) 
>   File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/ 
> python2.6/urllib2.py", line 361, in _call_chain 
> result = func(*args) 
>   File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/ 
> python2.6/urllib2.py", line 510, in http_error_default 
> raise HTTPError(req.get_full_url(), code, msg, hdrs, fp) 
> HTTPError: HTTP Error 403: FORBIDDEN 
>
> Any advice is greatly appreciated.  Thanks. 
>

On Tuesday, March 13, 2012 9:54:30 PM UTC-4, hack wrote:
>
> This stuff is killing me.  LOL  I think I just don't understand the 
> urllib2 yet. 
>
> I'm trying something very simple, but am having a terrible time 
> figuring out how to get it to work in python and django.  All I want 
> to do is post to my site with params.  Here is what I have: 
>
> def test(request): 
> test = " NOTHING " 
> if request.method=='POST': 
> test = request.POST.get('test',None) 
> print 'data posted' 
> print 'test param: ',test 
>
> return HttpResponse("Text only, please."+str(test), 
> content_type="text/plain") 
>
> Here is how I'm trying to call it via IDLE: 
>
> >>> parms = urllib.urlencode([('test','testing'),('test2','testing2')]) 
> >>> print parms 
> test=testing=testing2 
>
> >>> response = urllib2.urlopen('http://my.ip.address:8080/myapp/test/',parms) 
>
>
> Heres the error: 
> Traceback (most recent call last): 
>   File "", line 1, in  
>   File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/ 
> python2.6/urllib2.py", line 124, in urlopen 
> return _opener.open(url, data, timeout) 
>   File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/ 
> python2.6/urllib2.py", line 389, in open 
> response = meth(req, response) 
>   File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/ 
> python2.6/urllib2.py", line 502, in http_response 
> 'http', request, response, code, msg, hdrs) 
>   File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/ 
> python2.6/urllib2.py", line 427, in error 
> return self._call_chain(*args) 
>   File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/ 
> python2.6/urllib2.py", line 361, in _call_chain 
> result = func(*args) 
>   File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/ 
> python2.6/urllib2.py", line 510, in http_error_default 
> raise HTTPError(req.get_full_url(), code, msg, hdrs, fp) 
> HTTPError: HTTP Error 403: FORBIDDEN 
>
> Any advice is greatly appreciated.  Thanks. 
>

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



Re: urllib2

2012-03-13 Thread Matt Schinckel
That response indicates you do not have permission to access that resource 
on that server. Are you sure you are hitting the correct URL?

You may want to look into requests, it is a nicer interface for interacting 
with http servers.

Matt.

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



How can I print form errors from inside the test

2012-03-13 Thread Mario Gudelj
Hi djangoers,

I have a problem where I'm running some form tests, the form validation is
failing, and I'm not sure why it's failing and I can't figure out how to
print the errors.

I preload the data into the form and when I validate it returns False.

>>> form.is_valid()
False

If I print the form and look at the HTML code everything looks fine as it
would on the front end

>>> print form

But if I try

>>> print form.errors

I get nothing.

I also tried all individual files with

>>> print form['is_recur'].errors

and I still get nothing.

There are no custom validation functions in this form, so I really don't
knoyw why it wouldn't validate.

Any help will be greatly appreciated.

Thanks!

-m

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



urllib2

2012-03-13 Thread hack
This stuff is killing me.  LOL  I think I just don't understand the
urllib2 yet.

I'm trying something very simple, but am having a terrible time
figuring out how to get it to work in python and django.  All I want
to do is post to my site with params.  Here is what I have:

def test(request):
test = " NOTHING "
if request.method=='POST':
test = request.POST.get('test',None)
print 'data posted'
print 'test param: ',test

return HttpResponse("Text only, please."+str(test),
content_type="text/plain")

Here is how I'm trying to call it via IDLE:

>>> parms = urllib.urlencode([('test','testing'),('test2','testing2')])
>>> print parms
test=testing=testing2

>>> response = urllib2.urlopen('http://my.ip.address:8080/myapp/test/',parms)

Heres the error:
Traceback (most recent call last):
  File "", line 1, in 
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/
python2.6/urllib2.py", line 124, in urlopen
return _opener.open(url, data, timeout)
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/
python2.6/urllib2.py", line 389, in open
response = meth(req, response)
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/
python2.6/urllib2.py", line 502, in http_response
'http', request, response, code, msg, hdrs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/
python2.6/urllib2.py", line 427, in error
return self._call_chain(*args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/
python2.6/urllib2.py", line 361, in _call_chain
result = func(*args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/
python2.6/urllib2.py", line 510, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 403: FORBIDDEN

Any advice is greatly appreciated.  Thanks.

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



templates couple apps to a site; how do you separate them?

2012-03-13 Thread Ken
I'm struggling with how I should go about writing "pluggable" apps.  I
haven't found a satisfactory way of decoupling apps from a site and
the primary sticking point is templates.  I've combed through some
discussions but have not found any that have helped.

A site's templates determine the look and feel.  If an app is to play
nice, then it needs to know a site's templates.  If an app uses its
own templates, then it can override the site's look and feel.

One approach is for an app to provide only functionality.  A site that
uses an app then has the responsibility of developing views for an app
it chooses to use.  This seems to me the best way forward.

How do you go about solving this problem?

Thanks.



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



help with form validation

2012-03-13 Thread Sergiy Khohlov
Hello,
 I would like to ask question about form error handling.
Main target is decreasing count of the code in the template. Of course
it is possible  to display all form in template such as :
{{ form.as_table }} In this case possible to  set some widget in form
and make a template code is simple. But what about field error
handling ?
is it possible to prepare error handling in form ?  and add  to
template simple code such as:

 {% if  form.error %}  {% form.error %} {%endif%}

 at the current moment I'm checking error one by one  using : {%  if
form.field.error %}

Form does validating and possible some simple way to work with error
handling  present , is not it ?

Can anybody know  this ?

 Thanks, Serge

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



Re: Getting URL from within a template

2012-03-13 Thread Furbee
Oh, you are filtering in the template, using Django, sorry. I thought you
meant you pass it to the template and use jQuery to filter. My bad. :-)

Cheers

On Tue, Mar 13, 2012 at 3:25 PM, Furbee  wrote:

> Aha! Very nice. As a sidebar, you said you pass the filter string back to
> the template so it can apply filtering on the new data set. This makes me
> think that filtering is being done on the entire data set from the browser,
> instead of the server. Maybe I misunderstood, but if so, I would suggest
> filtering the data on Django's end and simply returning the filtered
> QuerySet. This may make the page load faster and would be scalable for
> larger lists where lots of records are being filtered by the client browser.
>
>
> On Tue, Mar 13, 2012 at 3:01 PM, Larry Martell wrote:
>
>> On Tue, Mar 13, 2012 at 3:53 PM, Furbee  wrote:
>> > Gotcha, I was unclear. You can have jQuery modify the URL without
>> actually
>> > requesting the page from the webserver, I thought that was what you
>> meant.
>> > This comes in handy when you want to use javascript to update the URL
>> > without requesting a new page from the server in case the user hits F5
>> or
>> > refreshes the page, it will request the updated URL instead of the
>> original.
>> >
>> > So, you can do this as you mentioned, or you can parse the request.GET
>> > dictionary and return them as variables to the template from the view.
>>
>> There's a 'live filtering' function on the page. It's text field with
>> a keyup event handler. Each time the field gets updated the data
>> currently on the screen is filtered, and the URL is updated to include
>> the current filter string so that when the user pages forward or
>> backwards through the data (which is a return back to the server), the
>> filter string can get passed back into the template so it can apply
>> the filtering on the new data set
>>
>>
>> > On Tue, Mar 13, 2012 at 2:42 PM, Larry Martell > >
>> > wrote:
>> >>
>> >> On Tue, Mar 13, 2012 at 3:33 PM, Furbee  wrote:
>> >> > Good deal, but if you send the page to the client, then jQuery
>> updates
>> >> > the
>> >> > URL, the {{ request.get_full_path }} is still only able to have the
>> >> > original
>> >> > URL that was requested. Once the page is sent to the client,
>> >> > Django/Python
>> >> > is done and cannot manipulate the page, unless you are using AJAX to
>> get
>> >> > updated details.
>> >>
>> >> When the URL that gets updated by jQuery is clicked on, it goes back
>> >> to Django/Python and the {{ request.get_full_path }} gets updated.
>> >>
>> >>
>> >> > On Tue, Mar 13, 2012 at 2:23 PM, Larry Martell <
>> larry.mart...@gmail.com>
>> >> > wrote:
>> >> >>
>> >> >> On Tue, Mar 13, 2012 at 2:19 PM, Furbee 
>> wrote:
>> >> >> > Hi Larry,
>> >> >> >
>> >> >> > render_to_response is one of many ways to return an HttpResponse
>> to
>> >> >> > send
>> >> >> > to
>> >> >> > the client. Wherever your view does the return, you can pass these
>> >> >> > GET
>> >> >> > variables.
>> >> >> >
>> >> >> > However, if they are being generated by jQuery, dynamically, you
>> >> >> > should
>> >> >> > be
>> >> >> > using jQuery/javascript to read them and deal with them. This
>> should
>> >> >> > be
>> >> >> > client side javascript code. To read the current URL string in
>> >> >> > jQuery, I
>> >> >> > found a nice little article
>> >> >> >
>> >> >> >
>> >> >> > at
>> http://jquery-howto.blogspot.com/2009/09/get-url-parameters-values-with-jquery.html
>>  which
>> >> >> > should demonstrate how to get these in javascript on the
>> client-side
>> >> >> > browser.
>> >> >>
>> >> >> I was able to get the entire URL with {{ request.get_full_path }}
>> >> >>
>> >> >> But thanks for the link - looks like it could be very useful in the
>> >> >> future.
>> >> >>
>> >> >>
>> >> >> > On Tue, Mar 13, 2012 at 11:57 AM, Larry Martell
>> >> >> > 
>> >> >> > wrote:
>> >> >> >>
>> >> >> >> On Tue, Mar 13, 2012 at 12:38 PM, Furbee 
>> >> >> >> wrote:
>> >> >> >> > I think you want to actually get these in the view code and
>> pass
>> >> >> >> > them
>> >> >> >> > to
>> >> >> >> > the
>> >> >> >> > template as named variables. For example:
>> >> >> >> >
>> >> >> >> > return render_to_response('page.htm',
>> >> >> >> > {'date_time': request.GET['date_time'], 'submit_preview':
>> >> >> >> > request.GET['submit_preview'], 'event_type':
>> >> >> >> > request.GET['event_type'],
>> >> >> >> > 'filterValue':
>> >> >> >> >
>> >> >> >> >
>> >> >> >> >
>> request.GET['_filterValue']}, context_instance=RequestContext(request))
>> >> >> >> >
>> >> >> >> > From the template, now, the different variables are available.
>> {{
>> >> >> >> > date_time
>> >> >> >> > }}, {{ submit_preview }}, {{ event_type }}, {{ filterValue }}.
>> >> >> >> > That's
>> >> >> >> > how I
>> >> >> >> > would handle it 

Re: Getting URL from within a template

2012-03-13 Thread Furbee
Aha! Very nice. As a sidebar, you said you pass the filter string back to
the template so it can apply filtering on the new data set. This makes me
think that filtering is being done on the entire data set from the browser,
instead of the server. Maybe I misunderstood, but if so, I would suggest
filtering the data on Django's end and simply returning the filtered
QuerySet. This may make the page load faster and would be scalable for
larger lists where lots of records are being filtered by the client browser.

On Tue, Mar 13, 2012 at 3:01 PM, Larry Martell wrote:

> On Tue, Mar 13, 2012 at 3:53 PM, Furbee  wrote:
> > Gotcha, I was unclear. You can have jQuery modify the URL without
> actually
> > requesting the page from the webserver, I thought that was what you
> meant.
> > This comes in handy when you want to use javascript to update the URL
> > without requesting a new page from the server in case the user hits F5 or
> > refreshes the page, it will request the updated URL instead of the
> original.
> >
> > So, you can do this as you mentioned, or you can parse the request.GET
> > dictionary and return them as variables to the template from the view.
>
> There's a 'live filtering' function on the page. It's text field with
> a keyup event handler. Each time the field gets updated the data
> currently on the screen is filtered, and the URL is updated to include
> the current filter string so that when the user pages forward or
> backwards through the data (which is a return back to the server), the
> filter string can get passed back into the template so it can apply
> the filtering on the new data set
>
>
> > On Tue, Mar 13, 2012 at 2:42 PM, Larry Martell 
> > wrote:
> >>
> >> On Tue, Mar 13, 2012 at 3:33 PM, Furbee  wrote:
> >> > Good deal, but if you send the page to the client, then jQuery updates
> >> > the
> >> > URL, the {{ request.get_full_path }} is still only able to have the
> >> > original
> >> > URL that was requested. Once the page is sent to the client,
> >> > Django/Python
> >> > is done and cannot manipulate the page, unless you are using AJAX to
> get
> >> > updated details.
> >>
> >> When the URL that gets updated by jQuery is clicked on, it goes back
> >> to Django/Python and the {{ request.get_full_path }} gets updated.
> >>
> >>
> >> > On Tue, Mar 13, 2012 at 2:23 PM, Larry Martell <
> larry.mart...@gmail.com>
> >> > wrote:
> >> >>
> >> >> On Tue, Mar 13, 2012 at 2:19 PM, Furbee 
> wrote:
> >> >> > Hi Larry,
> >> >> >
> >> >> > render_to_response is one of many ways to return an HttpResponse to
> >> >> > send
> >> >> > to
> >> >> > the client. Wherever your view does the return, you can pass these
> >> >> > GET
> >> >> > variables.
> >> >> >
> >> >> > However, if they are being generated by jQuery, dynamically, you
> >> >> > should
> >> >> > be
> >> >> > using jQuery/javascript to read them and deal with them. This
> should
> >> >> > be
> >> >> > client side javascript code. To read the current URL string in
> >> >> > jQuery, I
> >> >> > found a nice little article
> >> >> >
> >> >> >
> >> >> > at
> http://jquery-howto.blogspot.com/2009/09/get-url-parameters-values-with-jquery.html
>  which
> >> >> > should demonstrate how to get these in javascript on the
> client-side
> >> >> > browser.
> >> >>
> >> >> I was able to get the entire URL with {{ request.get_full_path }}
> >> >>
> >> >> But thanks for the link - looks like it could be very useful in the
> >> >> future.
> >> >>
> >> >>
> >> >> > On Tue, Mar 13, 2012 at 11:57 AM, Larry Martell
> >> >> > 
> >> >> > wrote:
> >> >> >>
> >> >> >> On Tue, Mar 13, 2012 at 12:38 PM, Furbee 
> >> >> >> wrote:
> >> >> >> > I think you want to actually get these in the view code and pass
> >> >> >> > them
> >> >> >> > to
> >> >> >> > the
> >> >> >> > template as named variables. For example:
> >> >> >> >
> >> >> >> > return render_to_response('page.htm',
> >> >> >> > {'date_time': request.GET['date_time'], 'submit_preview':
> >> >> >> > request.GET['submit_preview'], 'event_type':
> >> >> >> > request.GET['event_type'],
> >> >> >> > 'filterValue':
> >> >> >> >
> >> >> >> >
> >> >> >> >
> request.GET['_filterValue']}, context_instance=RequestContext(request))
> >> >> >> >
> >> >> >> > From the template, now, the different variables are available.
> {{
> >> >> >> > date_time
> >> >> >> > }}, {{ submit_preview }}, {{ event_type }}, {{ filterValue }}.
> >> >> >> > That's
> >> >> >> > how I
> >> >> >> > would handle it at least.
> >> >> >>
> >> >> >> The URL gets created dynamically by jQuery code in a template. Not
> >> >> >> all
> >> >> >> these fields are always present. Also, render_to_response is not
> >> >> >> used.
> >> >> >> (I'm
> >> >> >> fairly new to both django and this job, and I just grepped through
> >> >> >> the
> >> >> >> entire code base and it wasn't found.)
> >> 

Re: sending django email via gmail

2012-03-13 Thread infinitylX
I have same problem.

Telnet works, if i turn off tls and set 25 as port and every thing
works fine. But i want secure connection with tls...
By the way i have same situation with other smtp server (yandex for
example.)

Here is my settings:
EMAIL_USE_TLS = True
EMAIL_HOST = "smtp.googlemail.com"
EMAIL_PORT = 465
EMAIL_HOST_USER = "infinit...@gmail.com"
EMAIL_HOST_PASSWORD = "password"


On Mar 6, 11:52 pm, CLIFFORD ILKAY  wrote:
> On 03/06/2012 04:05 PM, Scott Macri wrote:
>
> > I can run thunderbird on the same machine and don't have any issues.
> > No, I am not running tbird at the same time as the django app.  Thus,
> > I know it's not a port conflict.
>
> It wouldn't make any difference if you were running your Django app and
> T'bird at the same time. The port that the Django dev server uses has
> nothing to do with the port the Gmail SMTP server uses. Even if your
> Django app were to send email at precisely the same time as T'bird, it
> wouldn't make any difference. SMTP servers are designed to handle
> multiple simultaneous connections.
> --
> Regards,
>
> Clifford Ilkay
> Dinamis
> 1419-3266 Yonge St.
> Toronto, ON
> Canada  M4N 3P6
>
> 
> +1 416-410-3326

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



Re: Getting URL from within a template

2012-03-13 Thread Larry Martell
On Tue, Mar 13, 2012 at 3:53 PM, Furbee  wrote:
> Gotcha, I was unclear. You can have jQuery modify the URL without actually
> requesting the page from the webserver, I thought that was what you meant.
> This comes in handy when you want to use javascript to update the URL
> without requesting a new page from the server in case the user hits F5 or
> refreshes the page, it will request the updated URL instead of the original.
>
> So, you can do this as you mentioned, or you can parse the request.GET
> dictionary and return them as variables to the template from the view.

There's a 'live filtering' function on the page. It's text field with
a keyup event handler. Each time the field gets updated the data
currently on the screen is filtered, and the URL is updated to include
the current filter string so that when the user pages forward or
backwards through the data (which is a return back to the server), the
filter string can get passed back into the template so it can apply
the filtering on the new data set


> On Tue, Mar 13, 2012 at 2:42 PM, Larry Martell 
> wrote:
>>
>> On Tue, Mar 13, 2012 at 3:33 PM, Furbee  wrote:
>> > Good deal, but if you send the page to the client, then jQuery updates
>> > the
>> > URL, the {{ request.get_full_path }} is still only able to have the
>> > original
>> > URL that was requested. Once the page is sent to the client,
>> > Django/Python
>> > is done and cannot manipulate the page, unless you are using AJAX to get
>> > updated details.
>>
>> When the URL that gets updated by jQuery is clicked on, it goes back
>> to Django/Python and the {{ request.get_full_path }} gets updated.
>>
>>
>> > On Tue, Mar 13, 2012 at 2:23 PM, Larry Martell 
>> > wrote:
>> >>
>> >> On Tue, Mar 13, 2012 at 2:19 PM, Furbee  wrote:
>> >> > Hi Larry,
>> >> >
>> >> > render_to_response is one of many ways to return an HttpResponse to
>> >> > send
>> >> > to
>> >> > the client. Wherever your view does the return, you can pass these
>> >> > GET
>> >> > variables.
>> >> >
>> >> > However, if they are being generated by jQuery, dynamically, you
>> >> > should
>> >> > be
>> >> > using jQuery/javascript to read them and deal with them. This should
>> >> > be
>> >> > client side javascript code. To read the current URL string in
>> >> > jQuery, I
>> >> > found a nice little article
>> >> >
>> >> >
>> >> > at http://jquery-howto.blogspot.com/2009/09/get-url-parameters-values-with-jquery.html which
>> >> > should demonstrate how to get these in javascript on the client-side
>> >> > browser.
>> >>
>> >> I was able to get the entire URL with {{ request.get_full_path }}
>> >>
>> >> But thanks for the link - looks like it could be very useful in the
>> >> future.
>> >>
>> >>
>> >> > On Tue, Mar 13, 2012 at 11:57 AM, Larry Martell
>> >> > 
>> >> > wrote:
>> >> >>
>> >> >> On Tue, Mar 13, 2012 at 12:38 PM, Furbee 
>> >> >> wrote:
>> >> >> > I think you want to actually get these in the view code and pass
>> >> >> > them
>> >> >> > to
>> >> >> > the
>> >> >> > template as named variables. For example:
>> >> >> >
>> >> >> >     return render_to_response('page.htm',
>> >> >> > {'date_time': request.GET['date_time'], 'submit_preview':
>> >> >> > request.GET['submit_preview'], 'event_type':
>> >> >> > request.GET['event_type'],
>> >> >> > 'filterValue':
>> >> >> >
>> >> >> >
>> >> >> > request.GET['_filterValue']}, context_instance=RequestContext(request))
>> >> >> >
>> >> >> > From the template, now, the different variables are available. {{
>> >> >> > date_time
>> >> >> > }}, {{ submit_preview }}, {{ event_type }}, {{ filterValue }}.
>> >> >> > That's
>> >> >> > how I
>> >> >> > would handle it at least.
>> >> >>
>> >> >> The URL gets created dynamically by jQuery code in a template. Not
>> >> >> all
>> >> >> these fields are always present. Also, render_to_response is not
>> >> >> used.
>> >> >> (I'm
>> >> >> fairly new to both django and this job, and I just grepped through
>> >> >> the
>> >> >> entire code base and it wasn't found.)
>> >> >>
>> >> >>
>> >> >> >
>> >> >> > Furbee
>> >> >> >
>> >> >> > On Tue, Mar 13, 2012 at 11:27 AM, Larry Martell
>> >> >> > 
>> >> >> > wrote:
>> >> >> >>
>> >> >> >> On Tue, Mar 13, 2012 at 11:58 AM, Xavier Ordoquy
>> >> >> >> 
>> >> >> >> wrote:
>> >> >> >> >
>> >> >> >> > Le 13 mars 2012 à 18:40, Larry Martell a écrit :
>> >> >> >> >
>> >> >> >> >> On Tue, Mar 13, 2012 at 11:26 AM, Xavier Ordoquy
>> >> >> >> >> 
>> >> >> >> >> wrote:
>> >> >> >> >>> Hi
>> >> >> >> >>>
>> >> >> >> >>> Le 13 mars 2012 à 18:11, larry.mart...@gmail.com a écrit :
>> >> >> >> >>>
>> >> >> >>  From within a template can I find out the URL that caused
>> >> >> >>  the
>> >> >> >>  template
>> >> >> >>  to be invoked?
>> >> >> >> >>>
>> >> >> >> >>> You 

Re: Getting URL from within a template

2012-03-13 Thread Furbee
Gotcha, I was unclear. You can have jQuery modify the URL without actually
requesting the page from the webserver, I thought that was what you meant.
This comes in handy when you want to use javascript to update the URL
without requesting a new page from the server in case the user hits F5 or
refreshes the page, it will request the updated URL instead of the original.

So, you can do this as you mentioned, or you can parse the request.GET
dictionary and return them as variables to the template from the view.

Cheers

On Tue, Mar 13, 2012 at 2:42 PM, Larry Martell wrote:

> On Tue, Mar 13, 2012 at 3:33 PM, Furbee  wrote:
> > Good deal, but if you send the page to the client, then jQuery updates
> the
> > URL, the {{ request.get_full_path }} is still only able to have the
> original
> > URL that was requested. Once the page is sent to the client,
> Django/Python
> > is done and cannot manipulate the page, unless you are using AJAX to get
> > updated details.
>
> When the URL that gets updated by jQuery is clicked on, it goes back
> to Django/Python and the {{ request.get_full_path }} gets updated.
>
>
> > On Tue, Mar 13, 2012 at 2:23 PM, Larry Martell 
> > wrote:
> >>
> >> On Tue, Mar 13, 2012 at 2:19 PM, Furbee  wrote:
> >> > Hi Larry,
> >> >
> >> > render_to_response is one of many ways to return an HttpResponse to
> send
> >> > to
> >> > the client. Wherever your view does the return, you can pass these GET
> >> > variables.
> >> >
> >> > However, if they are being generated by jQuery, dynamically, you
> should
> >> > be
> >> > using jQuery/javascript to read them and deal with them. This should
> be
> >> > client side javascript code. To read the current URL string in
> jQuery, I
> >> > found a nice little article
> >> >
> >> > at
> http://jquery-howto.blogspot.com/2009/09/get-url-parameters-values-with-jquery.html
>  which
> >> > should demonstrate how to get these in javascript on the client-side
> >> > browser.
> >>
> >> I was able to get the entire URL with {{ request.get_full_path }}
> >>
> >> But thanks for the link - looks like it could be very useful in the
> >> future.
> >>
> >>
> >> > On Tue, Mar 13, 2012 at 11:57 AM, Larry Martell
> >> > 
> >> > wrote:
> >> >>
> >> >> On Tue, Mar 13, 2012 at 12:38 PM, Furbee 
> wrote:
> >> >> > I think you want to actually get these in the view code and pass
> them
> >> >> > to
> >> >> > the
> >> >> > template as named variables. For example:
> >> >> >
> >> >> > return render_to_response('page.htm',
> >> >> > {'date_time': request.GET['date_time'], 'submit_preview':
> >> >> > request.GET['submit_preview'], 'event_type':
> >> >> > request.GET['event_type'],
> >> >> > 'filterValue':
> >> >> >
> >> >> >
> request.GET['_filterValue']}, context_instance=RequestContext(request))
> >> >> >
> >> >> > From the template, now, the different variables are available. {{
> >> >> > date_time
> >> >> > }}, {{ submit_preview }}, {{ event_type }}, {{ filterValue }}.
> That's
> >> >> > how I
> >> >> > would handle it at least.
> >> >>
> >> >> The URL gets created dynamically by jQuery code in a template. Not
> all
> >> >> these fields are always present. Also, render_to_response is not
> used.
> >> >> (I'm
> >> >> fairly new to both django and this job, and I just grepped through
> the
> >> >> entire code base and it wasn't found.)
> >> >>
> >> >>
> >> >> >
> >> >> > Furbee
> >> >> >
> >> >> > On Tue, Mar 13, 2012 at 11:27 AM, Larry Martell
> >> >> > 
> >> >> > wrote:
> >> >> >>
> >> >> >> On Tue, Mar 13, 2012 at 11:58 AM, Xavier Ordoquy
> >> >> >> 
> >> >> >> wrote:
> >> >> >> >
> >> >> >> > Le 13 mars 2012 à 18:40, Larry Martell a écrit :
> >> >> >> >
> >> >> >> >> On Tue, Mar 13, 2012 at 11:26 AM, Xavier Ordoquy
> >> >> >> >> 
> >> >> >> >> wrote:
> >> >> >> >>> Hi
> >> >> >> >>>
> >> >> >> >>> Le 13 mars 2012 à 18:11, larry.mart...@gmail.com a écrit :
> >> >> >> >>>
> >> >> >>  From within a template can I find out the URL that caused the
> >> >> >>  template
> >> >> >>  to be invoked?
> >> >> >> >>>
> >> >> >> >>> You usually should have the request object in your template.
> See
> >> >> >> >>>
> >> >> >> >>>
> >> >> >> >>>
> https://docs.djangoproject.com/en/dev/ref/request-response/#django.http.HttpRequest.path
> >> >> >> >>> to get the url.
> >> >> >> >>>
> >> >> >> >>
> >> >> >> >> But how do I access that in the template? I tried
> >> >> >> >> HttpRequest.path
> >> >> >> >> and
> >> >> >> >> {{ HttpRequest.path }} and neither gives me the URL.
> >> >> >> >
> >> >> >> > {{ request.path }}
> >> >> >> > just make sure you have RequestContext if you use
> >> >> >> > render_to_response.
> >> >> >>
> >> >> >> This is displaying a path, but not the URL I need. It gives
> >> >> >> /report//EventsTable/ when the URL that's clicked on is:
> >> >> >>
> 

Re: Django making box

2012-03-13 Thread Larry Martell
On Tue, Mar 13, 2012 at 3:34 PM, Sophia  wrote:
> Thanks for the help, actually it should be run just on my computer not the
> client.

In this context the client is the browser.

>
> On Tuesday, March 13, 2012 1:54:00 PM UTC-7, Javier Guerra wrote:
>>
>> On Tue, Mar 13, 2012 at 3:37 PM, Sophia  wrote:
>> > Thanks all for helping, as I told I read that tutorial, but my
>> > supervisor
>> > said that I should do that with Django. He didn't mention about learning
>> > JavaScript, but is it impossible just with Django?
>>
>> django runs on the server.  if you want to do some client processing
>> you need code running on the client, typically Javascript.
>>
>> of course that code is served from a Django app, and modifying a
>> django-handled page and form, so the project in a whole is still 'done
>> with Django'.
>>
>> --
>> Javier
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/IRJ8PvQXRdEJ.
>
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.

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



Re: Getting URL from within a template

2012-03-13 Thread Larry Martell
On Tue, Mar 13, 2012 at 3:33 PM, Furbee  wrote:
> Good deal, but if you send the page to the client, then jQuery updates the
> URL, the {{ request.get_full_path }} is still only able to have the original
> URL that was requested. Once the page is sent to the client, Django/Python
> is done and cannot manipulate the page, unless you are using AJAX to get
> updated details.

When the URL that gets updated by jQuery is clicked on, it goes back
to Django/Python and the {{ request.get_full_path }} gets updated.


> On Tue, Mar 13, 2012 at 2:23 PM, Larry Martell 
> wrote:
>>
>> On Tue, Mar 13, 2012 at 2:19 PM, Furbee  wrote:
>> > Hi Larry,
>> >
>> > render_to_response is one of many ways to return an HttpResponse to send
>> > to
>> > the client. Wherever your view does the return, you can pass these GET
>> > variables.
>> >
>> > However, if they are being generated by jQuery, dynamically, you should
>> > be
>> > using jQuery/javascript to read them and deal with them. This should be
>> > client side javascript code. To read the current URL string in jQuery, I
>> > found a nice little article
>> >
>> > at http://jquery-howto.blogspot.com/2009/09/get-url-parameters-values-with-jquery.html which
>> > should demonstrate how to get these in javascript on the client-side
>> > browser.
>>
>> I was able to get the entire URL with {{ request.get_full_path }}
>>
>> But thanks for the link - looks like it could be very useful in the
>> future.
>>
>>
>> > On Tue, Mar 13, 2012 at 11:57 AM, Larry Martell
>> > 
>> > wrote:
>> >>
>> >> On Tue, Mar 13, 2012 at 12:38 PM, Furbee  wrote:
>> >> > I think you want to actually get these in the view code and pass them
>> >> > to
>> >> > the
>> >> > template as named variables. For example:
>> >> >
>> >> >     return render_to_response('page.htm',
>> >> > {'date_time': request.GET['date_time'], 'submit_preview':
>> >> > request.GET['submit_preview'], 'event_type':
>> >> > request.GET['event_type'],
>> >> > 'filterValue':
>> >> >
>> >> > request.GET['_filterValue']}, context_instance=RequestContext(request))
>> >> >
>> >> > From the template, now, the different variables are available. {{
>> >> > date_time
>> >> > }}, {{ submit_preview }}, {{ event_type }}, {{ filterValue }}. That's
>> >> > how I
>> >> > would handle it at least.
>> >>
>> >> The URL gets created dynamically by jQuery code in a template. Not all
>> >> these fields are always present. Also, render_to_response is not used.
>> >> (I'm
>> >> fairly new to both django and this job, and I just grepped through the
>> >> entire code base and it wasn't found.)
>> >>
>> >>
>> >> >
>> >> > Furbee
>> >> >
>> >> > On Tue, Mar 13, 2012 at 11:27 AM, Larry Martell
>> >> > 
>> >> > wrote:
>> >> >>
>> >> >> On Tue, Mar 13, 2012 at 11:58 AM, Xavier Ordoquy
>> >> >> 
>> >> >> wrote:
>> >> >> >
>> >> >> > Le 13 mars 2012 à 18:40, Larry Martell a écrit :
>> >> >> >
>> >> >> >> On Tue, Mar 13, 2012 at 11:26 AM, Xavier Ordoquy
>> >> >> >> 
>> >> >> >> wrote:
>> >> >> >>> Hi
>> >> >> >>>
>> >> >> >>> Le 13 mars 2012 à 18:11, larry.mart...@gmail.com a écrit :
>> >> >> >>>
>> >> >>  From within a template can I find out the URL that caused the
>> >> >>  template
>> >> >>  to be invoked?
>> >> >> >>>
>> >> >> >>> You usually should have the request object in your template. See
>> >> >> >>>
>> >> >> >>>
>> >> >> >>> https://docs.djangoproject.com/en/dev/ref/request-response/#django.http.HttpRequest.path
>> >> >> >>> to get the url.
>> >> >> >>>
>> >> >> >>
>> >> >> >> But how do I access that in the template? I tried
>> >> >> >> HttpRequest.path
>> >> >> >> and
>> >> >> >> {{ HttpRequest.path }} and neither gives me the URL.
>> >> >> >
>> >> >> > {{ request.path }}
>> >> >> > just make sure you have RequestContext if you use
>> >> >> > render_to_response.
>> >> >>
>> >> >> This is displaying a path, but not the URL I need. It gives
>> >> >> /report//EventsTable/ when the URL that's clicked on is:
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >> http://127.0.0.1/report/EventsTable/?date_time=3y_preview=Generate+Report_type=RecipeCreated&_filterValue=dev
>> >> >>
>> >> >> I'm after all the arguments. Is there a way to get them?
>> >> >>
>> >> >> --
>> >> >> You received this message because you are subscribed to the Google
>> >> >> Groups
>> >> >> "Django users" group.
>> >> >> To post to this group, send email to django-users@googlegroups.com.
>> >> >> To unsubscribe from this group, send email to
>> >> >> django-users+unsubscr...@googlegroups.com.
>> >> >> For more options, visit this group at
>> >> >> http://groups.google.com/group/django-users?hl=en.
>> >> >>
>> >> >
>> >> > --
>> >> > You received this message because you are subscribed to the Google
>> >> > Groups
>> >> > "Django users" group.
>> >> > To post to this group, send email to 

Re: Django making box

2012-03-13 Thread Anurag Chourasia
What Javier meant in his previous message was a client application
.which of course could be a browser running on your own computer.

For a better understanding of client/server model you could review the
Wikipedia page

http://en.wikipedia.org/wiki/Client%E2%80%93server_model

Regards,
Guddu

On Tue, Mar 13, 2012 at 5:34 PM, Sophia  wrote:

> Thanks for the help, actually it should be run just on my computer not the
> client.
>
> On Tuesday, March 13, 2012 1:54:00 PM UTC-7, Javier Guerra wrote:
>>
>> On Tue, Mar 13, 2012 at 3:37 PM, Sophia  wrote:
>> > Thanks all for helping, as I told I read that tutorial, but my
>> supervisor
>> > said that I should do that with Django. He didn't mention about learning
>> > JavaScript, but is it impossible just with Django?
>>
>> django runs on the server.  if you want to do some client processing
>> you need code running on the client, typically Javascript.
>>
>> of course that code is served from a Django app, and modifying a
>> django-handled page and form, so the project in a whole is still 'done
>> with Django'.
>>
>> --
>> Javier
>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/IRJ8PvQXRdEJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: Django making box

2012-03-13 Thread Sophia
Thanks for the help, actually it should be run just on my computer not the 
client.

On Tuesday, March 13, 2012 1:54:00 PM UTC-7, Javier Guerra wrote:
>
> On Tue, Mar 13, 2012 at 3:37 PM, Sophia  wrote:
> > Thanks all for helping, as I told I read that tutorial, but my supervisor
> > said that I should do that with Django. He didn't mention about learning
> > JavaScript, but is it impossible just with Django?
>
> django runs on the server.  if you want to do some client processing
> you need code running on the client, typically Javascript.
>
> of course that code is served from a Django app, and modifying a
> django-handled page and form, so the project in a whole is still 'done
> with Django'.
>
> -- 
> Javier
>
>

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



Re: Getting URL from within a template

2012-03-13 Thread Furbee
Good deal, but if you send the page to the client, then jQuery updates the
URL, the {{ request.get_full_path }} is still only able to have the
original URL that was requested. Once the page is sent to the client,
Django/Python is done and cannot manipulate the page, unless you are using
AJAX to get updated details.

Cheers

On Tue, Mar 13, 2012 at 2:23 PM, Larry Martell wrote:

> On Tue, Mar 13, 2012 at 2:19 PM, Furbee  wrote:
> > Hi Larry,
> >
> > render_to_response is one of many ways to return an HttpResponse to send
> to
> > the client. Wherever your view does the return, you can pass these GET
> > variables.
> >
> > However, if they are being generated by jQuery, dynamically, you should
> be
> > using jQuery/javascript to read them and deal with them. This should be
> > client side javascript code. To read the current URL string in jQuery, I
> > found a nice little article
> > at
> http://jquery-howto.blogspot.com/2009/09/get-url-parameters-values-with-jquery.html
>  which
> > should demonstrate how to get these in javascript on the client-side
> > browser.
>
> I was able to get the entire URL with {{ request.get_full_path }}
>
> But thanks for the link - looks like it could be very useful in the future.
>
>
> > On Tue, Mar 13, 2012 at 11:57 AM, Larry Martell  >
> > wrote:
> >>
> >> On Tue, Mar 13, 2012 at 12:38 PM, Furbee  wrote:
> >> > I think you want to actually get these in the view code and pass them
> to
> >> > the
> >> > template as named variables. For example:
> >> >
> >> > return render_to_response('page.htm',
> >> > {'date_time': request.GET['date_time'], 'submit_preview':
> >> > request.GET['submit_preview'], 'event_type':
> request.GET['event_type'],
> >> > 'filterValue':
> >> >
> request.GET['_filterValue']}, context_instance=RequestContext(request))
> >> >
> >> > From the template, now, the different variables are available. {{
> >> > date_time
> >> > }}, {{ submit_preview }}, {{ event_type }}, {{ filterValue }}. That's
> >> > how I
> >> > would handle it at least.
> >>
> >> The URL gets created dynamically by jQuery code in a template. Not all
> >> these fields are always present. Also, render_to_response is not used.
> (I'm
> >> fairly new to both django and this job, and I just grepped through the
> >> entire code base and it wasn't found.)
> >>
> >>
> >> >
> >> > Furbee
> >> >
> >> > On Tue, Mar 13, 2012 at 11:27 AM, Larry Martell
> >> > 
> >> > wrote:
> >> >>
> >> >> On Tue, Mar 13, 2012 at 11:58 AM, Xavier Ordoquy <
> xordo...@linovia.com>
> >> >> wrote:
> >> >> >
> >> >> > Le 13 mars 2012 à 18:40, Larry Martell a écrit :
> >> >> >
> >> >> >> On Tue, Mar 13, 2012 at 11:26 AM, Xavier Ordoquy
> >> >> >> 
> >> >> >> wrote:
> >> >> >>> Hi
> >> >> >>>
> >> >> >>> Le 13 mars 2012 à 18:11, larry.mart...@gmail.com a écrit :
> >> >> >>>
> >> >>  From within a template can I find out the URL that caused the
> >> >>  template
> >> >>  to be invoked?
> >> >> >>>
> >> >> >>> You usually should have the request object in your template. See
> >> >> >>>
> >> >> >>>
> https://docs.djangoproject.com/en/dev/ref/request-response/#django.http.HttpRequest.path
> >> >> >>> to get the url.
> >> >> >>>
> >> >> >>
> >> >> >> But how do I access that in the template? I tried HttpRequest.path
> >> >> >> and
> >> >> >> {{ HttpRequest.path }} and neither gives me the URL.
> >> >> >
> >> >> > {{ request.path }}
> >> >> > just make sure you have RequestContext if you use
> render_to_response.
> >> >>
> >> >> This is displaying a path, but not the URL I need. It gives
> >> >> /report//EventsTable/ when the URL that's clicked on is:
> >> >>
> >> >>
> >> >>
> >> >>
> http://127.0.0.1/report/EventsTable/?date_time=3y_preview=Generate+Report_type=RecipeCreated&_filterValue=dev
> >> >>
> >> >> I'm after all the arguments. Is there a way to get them?
> >> >>
> >> >> --
> >> >> You received this message because you are subscribed to the Google
> >> >> Groups
> >> >> "Django users" group.
> >> >> To post to this group, send email to django-users@googlegroups.com.
> >> >> To unsubscribe from this group, send email to
> >> >> django-users+unsubscr...@googlegroups.com.
> >> >> For more options, visit this group at
> >> >> http://groups.google.com/group/django-users?hl=en.
> >> >>
> >> >
> >> > --
> >> > You received this message because you are subscribed to the Google
> >> > Groups
> >> > "Django users" group.
> >> > To post to this group, send email to django-users@googlegroups.com.
> >> > To unsubscribe from this group, send email to
> >> > django-users+unsubscr...@googlegroups.com.
> >> > For more options, visit this group at
> >> > http://groups.google.com/group/django-users?hl=en.
> >>
> >>
> >>
> >> --
> >> Sent from my iPhone
> >>
> >> --
> >> You received this message because you are subscribed to the Google
> Groups
> >> "Django users" group.
> >> To post 

Re: Django making box

2012-03-13 Thread Sophia
Thanks for answering, I meant supervisor for my internship. Actually it's a 
task that should be done for my internship.
This is exactly what he said: clicking on one box to generate new boxes and 
then we should enter data into them.
He just ask us to learn Python, and Django besides HTML and CSS to complete 
the work!

On Tuesday, March 13, 2012 2:13:25 PM UTC-7, creecode wrote:
>
> Hello Sophia,
>
> On Tuesday, March 13, 2012 1:37:57 PM UTC-7, Sophia wrote:
>>
>> Thanks all for helping, as I told I read that tutorial, but my supervisor 
>> said that I should do that with Django. He didn't mention about learning  
>> JavaScript, but is it impossible just with Django?
>
>
> I don't think it would be impossible to do it all in Django.  If you do it 
> solely with Django you would need your box to act like a submit button on a 
> form so that you can have the Django server do something in response to a 
> form submission.
>
> But without a clearer definition of how you want your app to behave it 
> will be hard for us to give you more insight into how you might proceed.
>
> When you say supervisor said is shoul be done in Django is that a 
> supervisor as in teacher?  Or supervisor as your superior at work?
>
> Toodle-lo..
> creecode
>
>
>

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



Re: Getting URL from within a template

2012-03-13 Thread Larry Martell
On Tue, Mar 13, 2012 at 2:19 PM, Furbee  wrote:
> Hi Larry,
>
> render_to_response is one of many ways to return an HttpResponse to send to
> the client. Wherever your view does the return, you can pass these GET
> variables.
>
> However, if they are being generated by jQuery, dynamically, you should be
> using jQuery/javascript to read them and deal with them. This should be
> client side javascript code. To read the current URL string in jQuery, I
> found a nice little article
> at http://jquery-howto.blogspot.com/2009/09/get-url-parameters-values-with-jquery.html which
> should demonstrate how to get these in javascript on the client-side
> browser.

I was able to get the entire URL with {{ request.get_full_path }}

But thanks for the link - looks like it could be very useful in the future.


> On Tue, Mar 13, 2012 at 11:57 AM, Larry Martell 
> wrote:
>>
>> On Tue, Mar 13, 2012 at 12:38 PM, Furbee  wrote:
>> > I think you want to actually get these in the view code and pass them to
>> > the
>> > template as named variables. For example:
>> >
>> >     return render_to_response('page.htm',
>> > {'date_time': request.GET['date_time'], 'submit_preview':
>> > request.GET['submit_preview'], 'event_type': request.GET['event_type'],
>> > 'filterValue':
>> > request.GET['_filterValue']}, context_instance=RequestContext(request))
>> >
>> > From the template, now, the different variables are available. {{
>> > date_time
>> > }}, {{ submit_preview }}, {{ event_type }}, {{ filterValue }}. That's
>> > how I
>> > would handle it at least.
>>
>> The URL gets created dynamically by jQuery code in a template. Not all
>> these fields are always present. Also, render_to_response is not used. (I'm
>> fairly new to both django and this job, and I just grepped through the
>> entire code base and it wasn't found.)
>>
>>
>> >
>> > Furbee
>> >
>> > On Tue, Mar 13, 2012 at 11:27 AM, Larry Martell
>> > 
>> > wrote:
>> >>
>> >> On Tue, Mar 13, 2012 at 11:58 AM, Xavier Ordoquy 
>> >> wrote:
>> >> >
>> >> > Le 13 mars 2012 à 18:40, Larry Martell a écrit :
>> >> >
>> >> >> On Tue, Mar 13, 2012 at 11:26 AM, Xavier Ordoquy
>> >> >> 
>> >> >> wrote:
>> >> >>> Hi
>> >> >>>
>> >> >>> Le 13 mars 2012 à 18:11, larry.mart...@gmail.com a écrit :
>> >> >>>
>> >>  From within a template can I find out the URL that caused the
>> >>  template
>> >>  to be invoked?
>> >> >>>
>> >> >>> You usually should have the request object in your template. See
>> >> >>>
>> >> >>> https://docs.djangoproject.com/en/dev/ref/request-response/#django.http.HttpRequest.path
>> >> >>> to get the url.
>> >> >>>
>> >> >>
>> >> >> But how do I access that in the template? I tried HttpRequest.path
>> >> >> and
>> >> >> {{ HttpRequest.path }} and neither gives me the URL.
>> >> >
>> >> > {{ request.path }}
>> >> > just make sure you have RequestContext if you use render_to_response.
>> >>
>> >> This is displaying a path, but not the URL I need. It gives
>> >> /report//EventsTable/ when the URL that's clicked on is:
>> >>
>> >>
>> >>
>> >> http://127.0.0.1/report/EventsTable/?date_time=3y_preview=Generate+Report_type=RecipeCreated&_filterValue=dev
>> >>
>> >> I'm after all the arguments. Is there a way to get them?
>> >>
>> >> --
>> >> You received this message because you are subscribed to the Google
>> >> Groups
>> >> "Django users" group.
>> >> To post to this group, send email to django-users@googlegroups.com.
>> >> To unsubscribe from this group, send email to
>> >> django-users+unsubscr...@googlegroups.com.
>> >> For more options, visit this group at
>> >> http://groups.google.com/group/django-users?hl=en.
>> >>
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups
>> > "Django users" group.
>> > To post to this group, send email to django-users@googlegroups.com.
>> > To unsubscribe from this group, send email to
>> > django-users+unsubscr...@googlegroups.com.
>> > For more options, visit this group at
>> > http://groups.google.com/group/django-users?hl=en.
>>
>>
>>
>> --
>> Sent from my iPhone
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.

-- 
You received this message because you are subscribed 

Re: Django making box

2012-03-13 Thread creecode
Hello Sophia,

On Tuesday, March 13, 2012 1:37:57 PM UTC-7, Sophia wrote:
>
> Thanks all for helping, as I told I read that tutorial, but my supervisor 
> said that I should do that with Django. He didn't mention about learning  
> JavaScript, but is it impossible just with Django?


I don't think it would be impossible to do it all in Django.  If you do it 
solely with Django you would need your box to act like a submit button on a 
form so that you can have the Django server do something in response to a 
form submission.

But without a clearer definition of how you want your app to behave it will 
be hard for us to give you more insight into how you might proceed.

When you say supervisor said is shoul be done in Django is that a 
supervisor as in teacher?  Or supervisor as your superior at work?

Toodle-lo..
creecode


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



Re: Django making box

2012-03-13 Thread Javier Guerra Giraldez
On Tue, Mar 13, 2012 at 3:37 PM, Sophia  wrote:
> Thanks all for helping, as I told I read that tutorial, but my supervisor
> said that I should do that with Django. He didn't mention about learning
> JavaScript, but is it impossible just with Django?

django runs on the server.  if you want to do some client processing
you need code running on the client, typically Javascript.

of course that code is served from a Django app, and modifying a
django-handled page and form, so the project in a whole is still 'done
with Django'.

-- 
Javier

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



Re: Django making box

2012-03-13 Thread Sophia
Thanks all for helping, as I told I read that tutorial, but my supervisor 
said that I should do that with Django. He didn't mention about learning  
JavaScript, but is it impossible just with Django?

Sophia 

On Tuesday, March 13, 2012 12:45:25 PM UTC-7, Sophia wrote:
>
> Hi guys,
>
> I'm completely a beginner in writing Django codes, I read the book online 
> for Django, so I have some basic knowledge about it.
> The task that I should do is to click on a box and it generates new boxes 
> above it by every clicking on it. I  actually wrote in HTML how to make 
> boxes, but my problem is that I have no idea how to do the task I've 
> mentioned earlier. I would really appreciate if you just give me a hint or 
> a link to guide me about this, because I really confused.
>
> Thanks in advance.
> Sophia
>

On Tuesday, March 13, 2012 12:45:25 PM UTC-7, Sophia wrote:
>
> Hi guys,
>
> I'm completely a beginner in writing Django codes, I read the book online 
> for Django, so I have some basic knowledge about it.
> The task that I should do is to click on a box and it generates new boxes 
> above it by every clicking on it. I  actually wrote in HTML how to make 
> boxes, but my problem is that I have no idea how to do the task I've 
> mentioned earlier. I would really appreciate if you just give me a hint or 
> a link to guide me about this, because I really confused.
>
> Thanks in advance.
> Sophia
>

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



Re: Django is very slow on windows server 2003, mssql database

2012-03-13 Thread Javier Guerra Giraldez
On Tue, Mar 13, 2012 at 2:14 PM, Phanounou  wrote:
> Hello,
>
>  have tryed to use the  formfield_for_foreignkey() and
> formfield_for_manytomany() in the admin.py file. In fact, I have reduced
> the reponse time (around 10 sec. less then before) by replacing extra = 2 by
> extra=0 in my admin.StackedInline objects. It still taking 20-24 seconds to
> edit an object in the admin interface. The 2 methods mention on top did not
> help to reduce the time. I don't know what else to try now I'm stuck. Any
> one has a subjection?


this is what did the trick for me:

def formfield_for_foreignkey(self, db_field, request, **kwargs):
if db_field.name == 'pagina':
kwargs['queryset'] = Pagina.objects.select_related()
return super(EventAdmin, 
self).formfield_for_foreignkey(db_field,
request, **kwargs)


in short, it adds the select_related() to the queryset used for the
'pagina' foreign key.  that was needed because the __unicode__()
method of the Pagina model uses some related fields.

but you still haven't verified what generates the thousands of
queries.  take the tieme to read the SQL generated to see what is it
fetching and why.


-- 
Javier

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



Re: Getting URL from within a template

2012-03-13 Thread Furbee
Hi Larry,

render_to_response is one of many ways to return an HttpResponse to send to
the client. Wherever your view does the return, you can pass these GET
variables.

However, if they are being generated by jQuery, dynamically, you should be
using jQuery/javascript to read them and deal with them. This should be
client side javascript code. To read the current URL string in jQuery, I
found a nice little article at
http://jquery-howto.blogspot.com/2009/09/get-url-parameters-values-with-jquery.html
which
should demonstrate how to get these in javascript on the client-side
browser.

Good luck,

Furbee

On Tue, Mar 13, 2012 at 11:57 AM, Larry Martell wrote:

> On Tue, Mar 13, 2012 at 12:38 PM, Furbee  wrote:
> > I think you want to actually get these in the view code and pass them to
> the
> > template as named variables. For example:
> >
> > return render_to_response('page.htm',
> > {'date_time': request.GET['date_time'], 'submit_preview':
> > request.GET['submit_preview'], 'event_type': request.GET['event_type'],
> > 'filterValue':
> > request.GET['_filterValue']}, context_instance=RequestContext(request))
> >
> > From the template, now, the different variables are available. {{
> date_time
> > }}, {{ submit_preview }}, {{ event_type }}, {{ filterValue }}. That's
> how I
> > would handle it at least.
>
> The URL gets created dynamically by jQuery code in a template. Not all
> these fields are always present. Also, render_to_response is not used. (I'm
> fairly new to both django and this job, and I just grepped through the
> entire code base and it wasn't found.)
>
>
> >
> > Furbee
> >
> > On Tue, Mar 13, 2012 at 11:27 AM, Larry Martell  >
> > wrote:
> >>
> >> On Tue, Mar 13, 2012 at 11:58 AM, Xavier Ordoquy 
> >> wrote:
> >> >
> >> > Le 13 mars 2012 à 18:40, Larry Martell a écrit :
> >> >
> >> >> On Tue, Mar 13, 2012 at 11:26 AM, Xavier Ordoquy <
> xordo...@linovia.com>
> >> >> wrote:
> >> >>> Hi
> >> >>>
> >> >>> Le 13 mars 2012 à 18:11, larry.mart...@gmail.com a écrit :
> >> >>>
> >>  From within a template can I find out the URL that caused the
> >>  template
> >>  to be invoked?
> >> >>>
> >> >>> You usually should have the request object in your template. See
> >> >>>
> https://docs.djangoproject.com/en/dev/ref/request-response/#django.http.HttpRequest.path
> >> >>> to get the url.
> >> >>>
> >> >>
> >> >> But how do I access that in the template? I tried HttpRequest.path
> and
> >> >> {{ HttpRequest.path }} and neither gives me the URL.
> >> >
> >> > {{ request.path }}
> >> > just make sure you have RequestContext if you use render_to_response.
> >>
> >> This is displaying a path, but not the URL I need. It gives
> >> /report//EventsTable/ when the URL that's clicked on is:
> >>
> >>
> >>
> http://127.0.0.1/report/EventsTable/?date_time=3y_preview=Generate+Report_type=RecipeCreated&_filterValue=dev
> >>
> >> I'm after all the arguments. Is there a way to get them?
> >>
> >> --
> >> You received this message because you are subscribed to the Google
> Groups
> >> "Django users" group.
> >> To post to this group, send email to django-users@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> django-users+unsubscr...@googlegroups.com.
> >> For more options, visit this group at
> >> http://groups.google.com/group/django-users?hl=en.
> >>
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > To post to this group, send email to django-users@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> > http://groups.google.com/group/django-users?hl=en.
>
>
>
> --
> Sent from my iPhone
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: Django making box

2012-03-13 Thread Joel Goldstick
On Tue, Mar 13, 2012 at 3:58 PM, Sandro Dutra  wrote:
> "The task that I should do is to click on a box and it generates new boxes
> above it by every clicking on it."
> I think JavaScript (jQuery) is the best option to achieve this.
>
>
> 2012/3/13 Sophia 
>>
>> Hi guys,
>>
>> I'm completely a beginner in writing Django codes, I read the book online
>> for Django, so I have some basic knowledge about it.
>> The task that I should do is to click on a box and it generates new boxes
>> above it by every clicking on it. I  actually wrote in HTML how to make
>> boxes, but my problem is that I have no idea how to do the task I've
>> mentioned earlier. I would really appreciate if you just give me a hint or a
>> link to guide me about this, because I really confused.
>>
>> Thanks in advance.
>> Sophia
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/django-users/-/pZQOIyr8LKAJ.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.

You might like to go to the django site:  https://docs.djangoproject.com/en/1.3/

and go through the tutorial links.  It takes a couple of hours, and is
well worth the effort to get a handle on how the pieces of Django fit
together.

But the task you mentioned in your post sounds like a javascript
project rather than something you would do on the server.

If you are also new to programming in python and want to learn more
about the language try the python-tutor mailing list

-- 
Joel Goldstick

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



Re: Django making box

2012-03-13 Thread Sandro Dutra
"The task that I should do is to click on a box and it generates new boxes
above it by every clicking on it."
I think JavaScript (jQuery) is the best option to achieve this.

2012/3/13 Sophia 

> Hi guys,
>
> I'm completely a beginner in writing Django codes, I read the book online
> for Django, so I have some basic knowledge about it.
> The task that I should do is to click on a box and it generates new boxes
> above it by every clicking on it. I  actually wrote in HTML how to make
> boxes, but my problem is that I have no idea how to do the task I've
> mentioned earlier. I would really appreciate if you just give me a hint or
> a link to guide me about this, because I really confused.
>
> Thanks in advance.
> Sophia
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/pZQOIyr8LKAJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Django making box

2012-03-13 Thread Sophia
Hi guys,

I'm completely a beginner in writing Django codes, I read the book online 
for Django, so I have some basic knowledge about it.
The task that I should do is to click on a box and it generates new boxes 
above it by every clicking on it. I  actually wrote in HTML how to make 
boxes, but my problem is that I have no idea how to do the task I've 
mentioned earlier. I would really appreciate if you just give me a hint or 
a link to guide me about this, because I really confused.

Thanks in advance.
Sophia

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



Re: Django is very slow on windows server 2003, mssql database

2012-03-13 Thread Phanounou
Hello,

 have tryed to use the  formfield_for_foreignkey() and
formfield_for_manytomany() in the admin.py file. In fact, I have reduced
the reponse time (around 10 sec. less then before) by replacing extra = 2
by extra=0 in my admin.StackedInline objects. It still taking 20-24 seconds
to edit an object in the admin interface. The 2 methods mention on top did
not help to reduce the time. I don't know what else to try now I'm stuck.
Any one has a subjection?

Regards,
VB

2012/3/13 Martynas RMSMR 

> Running django on windows is waste of time.
>
> In fact, we are phasing out closed source products and they will be
> eventually merged into core.
>
> M
> From: Virginia
> Sent: 13/03/2012 13:58
> To: Django users
> Subject: Django is very slow on windows server 2003, mssql database
> Good morning everyone,
>
> I have a web site that was develop in django on a windows 2003 server
> and a mssql database. Latetly it seems that the web site is going
> slower and slower. We add datas but not that much to slow it down so
> much. I run it on my dev environnement with cProfile and looking at
> the stats (p.sort_stats('time').print_stats(10) I saw that the first
> line is
>
> ncalls   tottimepercallcumtimepercall
> filename:lineno(function)
> 1  85.085 85.085 85.085  85.085{nt.spawnve}
>
> I would like to know what is this file and why is it taking so long.
>
> Regards,
> VB
>
> --
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Getting URL from within a template

2012-03-13 Thread Larry Martell
On Tue, Mar 13, 2012 at 12:38 PM, Furbee  wrote:
> I think you want to actually get these in the view code and pass them to
the
> template as named variables. For example:
>
> return render_to_response('page.htm',
> {'date_time': request.GET['date_time'], 'submit_preview':
> request.GET['submit_preview'], 'event_type': request.GET['event_type'],
> 'filterValue':
> request.GET['_filterValue']}, context_instance=RequestContext(request))
>
> From the template, now, the different variables are available. {{
date_time
> }}, {{ submit_preview }}, {{ event_type }}, {{ filterValue }}. That's how
I
> would handle it at least.

The URL gets created dynamically by jQuery code in a template. Not all
these fields are always present. Also, render_to_response is not used. (I'm
fairly new to both django and this job, and I just grepped through the
entire code base and it wasn't found.)

>
> Furbee
>
> On Tue, Mar 13, 2012 at 11:27 AM, Larry Martell 
> wrote:
>>
>> On Tue, Mar 13, 2012 at 11:58 AM, Xavier Ordoquy 
>> wrote:
>> >
>> > Le 13 mars 2012 à 18:40, Larry Martell a écrit :
>> >
>> >> On Tue, Mar 13, 2012 at 11:26 AM, Xavier Ordoquy 
>> >> wrote:
>> >>> Hi
>> >>>
>> >>> Le 13 mars 2012 à 18:11, larry.mart...@gmail.com a écrit :
>> >>>
>>  From within a template can I find out the URL that caused the
>>  template
>>  to be invoked?
>> >>>
>> >>> You usually should have the request object in your template. See
>> >>>
https://docs.djangoproject.com/en/dev/ref/request-response/#django.http.HttpRequest.path
>> >>> to get the url.
>> >>>
>> >>
>> >> But how do I access that in the template? I tried HttpRequest.path and
>> >> {{ HttpRequest.path }} and neither gives me the URL.
>> >
>> > {{ request.path }}
>> > just make sure you have RequestContext if you use render_to_response.
>>
>> This is displaying a path, but not the URL I need. It gives
>> /report//EventsTable/ when the URL that's clicked on is:
>>
>>
>>
http://127.0.0.1/report/EventsTable/?date_time=3y_preview=Generate+Report_type=RecipeCreated&_filterValue=dev
>>
>> I'm after all the arguments. Is there a way to get them?
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.



-- 
Sent from my iPhone

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



ANN: Django-Shorty 0.1.0 released

2012-03-13 Thread andrea mucci
Hi All

i'm happy to announce the release of Django-Shorty 0.1.0 is a simple GPL3 app 
for building "private" Django shortening Url service.

this release offer:

- Bijective encode/decode slug
- Django admin interface integration
- 301 HTTP Status Code
- Password protected URL redirection
- URL moderation
- Django User integrated

The project is still on Beta

Roadmap

- REST Interface
- Image Short Link
- Track Visits

Django-Shorty Git repo: https://github.com/ogonbat/django-shorty
Django-Shorty issue tracker: https://github.com/ogonbat/django-shorty/issues
Django-Shorty documentation: 
http://django-shorty.readthedocs.org/en/latest/index.html

Thank's
Andrea

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



Re: Getting URL from within a template

2012-03-13 Thread Furbee
I think you want to actually get these in the view code and pass them to
the template as named variables. For example:

return render_to_response('page.htm',
{'date_time': request.GET['date_time'], 'submit_preview':
request.GET['submit_preview'], 'event_type': request.GET['event_type'],
'filterValue':
request.GET['_filterValue']}, context_instance=RequestContext(request))

>From the template, now, the different variables are available. {{ date_time
}}, {{ submit_preview }}, {{ event_type }}, {{ filterValue }}. That's how I
would handle it at least.

Furbee

On Tue, Mar 13, 2012 at 11:27 AM, Larry Martell wrote:

> On Tue, Mar 13, 2012 at 11:58 AM, Xavier Ordoquy 
> wrote:
> >
> > Le 13 mars 2012 à 18:40, Larry Martell a écrit :
> >
> >> On Tue, Mar 13, 2012 at 11:26 AM, Xavier Ordoquy 
> wrote:
> >>> Hi
> >>>
> >>> Le 13 mars 2012 à 18:11, larry.mart...@gmail.com a écrit :
> >>>
>  From within a template can I find out the URL that caused the template
>  to be invoked?
> >>>
> >>> You usually should have the request object in your template. See
> https://docs.djangoproject.com/en/dev/ref/request-response/#django.http.HttpRequest.pathto
>  get the url.
> >>>
> >>
> >> But how do I access that in the template? I tried HttpRequest.path and
> >> {{ HttpRequest.path }} and neither gives me the URL.
> >
> > {{ request.path }}
> > just make sure you have RequestContext if you use render_to_response.
>
> This is displaying a path, but not the URL I need. It gives
> /report//EventsTable/ when the URL that's clicked on is:
>
>
> http://127.0.0.1/report/EventsTable/?date_time=3y_preview=Generate+Report_type=RecipeCreated&_filterValue=dev
>
> I'm after all the arguments. Is there a way to get them?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

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



Re: Getting URL from within a template

2012-03-13 Thread Larry Martell
On Tue, Mar 13, 2012 at 11:58 AM, Xavier Ordoquy  wrote:
>
> Le 13 mars 2012 à 18:40, Larry Martell a écrit :
>
>> On Tue, Mar 13, 2012 at 11:26 AM, Xavier Ordoquy  
>> wrote:
>>> Hi
>>>
>>> Le 13 mars 2012 à 18:11, larry.mart...@gmail.com a écrit :
>>>
 From within a template can I find out the URL that caused the template
 to be invoked?
>>>
>>> You usually should have the request object in your template. See 
>>> https://docs.djangoproject.com/en/dev/ref/request-response/#django.http.HttpRequest.path
>>>  to get the url.
>>>
>>
>> But how do I access that in the template? I tried HttpRequest.path and
>> {{ HttpRequest.path }} and neither gives me the URL.
>
> {{ request.path }}
> just make sure you have RequestContext if you use render_to_response.

This is displaying a path, but not the URL I need. It gives
/report//EventsTable/ when the URL that's clicked on is:

http://127.0.0.1/report/EventsTable/?date_time=3y_preview=Generate+Report_type=RecipeCreated&_filterValue=dev

I'm after all the arguments. Is there a way to get them?

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



Re: Getting URL from within a template

2012-03-13 Thread Xavier Ordoquy

Le 13 mars 2012 à 18:40, Larry Martell a écrit :

> On Tue, Mar 13, 2012 at 11:26 AM, Xavier Ordoquy  wrote:
>> Hi
>> 
>> Le 13 mars 2012 à 18:11, larry.mart...@gmail.com a écrit :
>> 
>>> From within a template can I find out the URL that caused the template
>>> to be invoked?
>> 
>> You usually should have the request object in your template. See 
>> https://docs.djangoproject.com/en/dev/ref/request-response/#django.http.HttpRequest.path
>>  to get the url.
>> 
> 
> But how do I access that in the template? I tried HttpRequest.path and
> {{ HttpRequest.path }} and neither gives me the URL.

{{ request.path }}
just make sure you have RequestContext if you use render_to_response.

Regards,
Xavier.

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



Re: how to use Django ORM in standalone script

2012-03-13 Thread H.T. Wei
Thanks for Bill's suggestion.
I found a simpler way to serve this purpose by using SQLalchemy mapping in
my script on the server without Django installed/environment.



On Mon, Mar 12, 2012 at 11:40 AM, Bill Freeman  wrote:

> I would:
>
>  1. Write the script as a manage.py command.
>  2. Duplicate the Django install on the other machine (or at least
> enough of it to cover the models that you need), making any settings
> changes needed to access the correct DB (i.e.; if you're using
> "localhost" to access the DB in your original server, that's got to
> change on the other).
>
> The server never needs to run on the second machine, and it doesn't
> need apache, mod_wsgi, or whatever mechanism you are using to serve
> pages on the first machine.  But the ORM needs access to the model
> definitions of the relevant apps, and it will typically be easier to
> pull the whole thing than to tease out just enough.  If your project
> is in a suitable VCS, that is a good way to make the copy.
>
> Bill
>
> On 3/12/12, H.T. Wei  wrote:
> > Hi,
> >
> > If anyone can suggest what is the best way to use Django ORM in
> standalone
> > script for accessing database? The "standalone script" is located on the
> > server different from Django server but access the same database server.
> > Thanks in advance!
> >
> >
> > Steve
> > --
> > " stay hungry, stay foolish"
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > To post to this group, send email to django-users@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> > http://groups.google.com/group/django-users?hl=en.
> >
> >
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
" stay hungry, stay foolish"

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



Re: Getting URL from within a template

2012-03-13 Thread Larry Martell
On Tue, Mar 13, 2012 at 11:26 AM, Xavier Ordoquy  wrote:
> Hi
>
> Le 13 mars 2012 à 18:11, larry.mart...@gmail.com a écrit :
>
>> From within a template can I find out the URL that caused the template
>> to be invoked?
>
> You usually should have the request object in your template. See 
> https://docs.djangoproject.com/en/dev/ref/request-response/#django.http.HttpRequest.path
>  to get the url.
>

But how do I access that in the template? I tried HttpRequest.path and
{{ HttpRequest.path }} and neither gives me the URL.

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



Displaying Updates

2012-03-13 Thread coded kid
Hi Guys, how can I make users who are following each other view their
status update on their walls? In my project, users can follow and
unfollow each other but the problem I’m facing is that, both of them
can’t see each other statuses on their wall.

I’m using a caffinehit/django follow package that handles following of
users.

I would be glad if you can try and answer this question!

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



Re: Getting URL from within a template

2012-03-13 Thread Xavier Ordoquy
Hi

Le 13 mars 2012 à 18:11, larry.mart...@gmail.com a écrit :

> From within a template can I find out the URL that caused the template
> to be invoked?

You usually should have the request object in your template. See 
https://docs.djangoproject.com/en/dev/ref/request-response/#django.http.HttpRequest.path
 to get the url.

Regards,
Xavier.

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



Getting URL from within a template

2012-03-13 Thread larry.mart...@gmail.com
>From within a template can I find out the URL that caused the template
to be invoked?

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



RE: Django is very slow on windows server 2003, mssql database

2012-03-13 Thread Martynas RMSMR
Running django on windows is waste of time.

In fact, we are phasing out closed source products and they will be
eventually merged into core.

M
From: Virginia
Sent: 13/03/2012 13:58
To: Django users
Subject: Django is very slow on windows server 2003, mssql database
Good morning everyone,

I have a web site that was develop in django on a windows 2003 server
and a mssql database. Latetly it seems that the web site is going
slower and slower. We add datas but not that much to slow it down so
much. I run it on my dev environnement with cProfile and looking at
the stats (p.sort_stats('time').print_stats(10) I saw that the first
line is

ncalls   tottimepercallcumtimepercall
filename:lineno(function)
1  85.085 85.08585.085  85.085{nt.spawnve}

I would like to know what is this file and why is it taking so long.

Regards,
VB

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

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



Re: install os x problem

2012-03-13 Thread Patricio Valarezo

El 13/03/12 10:41, Clark escribió:

I installed django via $ sudo pip install django
on my Mac OS X

When running through the install, one of the last lines says:
"error: /usr/local/bin/django-admin.py: No such file or directory"

So, when I try to run $ django-admin.py startproject mysite, I get the
-bash: django-admin.py: command not found

Only way I can get this command to work is to refer to the django-
admin.py with the full path...
$ full/path/of/location/django-admin.py startproject mysite

Thanks,

Clark

My advice is against using python and install libs right from the OS X. 
I'm using django on my mac book air without issues using homebrew or 
fink for installing virtualenv and then creating my own environments, in 
this way I avoid the use of the main python install from OS X . If I 
were in Linux I would do the same thing.


PatoVala

--
Patricio Valarezo Lozano.
patov...@pupilabox.net.ec
www.pupilabox.net.ec
"las cosas no se hacen solas, alguien las tiene que hacer..."

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



django admin writing custom functions

2012-03-13 Thread dummyman dummyman
Hi,

how to write  a custom django function in admin.py so that after adding the
data in models in localhost:8000/app/models/ should be redirected to a user
defined view function where we display the previously entered data entries
for display?

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



RE: [Opportunity][Python] Young Passionate Technology Entrepreneurs

2012-03-13 Thread Martynas RMSMR
We are glad you like this. We are Always On.

+HRITSystems+
.
From: RiteshGanatra
Sent: 13/03/2012 12:22
To: Django users
Subject: [Opportunity][Python] Young Passionate Technology Entrepreneurs
Hi Folks,

We are looking for young passionate technology Entrepreneurs.

Wait, Let me make some definitions clear :

Young : Super Energetic and looking for opportunities
Passionate: The 100th monkey
Technology: Social Networking, Social Media, Tablets, Web Development,
Web Designing, Technical and/or creative Writing(Blogs, etc).
Entrepreneurs: Are Born and not Made;

OK, basics set, we are looking for such people (currently only
parttime, but if you are passionate enough full time shouldnt be an
issue), to help us convert a basic prototype into a reality. We have
an amazing feedback already from 100s of potential customers, our
advisors, etc.

We are currently a set of super passionate people, mostly part time
(people from NID, Amazon.com, and more) , in a 3 month investment
round. The investors are quite BIG (Sold 2 companies already, latest
for > 30M USD ).

Being in a stealth mode, I cannot reveal any details here.

We are currently looking for:
1) Kickass Python Web Developers
2) Passionate Web Designers.

Major Technologies/Domains we are looking at: Python Web development
(Django), AWS, Adaptive/Machine learning, Social Networking, E-
commerce(later in the game), Tablets, initially Android; and lastly,
ability to create great user experiences.

So if you are looking for an opportunity in a tech company with superb
potential, backed with the best technology people and advisors around
the world and a set of talented people who see the vision clearly then
drop me a mail with the reason you want to be a part of it, and also
mention your skills.

We would then set up a call/meeting, and discuss further.


Thanks,
Ritesh
+9970283454

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

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



RE: [Opportunity][Python] Young Passionate Technology Entrepreneurs

2012-03-13 Thread Martynas RMSMR
We are glad you like this. We are Always On.

+HRITSystems+
.
From: RiteshGanatra
Sent: 13/03/2012 12:22
To: Django users
Subject: [Opportunity][Python] Young Passionate Technology Entrepreneurs
Hi Folks,

We are looking for young passionate technology Entrepreneurs.

Wait, Let me make some definitions clear :

Young : Super Energetic and looking for opportunities
Passionate: The 100th monkey
Technology: Social Networking, Social Media, Tablets, Web Development,
Web Designing, Technical and/or creative Writing(Blogs, etc).
Entrepreneurs: Are Born and not Made;

OK, basics set, we are looking for such people (currently only
parttime, but if you are passionate enough full time shouldnt be an
issue), to help us convert a basic prototype into a reality. We have
an amazing feedback already from 100s of potential customers, our
advisors, etc.

We are currently a set of super passionate people, mostly part time
(people from NID, Amazon.com, and more) , in a 3 month investment
round. The investors are quite BIG (Sold 2 companies already, latest
for > 30M USD ).

Being in a stealth mode, I cannot reveal any details here.

We are currently looking for:
1) Kickass Python Web Developers
2) Passionate Web Designers.

Major Technologies/Domains we are looking at: Python Web development
(Django), AWS, Adaptive/Machine learning, Social Networking, E-
commerce(later in the game), Tablets, initially Android; and lastly,
ability to create great user experiences.

So if you are looking for an opportunity in a tech company with superb
potential, backed with the best technology people and advisors around
the world and a set of talented people who see the vision clearly then
drop me a mail with the reason you want to be a part of it, and also
mention your skills.

We would then set up a call/meeting, and discuss further.


Thanks,
Ritesh
+9970283454

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

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



Re: Django is very slow on windows server 2003, mssql database

2012-03-13 Thread Javier Guerra Giraldez
On Tue, Mar 13, 2012 at 10:41 AM, Phanounou  wrote:
> When I look at the traceback from the django_debug_toolbar, there is 1852
> queries in 20956ms, there is several repetition of the same calls. And there
> is a lot of unnacessary calls. How can I optimise that? what can I do about
> it? is there a way to overwrite the page for a given object. Because I
> realise that my custom pages take less time to load.

in a similar situation, i found that defining the
formfield_for_foreignkey() method lets you optimize the queryset used
for the selection widgets.

check the admin docs, there are lots of tuning there.  specifically

https://docs.djangoproject.com/en/1.3/ref/contrib/admin/#django.contrib.admin.ModelAdmin.formfield_for_foreignkey

and many more.

-- 
Javier

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



Re: install os x problem

2012-03-13 Thread Patrick Sweet
You are going to have to update your system's PATH variable to recognize
django-admin.py.

I'm on Windows, but here's a link to how to set the path on a mac:
http://www.tech-recipes.com/rx/2621/os_x_change_path_environment_variable/

Essentially, your path should look similar to
"$PATH$;/full/path/of/django/location"

If you haven't already, you should probably also include your Python
site-packages and scripts folders to your path. That will save you
heartache in the future.

- Pat


On Tue, Mar 13, 2012 at 11:41 AM, Clark  wrote:

> I installed django via $ sudo pip install django
> on my Mac OS X
>
> When running through the install, one of the last lines says:
> "error: /usr/local/bin/django-admin.py: No such file or directory"
>
> So, when I try to run $ django-admin.py startproject mysite, I get the
> -bash: django-admin.py: command not found
>
> Only way I can get this command to work is to refer to the django-
> admin.py with the full path...
> $ full/path/of/location/django-admin.py startproject mysite
>
> Thanks,
>
> Clark
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

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



install os x problem

2012-03-13 Thread Clark
I installed django via $ sudo pip install django
on my Mac OS X

When running through the install, one of the last lines says:
"error: /usr/local/bin/django-admin.py: No such file or directory"

So, when I try to run $ django-admin.py startproject mysite, I get the
-bash: django-admin.py: command not found

Only way I can get this command to work is to refer to the django-
admin.py with the full path...
$ full/path/of/location/django-admin.py startproject mysite

Thanks,

Clark

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



Re: Django is very slow on windows server 2003, mssql database

2012-03-13 Thread Phanounou
I'm glad that we might have found the problem and now we are trying to
resolve it.

The page is "edit"

The __unicode__ methode for TrProductsVersion is:

def __unicode__(self):
return u'%s (version: %s)' %(self.catalogueid,
self.prodversionid)

Where "catalogueid" (this object has one foreignkey, not in his unicode
methode) and "prodversionid"(this object has only one field) are foreign
keys and their __unicode__ methodes looks like this:

def __unicode__(self):
return u'%s' %self.productname

AND

def __unicode__(self):
return u'%s' %self.version



The __unicode__ methode for TLocation (this object has no foreign key) is:

def __unicode__(self):
return u'%s' %self.address


Finally the __unicode__ methode for TrRelatedService looks like this:

def __unicode__(self):

if self.clientservicename:
return u'%s' %(self.servicename)
else:
return u'%s (%s)' %(self.conid, self.solutionid)

This object has 5 foreign keys and 3 ManyToManyField relation.

When I look at the traceback from the django_debug_toolbar, there is 1852
queries in 20956ms, there is several repetition of the same calls. And
there is a lot of unnacessary calls. How can I optimise that? what can I do
about it? is there a way to overwrite the page for a given object. Because
I realise that my custom pages take less time to load.

Regards,
VB



2012/3/13 Javier Guerra Giraldez 

> On Tue, Mar 13, 2012 at 9:55 AM, Phanounou 
> wrote:
> > I installed the django_debug_toolbar and I see that in the sql part I
> have
> > 1852 queries in 18228.00ms.
>
> great, so this is indeed the problem.
>
> which page is this?, the listing or the edit page?  check the SQL
> code, which tables is it accessing?
>
> if this happens on the edit page, it might be when constructing the
> select elements.  how does the __unicode__ of the related models look
> like?
>
> --
> Javier
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

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



Re: newbie django hosting question

2012-03-13 Thread NENAD CIKIC
OK, thanks.

On 13 ožu, 16:11, Bill Freeman  wrote:
> I'm not sure that "django hosting" nails anything down.  It could mean
> whatever the provider wants it to mean, from "we won't kick you off
> for using a non-Microsoft tool" to "we understand django and will help
> you deploy, debug, and maintian it".
>
> One significant variation from VPS that you should know about is
> shared hosting, which is what I call what Webfaction does (we use them
> to host several client sites, both django and plone).  You get an
> account on a machine, rather than a virtual machine, your choice of
> pre-configured starting configurations of several different
> frameworks, or the tools you need to roll your own, and a management
> interface to get your domains virtual hosted by the host wide front
> end to to ports they assign for your back end(s).  You also get a
> database in their server.  They have the permissings figured out so
> the various accounts don't leak to one another, but you can still have
> slow downs if one of  your machine mates starts taking more than his
> allotment of time or memory (they do detect and kill such back ends
> reasonably promptly).  The benefit is that you don't have to do os
> management, but you are also more restricted than you would be in a
> VPS.
>
> Bill
>
> On 3/13/12, NENAD CIKIC  wrote:
>
>
>
>
>
>
>
> > I now need to put on web the small project i have developed. To test
> > and to skill me on linux, I have created virtualbox ubuntu VM and
> > deployed the project and used nginx to serve it (all from scratch).
>
> > May someone provide me clarification on the following:
> > - what is the difference between "django hosting" and normal VPS?
>
> > What i get with more with django hosting?
> > Thanks
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > To post to this group, send email to django-users@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.

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



Re: Django is very slow on windows server 2003, mssql database

2012-03-13 Thread Jani Tiainen

13.3.2012 17:09, Javier Guerra Giraldez kirjoitti:

On Tue, Mar 13, 2012 at 9:55 AM, Phanounou  wrote:

I installed the django_debug_toolbar and I see that in the sql part I have
1852 queries in 18228.00ms.


great, so this is indeed the problem.

which page is this?, the listing or the edit page?  check the SQL
code, which tables is it accessing?

if this happens on the edit page, it might be when constructing the
select elements.  how does the __unicode__ of the related models look
like?



Also if this happens on edit page, those dropdowns and multiselect lists 
get's populated from foreignkey / m2m tables which might create quite 
lot of data.


I had fun times with my customer foreignkey to address model with 21 
million rows in address... :)


--

Jani Tiainen

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



Re: newbie django hosting question

2012-03-13 Thread Bill Freeman
I'm not sure that "django hosting" nails anything down.  It could mean
whatever the provider wants it to mean, from "we won't kick you off
for using a non-Microsoft tool" to "we understand django and will help
you deploy, debug, and maintian it".

One significant variation from VPS that you should know about is
shared hosting, which is what I call what Webfaction does (we use them
to host several client sites, both django and plone).  You get an
account on a machine, rather than a virtual machine, your choice of
pre-configured starting configurations of several different
frameworks, or the tools you need to roll your own, and a management
interface to get your domains virtual hosted by the host wide front
end to to ports they assign for your back end(s).  You also get a
database in their server.  They have the permissings figured out so
the various accounts don't leak to one another, but you can still have
slow downs if one of  your machine mates starts taking more than his
allotment of time or memory (they do detect and kill such back ends
reasonably promptly).  The benefit is that you don't have to do os
management, but you are also more restricted than you would be in a
VPS.

Bill

On 3/13/12, NENAD CIKIC  wrote:
> I now need to put on web the small project i have developed. To test
> and to skill me on linux, I have created virtualbox ubuntu VM and
> deployed the project and used nginx to serve it (all from scratch).
>
> May someone provide me clarification on the following:
> - what is the difference between "django hosting" and normal VPS?
>
> What i get with more with django hosting?
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

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



Re: Django is very slow on windows server 2003, mssql database

2012-03-13 Thread Javier Guerra Giraldez
On Tue, Mar 13, 2012 at 9:55 AM, Phanounou  wrote:
> I installed the django_debug_toolbar and I see that in the sql part I have
> 1852 queries in 18228.00ms.

great, so this is indeed the problem.

which page is this?, the listing or the edit page?  check the SQL
code, which tables is it accessing?

if this happens on the edit page, it might be when constructing the
select elements.  how does the __unicode__ of the related models look
like?

-- 
Javier

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



Re: Django is very slow on windows server 2003, mssql database

2012-03-13 Thread Phanounou
Good morning Javier,

Thanks a lot for the quick answer. The thing is that I'm having the problem
on the admin page, it is not involving any coding from my part what so
ever. So that is why I don't get it. When you say "the admin objects can be
annotated to make
the necessary prefetching." what do you mean by that? May I have an example
please. Another thing, I installed the django_debug_toolbar and I see that
in the sql part I have 1852 queries in 18228.00ms. This is a lot,
considering my object:


class TmyObject(models.Model):
STAT_CHOICES = (
   (u'OPERATING', u'OPERATING'),
   (u'Not Ready', u'Not Ready'),
)

name = models.CharField('CI Name', max_length=150)
versionid = models.ForeignKey(TrProductsVersion, verbose_name="The
product", blank=True, null=True)
parent = models.ForeignKey('self', blank=True, null=True,
verbose_name="Parent class")
supported = models.BooleanField('CI is Supported?')
status = models.CharField('CI Status', max_length=20,
choices=STAT_CHOICES)
description = models.TextField('Object description', blank=True,
null=True)
locationid = models.ForeignKey(TLocation, verbose_name="Location",
blank=True, null=True)
clientservices = models.ManyToManyField(TrRelatedServ,
through='TrRelatedService', verbose_name="Related service")

def __unicode__(self):
return u'%s' %self.name

class Meta:
verbose_name = "Object"
ordering = ['name']


The "TrProductsVersion" has 2 foreignkey, "TLocation" has no foreign key
and "TrRelatedService" has a 2 foreignkey (one on TmyObject and one that
the object has several other foreign keys). How can I reduce the queries
numbers? It is too much...

Regards,
VB


2012/3/13 Javier Guerra Giraldez 

> On Tue, Mar 13, 2012 at 7:57 AM, Virginia 
> wrote:
> > We add datas but not that much to slow it down so
> > much.
>
> this is usually not about data itself, being heavy but about having a
> bad algorithmic behavior.
>
> the most common culprit is having unexpected queries inside a loop.
> for example:
>
> {% for msg in message.objects.all %}
>{{ msg.author.get_full_name}}
>{{ msg.text }}
> {% endfor %}
>
> sounds clean, no?  but if the 'author' field is a ForeignKey, getting
> the full name might do a new query for each message.  then you have
> the  awful "N+1 queries" problem (1 to get all messages, and N for all
> the users).  in this case it's easy to add 'select_related' to the
> first line.
>
> a slightly harder case (but almost as common) is when you have nested
> loops (say, listing all books for each author).  here select_related
> usually won't help; you have to reformulate the loop.  typically you
> can list all books sorted by author and insert an {% ifchanged
> book.author%} within the loop to display the author info at the
> appropriate places.
>
> another one that bite me is fetching related fields in the __unicode__
> function, this makes a simple list (or popup menu) increasingly heavy.
>  it could be fixed with select_related, just like the first case; but
> if if happens in the admin pages, you might not be able to add it
> where needed.  fortuately, the admin objects can be annotated to make
> the necessary prefetching.
>
> finally, to find this before going to production, you just have to
> check on the number of queries per page. it's not important to cut
> everything down to just one or two; just check that the total number
> of queries doesn't grow when the data grows.  For this a great tool is
> the django_bebug_toolbar, it clearly shows every query used to
> generate each page.
>
> --
> Javier
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

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



Re: Django is very slow on windows server 2003, mssql database

2012-03-13 Thread Tom Evans
On Tue, Mar 13, 2012 at 12:57 PM, Virginia  wrote:
> Good morning everyone,
>
> I have a web site that was develop in django on a windows 2003 server
> and a mssql database. Latetly it seems that the web site is going
> slower and slower. We add datas but not that much to slow it down so
> much. I run it on my dev environnement with cProfile and looking at
> the stats (p.sort_stats('time').print_stats(10) I saw that the first
> line is
>
> ncalls   tottime    percall    cumtime    percall
> filename:lineno(function)
> 1          85.085     85.085 85.085      85.085    {nt.spawnve}
>
> I would like to know what is this file and why is it taking so long.
>
> Regards,
> VB
>

"nt.spawnve" I've never heard of, but "os.spawnve" is how you spawn a
subprocess whilst specifying an environment:

http://docs.python.org/library/os.html#os.spawnve

Also, there is only 1 call to this function, taking 85 seconds (or is
it ms?). As an out there guess, this is spawning a process and
specifying P_WAIT as the mode, and 85 seconds is how long the OS has
waited for the subprocess to exit.

Cheers

Tom

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



Re: Django is very slow on windows server 2003, mssql database

2012-03-13 Thread Javier Guerra Giraldez
On Tue, Mar 13, 2012 at 7:57 AM, Virginia  wrote:
> We add datas but not that much to slow it down so
> much.

this is usually not about data itself, being heavy but about having a
bad algorithmic behavior.

the most common culprit is having unexpected queries inside a loop.
for example:

{% for msg in message.objects.all %}
{{ msg.author.get_full_name}}
{{ msg.text }}
{% endfor %}

sounds clean, no?  but if the 'author' field is a ForeignKey, getting
the full name might do a new query for each message.  then you have
the  awful "N+1 queries" problem (1 to get all messages, and N for all
the users).  in this case it's easy to add 'select_related' to the
first line.

a slightly harder case (but almost as common) is when you have nested
loops (say, listing all books for each author).  here select_related
usually won't help; you have to reformulate the loop.  typically you
can list all books sorted by author and insert an {% ifchanged
book.author%} within the loop to display the author info at the
appropriate places.

another one that bite me is fetching related fields in the __unicode__
function, this makes a simple list (or popup menu) increasingly heavy.
 it could be fixed with select_related, just like the first case; but
if if happens in the admin pages, you might not be able to add it
where needed.  fortuately, the admin objects can be annotated to make
the necessary prefetching.

finally, to find this before going to production, you just have to
check on the number of queries per page. it's not important to cut
everything down to just one or two; just check that the total number
of queries doesn't grow when the data grows.  For this a great tool is
the django_bebug_toolbar, it clearly shows every query used to
generate each page.

-- 
Javier

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



Re: inserting a date/time in "RFC 3339" format into django DateTimeField

2012-03-13 Thread Tom Evans
On Tue, Mar 13, 2012 at 1:46 PM, Ahmad  wrote:
> I'm trying to insert date/time as I'm storing data retrieved from google
> calendar api about event start and end date.
> here is the RFC link RFC 3339
>

DateTimeField wants a python datetime.datetime object. You can use
datetime.strptime and datetime.strftime to parse and format a datetime
field how you desire.

http://docs.python.org/library/datetime.html#strftime-strptime-behavior

Cheers

Tom

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



mysql tables - primary key

2012-03-13 Thread siva
We are going to convert our tools to django frame work

We have been converted our existing mysql database table to model.py
but we cant access one table properties

FYI : table is not having primary id what we have to do - remaining
tables are worked fine


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



inserting a date/time in "RFC 3339" format into django DateTimeField

2012-03-13 Thread Ahmad
I'm trying to insert date/time as I'm storing data retrieved from google 
calendar api about event start and end date.
here is the RFC link RFC 
3339

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



Django is very slow on windows server 2003, mssql database

2012-03-13 Thread Virginia
Good morning everyone,

I have a web site that was develop in django on a windows 2003 server
and a mssql database. Latetly it seems that the web site is going
slower and slower. We add datas but not that much to slow it down so
much. I run it on my dev environnement with cProfile and looking at
the stats (p.sort_stats('time').print_stats(10) I saw that the first
line is

ncalls   tottimepercallcumtimepercall
filename:lineno(function)
1  85.085 85.08585.085  85.085{nt.spawnve}

I would like to know what is this file and why is it taking so long.

Regards,
VB

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



Re: "Dynamyc" modells

2012-03-13 Thread Andre Terra
This is so not what Django was built to do...

I have a feeling that if you ever do manage to write it, it's going to be
slower than slow and error prone...


Sincerely,
AT


On Tue, Mar 13, 2012 at 4:59 AM, Ervin Hegedüs  wrote:

> hello,
>
> On Tue, Mar 13, 2012 at 09:38:34AM +0200, Jani Tiainen wrote:
>
> > Ultimate solution sounds more like using document oriented
> > databases, like CouchDB or MongoDB. (Just the few I happened to
> > remember).
>
> okay, lets look an another example: I have a model, which
> describes RDBMS connections: DBdesc, DBhost, DBuser, DBpassword,
> DBdbname, DBtable, DBkeycolumn, DBvalcolumn, and so on...
>
> Now I can filter() a row by DBdesc, which gives me de full
> description of DB connection - sometimes that DB exists on an
> external host. As I wrote my previous email, all data model in
> different data source have an intersect of columns, these columns
> are stored in my model.
>
> (Security is important, usually I used this through VPN's, and
> currently all stored connection has just select privilege - these
> are not sensitive datas of course.)
>
> After I get the DB desc, I use "row" SQL connection, eg. when DB
> is MySQL, I import the MySQLdb modul, create a mysql connection,
> a cursor...
>
> This is different from marketing agencies example, but I can use
> the "ultimate" solution at every cases.
>
>
> Thanks:
>
>
> a.
>
>
> --
> I � UTF-8
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

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



Re: How do I go to "/admin/" on my local domain?

2012-03-13 Thread Sandro Dutra
Probably you forget to launch the dev server.

python manage.py runserver

Only after this you can open your browser and go to admin, if it's
correctly configured on urls.py.

2012/3/13 Sumaiya 

> From Tutorial 2: "Now, open a Web browser and go to "/admin/" on your
> local domain -- e.g.,  http://127.0.0.1:8000/admin/. You should see
> the admin's login screen."
>
> I don't see that image. Rather, when I go to  http://127.0.0.1:8000/admin/
> in my Firefox browser, I get this message: "Unable to connect. Firefox
> can't establish a connection to the server at 127.0.0.1:8000."
>
> Am I going to the wrong address? How can I make this work?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

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



Re: ANN: Mezzanine 1.0 released

2012-03-13 Thread Ismail
Awesome project, in the process of migrating all my custom built CMS
solutions to Mezzanine. Never really found a CMS that was simple for the
user to understand, and allowed easy customization. So have always built
custom CMS/product catalogues for each client.  Re-using apps where
possible.



On Tue, Mar 6, 2012 at 1:41 AM, Thomas Woolford wrote:

> You should consider using Sentry Instead. This way you will get live
> feedback on errors, even ones that nobody reports.
>
> On Mar 4, 1:24 pm, Stephen McDonald  wrote:
> > Yes - behind the project homepage is the entire demo site where anyone
> > can log in and try it out. I've left debug on so that when people find
> > errors on it they can submit the traceback easily. It's been really
> > helpful on the few occasions it has happened.
> >
> > On Mar 4, 12:55 pm, arshaver  wrote:
> >
> >
> >
> >
> >
> >
> >
> > > Looks great. One thing... looks likehttp://mezzanine.jupo.org/is
> > > running with Debug = True (tryhttp://mezzanine.jupo.org/asdf). Maybe
> > > you're aware, just FYI.
> >
> > > On Mar 3, 3:51 pm, Stephen McDonald  wrote:
> >
> > > > Hi Djangonauts,
> >
> > > > I'm happy to announce the release of Mezzanine 1.0. Mezzanine is
> simple yet
> > > > powerful BSD licensed CMS for building Django powered sites.
> >
> > > > Development of Mezzanine and its sister project Cartridge (ecommerce
> for
> > > > Mezzanine) began over two years ago, born from frustrations with the
> only
> > > > options available at the time which were django-page-cms and
> Satchmo, and
> > > > from a decade's experience in building proprietary CMSes and
> ecommerce
> > > > solutions, prior to working with Django. Since then it has grown
> from real
> > > > world requirements at a fast paced web development agency in
> Australia, and
> > > > has received contributions from many dozens of developers on GitHub
> and
> > > > Bitbucket, with a wider community of hundreds on the mailing list.
> > > > Mezzanine and Cartridge have been used to power a long list of
> production
> > > > sites, from personal blogs and agency sites, to some of the highest
> traffic
> > > > content sites and ecommerce stores for some of the largest brands in
> > > > Australia.
> >
> > > > Here's an overview of Mezzanine's features:
> >
> > > > - Hierarchical navigation tree, with page nodes extendable by
> Mezzanine's
> > > > content type system. Content types are simply subclases of
> Mezzanine's Page
> > > > model - subclass away and your new type is available.
> > > > - Inline front-end site editing that can be applied to any models:
> > > > Mezzanine's, third party apps, or your own.
> > > > - Blogging app (regular Django app).
> > > > - Gallery app (a Mezzanine content type).
> > > > - Mobile device handling. Build separate mobile versions of
> templates where
> > > > required to run a mobile version of the site - no separate URLs or
> views
> > > > required.
> > > > - Form builder app (a Mezzanine content type). Admin users create
> their own
> > > > forms, and view form submissions via the admin, or export them via
> CSV.
> > > > - Mezzanine projects are standard Django projects - admin,
> urlpatterns,
> > > > views, models. Third party Django apps plug straight in without
> special
> > > > handling.
> > > > - Built-in search engine.
> > > > - South migrations.
> > > > - Admin editable settings.
> > > > - Full test suite, continuously integrated (with Travis CI) including
> > > > automated pep8/pyflakes integration. The code base is painstakingly
> clean.
> > > > - Fully documented, available on the Mezzanine project site as well
> as on
> > > > Read The Docs.
> > > > - Translated into around a dozen languages, managed via Transifex.
> > > > - Grappelli/Filebrowser based admin. Third party Django admin
> classes plug
> > > > straight in.
> > > > - Full featured ecommerce via Cartridge - a separate ecommerce app
> built
> > > > for Mezzanine.
> > > > - All functionality comes with default templates to get you started,
> > > > integrated with Bootstrap 2.0.
> > > > - Integrated with Django's sites app.
> > > > - A set of generic foreignkey types and models: tagging, threaded
> comments
> > > > and ratings. All denormalised with counts, averages, etc.
> >
> > > > To be honest, you could almost implement everything Mezzanine does by
> > > > combining dozens of different open source Django apps that are out
> there.
> > > > What you get from Mezzanine though, is everything integrated
> seamlessly out
> > > > of the box, leaving you free to focus on building your site.
> >
> > > > In conjunction with the Mezzanine 1.0 release, I've also released
> Cartridge
> > > > 0.4. As I mentioned, Cartridge provides a full ecommerce package for
> > > > Mezzanine. While Mezzanine is more of a framework for building sites
> with
> > > > any type of content you need to, Cartridge is much more opinionated
> in its
> > > > 

[Opportunity][Python] Young Passionate Technology Entrepreneurs

2012-03-13 Thread RiteshGanatra
Hi Folks,

We are looking for young passionate technology Entrepreneurs.

Wait, Let me make some definitions clear :

Young : Super Energetic and looking for opportunities
Passionate: The 100th monkey
Technology: Social Networking, Social Media, Tablets, Web Development,
Web Designing, Technical and/or creative Writing(Blogs, etc).
Entrepreneurs: Are Born and not Made;

OK, basics set, we are looking for such people (currently only
parttime, but if you are passionate enough full time shouldnt be an
issue), to help us convert a basic prototype into a reality. We have
an amazing feedback already from 100s of potential customers, our
advisors, etc.

We are currently a set of super passionate people, mostly part time
(people from NID, Amazon.com, and more) , in a 3 month investment
round. The investors are quite BIG (Sold 2 companies already, latest
for > 30M USD ).

Being in a stealth mode, I cannot reveal any details here.

We are currently looking for:
1) Kickass Python Web Developers
2) Passionate Web Designers.

Major Technologies/Domains we are looking at: Python Web development
(Django), AWS, Adaptive/Machine learning, Social Networking, E-
commerce(later in the game), Tablets, initially Android; and lastly,
ability to create great user experiences.

So if you are looking for an opportunity in a tech company with superb
potential, backed with the best technology people and advisors around
the world and a set of talented people who see the vision clearly then
drop me a mail with the reason you want to be a part of it, and also
mention your skills.

We would then set up a call/meeting, and discuss further.


Thanks,
Ritesh
+9970283454

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



How do I go to "/admin/" on my local domain?

2012-03-13 Thread Sumaiya
>From Tutorial 2: "Now, open a Web browser and go to "/admin/" on your
local domain -- e.g.,  http://127.0.0.1:8000/admin/. You should see
the admin's login screen."

I don't see that image. Rather, when I go to  http://127.0.0.1:8000/admin/
in my Firefox browser, I get this message: "Unable to connect. Firefox
can't establish a connection to the server at 127.0.0.1:8000."

Am I going to the wrong address? How can I make this work?

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



Re: "Dynamyc" modells

2012-03-13 Thread Ervin Hegedüs
hello,

On Tue, Mar 13, 2012 at 09:38:34AM +0200, Jani Tiainen wrote:
 
> Ultimate solution sounds more like using document oriented
> databases, like CouchDB or MongoDB. (Just the few I happened to
> remember).

okay, lets look an another example: I have a model, which
describes RDBMS connections: DBdesc, DBhost, DBuser, DBpassword,
DBdbname, DBtable, DBkeycolumn, DBvalcolumn, and so on...

Now I can filter() a row by DBdesc, which gives me de full
description of DB connection - sometimes that DB exists on an
external host. As I wrote my previous email, all data model in
different data source have an intersect of columns, these columns
are stored in my model.

(Security is important, usually I used this through VPN's, and
currently all stored connection has just select privilege - these
are not sensitive datas of course.)

After I get the DB desc, I use "row" SQL connection, eg. when DB
is MySQL, I import the MySQLdb modul, create a mysql connection,
a cursor...

This is different from marketing agencies example, but I can use
the "ultimate" solution at every cases.


Thanks:


a.


-- 
I � UTF-8

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



Re: "Dynamyc" modells

2012-03-13 Thread Ervin Hegedüs
hi,

On Mon, Mar 12, 2012 at 09:51:43PM -0400, Dennis Lee Bieber wrote:
> On Mon, 12 Mar 2012 22:14:27 +0100, Ervin Hegedüs 
> declaimed the following in gmane.comp.python.django.user:
> 
> 
> > Some promotion has few millions of records, different promotions have
> > different format of codes, ... And general: I'm looking for an ultimate
> > solution, and may be the next time every ListRecord will have different
> > columns.
> >
>   Strangely, your "ultimate solution" might mean implementing a DBMS
> AS the application, rather than just USING a DBMS...
> 
>   That is: maintaining a data dictionary which contains "promotion
> format", "promotion field", "field type", (maybe field position too,
> along with fields to identify constraints on the valid values);
[...]

yes, it's absolutely true.

But :), I'm so far from there I implement full of these.


It's no problem, I'm just looking for a good solution, first it
could be enough to implement all() method (and filter()), and
there is an important invariant: in my (all) cases, the different
ListItems has an intersect of columns, I mean there are a few
columns, which exists in all ListItems object.


Any idea?


Thanks:


a.


-- 
I � UTF-8

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



Re: "Dynamyc" modells

2012-03-13 Thread Jani Tiainen

13.3.2012 3:51, Dennis Lee Bieber kirjoitti:

On Mon, 12 Mar 2012 22:14:27 +0100, Ervin Hegedüs
declaimed the following in gmane.comp.python.django.user:



Some promotion has few millions of records, different promotions have
different format of codes, ... And general: I'm looking for an ultimate
solution, and may be the next time every ListRecord will have different
columns.


Strangely, your "ultimate solution" might mean implementing a DBMS
AS the application, rather than just USING a DBMS...


Ultimate solution sounds more like using document oriented databases, 
like CouchDB or MongoDB. (Just the few I happened to remember).



That is: maintaining a data dictionary which contains "promotion
format", "promotion field", "field type", (maybe field position too,
along with fields to identify constraints on the valid values); and a
related data table in which each record holds just ONE field, with a
foreign key referencing the specific "promotion format/field" pair along
with a field containing the "record ID" (since any actual record will
take more than one table entry). The data value itself is likely going
to be a BLOB [unless you are using SQLite where you can store anything
in a field], and you use the type information to determine how to
interpret the value.


That's doable but will be pain in the ass to maintain. Also performance 
is not that good since it wouldbe RDBMS on top of RDBMS.


Also all database CRUD operations would be handcrafted still. I would 
definitely look using those document oriented databases which would 
allow doing all that fancy stuff without too much sweat.


--

Jani Tiainen


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