Re: Pyjamas in Django

2011-11-07 Thread Kevin
Hi, I've created a few small "test" projects using it with Django. However, I felt that it makes the entire site feel more like an application, rather than a website. For a usability point, when a user visits a website, they would normally expect an experience like the last site they visited.

Re: CSRF failures for users that block all cookies. Is my planned solution stupid?

2011-11-07 Thread Kevin
Yes, this will open your site up to attack, as most bots never send cookies. Take a look at how the shell programs curl and wget function, both of them never send a cookie, unless the user specifically adds them. These ~5% of your userbase is most likely like myself, where I block all cookies and

Re: Serving up CSS files in development

2011-11-07 Thread Xavier Ordoquy
Hi, Where did you put your static files ? I noticed that your STATICFILES_DIRS is empty which means you don't have any static files on the project level. What the docs say about this: Your project will probably also have static assets that aren’t tied to a particular app. The STATICFILES_DIRS s

Re: bar charts

2011-11-07 Thread skysb...@gmail.com
On 2011?11?07? 21:26, Andre Terra wrote: Pass serialized json as a template variable? yes of course, pupulate data from django is not special, it's a normal process just like other language. we can output json to the chart That's what I'm doing atm. But JKM has built an app to help reduce the

Re: Serving up CSS files in development

2011-11-07 Thread Mike Dewhirst
Forgive top posting - I can't debug your code but I can show you what I do (an excerpt from my settings.py) to debug my own using print statements. I use PROJECT as the project name and PROJECT_ROOT to contain SRC_ROOT which contains settings.py ... MEDIA_ROOT = os.path.join(PROJECT_ROOT, 'ht

Re: Serving up CSS files in development

2011-11-07 Thread M. Herold
By the way, I'm trying to get this URI to work: http://mysite/static/css/style.css On Nov 7, 9:55 pm, "M. Herold" wrote: > This is driving me insane. I've done it what feels like 6 different > ways and for whatever reason, none of them appear to work. The worst > part is it's something so simple

Serving up CSS files in development

2011-11-07 Thread M. Herold
This is driving me insane. I've done it what feels like 6 different ways and for whatever reason, none of them appear to work. The worst part is it's something so simple: I want to link to a css file on my system. Why does this have to be so ridiculous before I get the project into production? Here

Re: Is there a standard way to implement the top level of my site?

2011-11-07 Thread M. Herold
Awesome, that was exactly what I wanted. What confuses me is that I'm not on an old version on Django, but this is the method which works... if I check the version number, it's 1.3.1 if my memory serves. Thanks baxter! On Nov 7, 5:28 pm, "bax...@gretschpages.com" wrote: > On Nov 7, 4:51 pm, "M.

Re: How to

2011-11-07 Thread Songhun Kim
Hi. Oh. Okay. Thanks you!!! I'll check again setting of MySQL and AWS. Maybe It's a problem of setting of MySQL. Because update is worked well, just insert has a problem. Thanks. Songhun -- You received this message because you are subscribed to the Google Groups "Django users" group. To view

Re: How to

2011-11-07 Thread Russell Keith-Magee
On Tue, Nov 8, 2011 at 10:02 AM, Songhun Kim wrote: > Hi. every one. > I'm a beginner in django. > I wrote a code for insert to mysql. > ex) > model_for_test = ModelTest(column01=postvalue1, column02=postvalue2...) > model_for_test.save() > This code made a query have no quotes like "insert ... va

models.FileField versus forms.FileField

2011-11-07 Thread Eli_West
Hello, When creating a working with the models and views to upload files what is the difference between models.FileField and forms.FileField? Just a practical usage explanation would be good at this point. i can't find any comparison of the two but django directions and examples use one or the ot

How to

2011-11-07 Thread Songhun Kim
Hi. every one. I'm a beginner in django. I wrote a code for insert to mysql. ex) model_for_test = ModelTest(column01=postvalue1, column02=postvalue2...) model_for_test.save() This code made a query have no quotes like "insert ... values ( aaa, bbb ... );". So a mysql returns error. Interested th

Re: bar charts

2011-11-07 Thread kenneth gonsalves
On Mon, 2011-11-07 at 11:26 -0200, Andre Terra wrote: > Pass serialized json as a template variable? > > got it to work. I had passed the json, but had to turn autoescape off to get it to work. -- regards Kenneth Gonsalves -- You received this message because you are subscribed to the Google

