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 us

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 it

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 para

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 corre

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

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

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 for

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):

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 a

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.

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 i

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 fi

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" E

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 ne

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 refre

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 wr

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 cann

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

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 sh

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

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

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 shou

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

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

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 complet

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

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 the

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 beg

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

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

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 ob

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

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 mo

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'], 'filter

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 th

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

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

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://

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 tha

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

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

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

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

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 subscri

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 definit

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 definit

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

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/

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 n

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

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 mainti

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?

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

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?

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

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

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 ms

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 dateti

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 yo

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

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 th

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

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:/

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

[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 an

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 con

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:

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

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