ZeroMQ / Mongrel2

2011-11-07 Thread Markus Gattol
Maybe sombody has given http://code.google.com/p/django-dmq and Mongrel2 a spin already and can report how it went? The reason I am interested is because it would allow me to get rid of WSGI altogether and have this stack (ZeroMQ being directly Mongrel2 for example):

Re: Disable debugging for all, but allow debug toolbar for one host

2011-11-07 Thread Gelonida N
On 11/07/2011 12:49 PM, Tom Evans wrote: > On Sun, Nov 6, 2011 at 12:30 AM, Gelonida N wrote: >> Hi, >> >> If I understood well, then the Django debug toolbar is only working if >> debugging is enabled. >> >> What I wanted to do is is to disable the explicit django error messages >> for all but on

Re: Is there a standard way to implement the top level of my site?

2011-11-07 Thread bax...@gretschpages.com
On Nov 7, 4:51 pm, "M. Herold" wrote: > That last, simple implementation is probably what I'm really looking > for at this point. My only problem is I'm not sure where that line of > code should live or where that template is expected (the template > directory set in my settings.py, I imagine).

Re: Is there a standard way to implement the top level of my site?

2011-11-07 Thread M. Herold
That last, simple implementation is probably what I'm really looking for at this point. My only problem is I'm not sure where that line of code should live or where that template is expected (the template directory set in my settings.py, I imagine). I tried implementing it in urls.py, but it has so

Haystack and date facets, anyone knows how it works?

2011-11-07 Thread Andre Lopes
Hi, I'm trying to do a date facet with Haystack using Solr. The thing is that I have no clue on how to use the results that I get from Haystack and how to put this results in a Django template. I have made a post in stackoverflow, but until now I have no clues on how to achieve this. Can you guys

Re: admindocs app - almost, but not, working

2011-11-07 Thread Kurtis Mullins
Hmm, I just tried it and it seems to work fine for me. I'm not sure on the directions -- as I just uncommented the stuff in my code and installed docutils. Maybe the dev docs are not in sync with the version of django you are running? On Mon, Nov 7, 2011 at 5:31 PM, Brett Epps wrote: > If this i

Re: admindocs app - almost, but not, working

2011-11-07 Thread Brett Epps
If this is a bug in Django, you should file a Trac ticket for it here: https://code.djangoproject.com/newticket Brett On 11/7/11 3:40 PM, "lorin" wrote: >In case anybody else cares, there seems to be a mismatch between the >template and the urls for the admindocs module. I solved this problem

Re: firstof as

2011-11-07 Thread Brett Epps
Instead of adding a template tag, you could handle this in the class for obj. Just have get_votes() cache its result and use the cached value after the first time get_votes() is called. In the template, always call get_votes(). Brett On 11/7/11 4:12 PM, "Nikolas Stevenson-Molnar" wrote: >Ah,

Re: firstof as

2011-11-07 Thread Nikolas Stevenson-Molnar
Ah, ok; I see what you want to do. I'm not aware of any way to do this, other than as you mentioned a custom template tag. On 11/7/2011 2:04 PM, bax...@gretschpages.com wrote: > > On Nov 7, 3:50 pm, Nikolas Stevenson-Molnar > wrote: >> Assuming obj is iterable, you can do: {% with >> obj.0.thingo

Re: firstof as

2011-11-07 Thread bax...@gretschpages.com
On Nov 7, 3:50 pm, Nikolas Stevenson-Molnar wrote: > Assuming obj is iterable, you can do: {% with > obj.0.thingobj.get_something as thing %} > > ...is that what you mean? Not exactly, no. In my particular case, it's more of a check to see if it's available, and if not, do a bit more work to ge

Re: firstof as

2011-11-07 Thread Nikolas Stevenson-Molnar
Assuming obj is iterable, you can do: {% with obj.0.thingobj.get_something as thing %} ...is that what you mean? _Nik On 11/7/2011 11:57 AM, bax...@gretschpages.com wrote: > What I'm after is something like {% with firstof obj.thing > obj.get_something as thing %} > > Is there any way to do this

Re: admindocs app - almost, but not, working

2011-11-07 Thread lorin
In case anybody else cares, there seems to be a mismatch between the template and the urls for the admindocs module. I solved this problem by editing the file django/contrib/admindocs/templates/admin_doc/ index.html and changing each of the links. Models should go to docmodels, Views to docviews, e

Postgres paginator fixing slow count(*)

2011-11-07 Thread Alec
I've seen many posts about how slow PostgreSQL is when doing count(*) and how this gets called in the admin all the time, so I thought I'd share a simple paginator class override to use the RELTUPLES statistic when the query is not filtered. This should speed up the loading of the default admin pa

Re: bar charts

2011-11-07 Thread bax...@gretschpages.com
Most times I just use css and percentwidth for simple bar charts. On Nov 7, 10:23 am, Leotis buchanan wrote: > You could also try processing.js > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-use

Re: Is there a standard way to implement the top level of my site?

2011-11-07 Thread bax...@gretschpages.com
I've had per-project views (in the project root), I've had apps feeding indexes, and I've gone direct to template using template tags to fill in snippets needed. Most times -- but not always -- the last approach seems the most flexible and easiest. On Nov 7, 1:19 pm, Kurtis Mullins wrote: > I'm

firstof as

2011-11-07 Thread bax...@gretschpages.com
What I'm after is something like {% with firstof obj.thing obj.get_something as thing %} Is there any way to do this short of writing my own template tag and figuring out which exists first? Seems like it would be a fairly common need. -- You received this message because you are subscribed to t

Re: Pyjamas in Django

2011-11-07 Thread Juergen Schackmann
hi, i have played around with it, and it seemed ok for me. but actually never put anything into production, since my project did not move forward. regards -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit

Re: Is there a standard way to implement the top level of my site?

2011-11-07 Thread Kurtis Mullins
I'm not exactly clear on the question, but I'll share with you what I've done on my site. For pages like the "Home Page", I've created an application called "core". Then I just call my .core.views.HomePageView.as_view() from the "urls.py" file under my main project directory. The regular expressio

Is there a standard way to implement the top level of my site?

2011-11-07 Thread M. Herold
I've developed a number of apps and stuck them into my django framework, but in looking to create a hub at the index of my site (among other standard pages; e.g. about, network, etc.), I've sort of gotten stuck. Do I really want to create another app and just redirect from my index, having a sort o

Re: FAQ app 2011

2011-11-07 Thread Mike
Thanks for your help. My requirements are simple, but I'd like something well done without headaches. I'll try the fack fork. ;) -- 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.co

Re: render_to_response pointing to multiple templates

2011-11-07 Thread Joey Espinosa
Jay, How are you making the choice for a template? User interaction, specific runtime circumstance, random, etc? -- Joey "JoeLinux" Espinosa* * On Mon, Nov 7, 2011 at 12:04 PM, Tom Evans wrote: > On M

Re: Multiple sessions per user?

2011-11-07 Thread Nan
OK, right now I'm looking at replacing SessionMiddleware with a subclass that will take a dict with multiple session cookie names and timeout values, and set both the traditional request.session from the default values from settings (so as not to mess up third-party apps that depend on it) and a c

Re: render_to_response pointing to multiple templates

2011-11-07 Thread Tom Evans
On Mon, Nov 7, 2011 at 3:59 PM, jay K. wrote: > hi, Tom > > thanks for the reply > > what I actually want to do is to > list several templates in the render_to_response > function and be able to choose which one to use > > can I choose which template to use? > > thanks again, and let me know if my

Re: Relation not found error while dealing with foreign keys and forms

2011-11-07 Thread Furbee
I guess the form object is not holding the nics_group object, in this case, you could send the group information (all groups in one array or other object, and the selected group in another variable) back to the template as a separate object. However, the suggested paradigm is using Database Routers

Re: bar charts

2011-11-07 Thread Leotis buchanan
You could also try processing.js Regards Leotis Buchanan Co-Founder Exterbox On Mon, Nov 7, 2011 at 9:22 AM, Yok Keen Hui wrote: > You could try out cairoplot, it works for me in Django, just have to print > the render as a picture to a url and reference it from there(looks nice > too!) > >

Re: Project general design question - "From scratch" or use of admin interface

2011-11-07 Thread Andre Terra
django-registration [1], quite possibly with a custom backend. Cheers, AT [1] https://github.com/nathanborror/django-registration On Mon, Nov 7, 2011 at 11:50 AM, youpsla wrote: > Ok, > thanks for the answer,then I'll start this way. > > Just another question. I'll use a registration package

Re: render_to_response pointing to multiple templates

2011-11-07 Thread jay K.
hi, Tom thanks for the reply what I actually want to do is to list several templates in the render_to_response function and be able to choose which one to use can I choose which template to use? thanks again, and let me know if my question is clear enough On Mon, Nov 7, 2011 at 12:18 PM, Tom E

Re: "Key 'Content-Type' not found in Form"

2011-11-07 Thread bentzy
Thanks Tom, Solved. The issue was not at view code, but at urls.py The urlpattern pointed to the model instead to the view. That's learning django the hard way... Cheers --bentzy On Nov 7, 2:53 pm, Tom Evans wrote: > On Mon, Nov 7, 2011 at 11:07 AM, bentzy wrote: > > Hello, > > > I have a pag

Re: FAQ app 2011

2011-11-07 Thread Peter Herndon
Hi Mike, revsys/django-fack is a reasonably recent fork of howiworkdaily/django-faq, with some subsequent divergence between the two code bases on both sides. Both projects' primary developers are well-respected members of the Django community. In fact, the primary developer of revsys/django-fa

Re: render_to_response pointing to multiple templates

2011-11-07 Thread Tom Evans
On Mon, Nov 7, 2011 at 3:09 PM, jay K. wrote: > > Hello > > I have a view with the following render_to_template function > > ... > > return render_to_response( 'template/template.html', {var'': var}, > context_instance=RequestContext(request)) > ... > > I want the render_to_response to point to mo

Re: bar charts

2011-11-07 Thread Brad Montgomery
+1 for Google Charts. For small stuff (1 chart), I just render JavaScript in the of my html templates. For more complex stuff, you could write a view that *just* renders JavaScript and include it via a script tag. Just make sure to serve it with MIME type "application/javascript" Here's mor

render_to_response pointing to multiple templates

2011-11-07 Thread jay K.
Hello I have a view with the following render_to_template function ... return render_to_response( 'template/template.html', {var'': var}, context_instance=RequestContext(request)) ... I want the render_to_response to point to more than 1 template. So far I've tried adding a dictionary of templ

one view for multiple templates

2011-11-07 Thread jay K.
Hello, I have a page with a form on it the form is handled by a view I want to create another page and embed the same form on it how can I use the same view on another template? do I have to modify the 'render_to_response' so it points to the other template (besides the current template)? tha

Re: bar charts

2011-11-07 Thread Yok Keen Hui
You could try out cairoplot, it works for me in Django, just have to print the render as a picture to a url and reference it from there(looks nice too!) On Tue, Nov 8, 2011 at 12:26 AM, Andre Terra wrote: > Pass serialized json as a template variable? > > That's what I'm doing atm. But JKM has b

Re: Project general design question - "From scratch" or use of admin interface

2011-11-07 Thread youpsla
Ok, thanks for the answer,then I'll start this way. Just another question. I'll use a registration package I think for Shops owners, do you know wich one could be the best for jsut a simple registration workflow ? Agian, thnaks for your time Regards Alain On 7 nov, 13:32, Russell Keith-Magee

Re: bar charts

2011-11-07 Thread Andre Terra
Pass serialized json as a template variable? That's what I'm doing atm. But JKM has built an app to help reduce the need to write javascript [1]. I haven't used it myself, but it looks interesting and promising. Cheers, AT [1] https://github.com/jacobian/django-googlecharts On Mon, Nov 7, 201

Re: "Key 'Content-Type' not found in Form"

2011-11-07 Thread Tom Evans
On Mon, Nov 7, 2011 at 11:07 AM, bentzy wrote: > Hello, > > I have a page displaying a list of "Data" objects and I placed at the > same page a "submit" button opening a form that updates the "Data" > table at DB. Pretty simple. > > class Thing(models.Model): >    thing_id = models.BigIntegerField

Re: Project general design question - "From scratch" or use of admin interface

2011-11-07 Thread Russell Keith-Magee
On Mon, Nov 7, 2011 at 8:06 PM, youpsla wrote: > Hi, > before getting more in depth in writing my project I ask you a general > design question. My Django knowledge is not BIG enough for me to be > able to have a clear answer (with for and cons) on my question. > > Here are the main guidelines of

Re: bar charts

2011-11-07 Thread Tim Sawyer
Flot. http://code.google.com/p/flot/ My docs about what I did: http://drumcoder.co.uk/tags/flot/ Example (including zooming by slider): http://brassbandresults.co.uk/bands/rothwell-temperance-band/ Enjoy, Tim. > hi, > > what do people use to display bar charts in their sites? > -- > regards >

Project general design question - "From scratch" or use of admin interface

2011-11-07 Thread youpsla
Hi, before getting more in depth in writing my project I ask you a general design question. My Django knowledge is not BIG enough for me to be able to have a clear answer (with for and cons) on my question. Here are the main guidelines of my project : - I've two kind of users : Shop owners and con

Re: Disable debugging for all, but allow debug toolbar for one host

2011-11-07 Thread Tom Evans
On Sun, Nov 6, 2011 at 12:30 AM, Gelonida N wrote: > Hi, > > If I understood well, then the Django debug toolbar is only working if > debugging is enabled. > > What I wanted to do is is to disable the explicit django error messages > for all but one specific IP address and to disable the django de

Re: bar charts

2011-11-07 Thread kenneth gonsalves
On Mon, 2011-11-07 at 19:36 +0800, skysb...@gmail.com wrote: > On 2011年11月07日 18:16, kenneth gonsalves wrote: > > On Mon, 2011-11-07 at 04:28 -0500, Joey Espinosa wrote: > >> Here's the Quick Start page: http://goo.gl/g5I7X > > that is easy - how does one populate with data from django? > do you kn

Re: bar charts

2011-11-07 Thread skysb...@gmail.com
On 2011年11月07日 18:16, kenneth gonsalves wrote: On Mon, 2011-11-07 at 04:28 -0500, Joey Espinosa wrote: Here's the Quick Start page: http://goo.gl/g5I7X that is easy - how does one populate with data from django? do you know how to populate with data with other develop language?? -- You receiv

"Key 'Content-Type' not found in Form"

2011-11-07 Thread bentzy
Hello, I have a page displaying a list of "Data" objects and I placed at the same page a "submit" button opening a form that updates the "Data" table at DB. Pretty simple. class Thing(models.Model): thing_id = models.BigIntegerField(primary_key=True) etc... class Data(models.Model):

Re: bar charts

2011-11-07 Thread kenneth gonsalves
On Mon, 2011-11-07 at 04:28 -0500, Joey Espinosa wrote: > Here's the Quick Start page: http://goo.gl/g5I7X that is easy - how does one populate with data from django? -- regards Kenneth Gonsalves -- You received this message because you are subscribed to the Google Groups "Django users" group.

"Premature end of script headers" and {% url %} template tag

2011-11-07 Thread beh
Hi! I have a problem. Apache returns 500 error like this [Mon Nov 07 11:34:37 2011] [error] [client 123.123.123.123] Premature end of script headers: django.wsgi I create simple view for tests on server. @render_to('dummy.html') def test_permature(request): return {} dummy.html is empty by de

Re: bar charts

2011-11-07 Thread Joey Espinosa
Kenneth, It's a Google API. Like other Google tools, you can connect using google.load() within JavaScript code. It wouldn't integrate directly with Django, but rather through your templates by using JavaScript. -- Joey "JoeLinux" Espinosa* *

CSRF failures for users that block all cookies. Is my planned solution stupid?

2011-11-07 Thread Benjamin Wohlwend
Hi, I have recently updated a fairly high-traffic website from Django 1.0 to 1.3. I added the csrf token to every form on the website, but nevertheless we regularly hear back from users that get the dreaded 403 error on form submits. I added some logging to the csrf error view (thanks Sentry to

Re: bar charts

2011-11-07 Thread skysb...@gmail.com
On 2011年11月07日 12:57, kenneth gonsalves wrote: hi, what do people use to display bar charts in their sites? a lot choices, like html5 chart, flash chart. amchart,zingchart, i'm trying to use zingchart in my site now, it provide both flash and html5 solution. -- You received this message bec