Re: Is there an HTML editor that's Django-aware

2011-05-20 Thread Brian Bouterse
st 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. > > -- Brian Bouterse ITng

Re: How do you organize your deployment enviroment

2011-05-23 Thread Brian Bouterse
I use fabric and chef together. Usually fabric bootstraps my chef environment, and then chef takes over. I also don't use cron anymore, but instead use celery <http://celeryproject.org/>. Best, Brian On Mon, May 23, 2011 at 7:50 AM, DK wrote: > What is your optimal filesystem

Dynamic template loader with TemplateResponse

2011-05-23 Thread Brian Morton
I have some legacy code that I used to dynamically load a template based on url if it exists and render a 404 if it doesn't exist. def content(request, template_name='index'): try: return direct_to_template(request, '%s.html' % template_name) except TemplateDoesNotExist: r

Re: Example uses of Celery

2011-05-23 Thread Brian Bouterse
There is also really excellent integration with celery through the django-celery project. Brian On Mon, May 23, 2011 at 9:49 PM, br wrote: > I understand a lot of production systems use celery and/or cron to > automate task queues and/or scheduling. I am just getting involved in > a

Re: Experiences with virtualenv + Django?

2011-05-24 Thread Brian Bouterse
rebuild it. Don't be like me and break your system by not using virtualenv. Brian On Tue, May 24, 2011 at 9:42 AM, Shawn Milochik wrote: > 1. You can compile Python 2.6 (or 2.7) in your home directory and use that > to create your virtualenvs. > > 2. I do 100% of my Python wor

Re: Parsing an XML feed using ElementTree

2011-05-24 Thread Brian Bouterse
+1 for xpath I also like using xml.dom.minidom<http://docs.python.org/library/xml.dom.minidom.html>since it is so simple and straightforward. If you XML is poorly formed go with beautiful soup<http://www.crummy.com/software/BeautifulSoup/> . Brian 2011/5/24 Тимур Зарипов

Re: Parsing an XML feed using ElementTree

2011-05-24 Thread Brian Bouterse
We all have our opinions. Either way this conversation is OT from Django. On Tue, May 24, 2011 at 4:07 PM, Masklinn wrote: > On 2011-05-24, at 21:57 , Brian Bouterse wrote: > > +1 for xpath > > > > I also like using > > xml.dom.minidom<http://docs.python.or

Re: Overridden Admin Template Not Recognized

2011-05-27 Thread Brian Bouterse
You'll need make sure that "django.template.loaders.filesystem.Loader" is enabled in your TEMPLATE LOADERS to use the app in the way you want. Also, you'll need to place your app BEFORE the 'django.contrib.admin' application in the INSTALLED_APPS list. Hope thi

Re: Looking for Class Base Views intro (not Generic Class Base Views!)

2011-05-27 Thread Brian Bouterse
behavior and interfaces just like Django already has, which is silly when you can just subclass the generic 'View' function. 3. So class based views tend to always inherit from some generic django view ... django.views.generic.base.View at the very least. Hope this is helpful, Brian On Thu, M

Re: Dynamic template loader with TemplateResponse

2011-05-29 Thread Brian Morton
return super(ContentView, self).render_to_response(context, **response_kwargs) On May 23, 3:01 pm, Brian Morton wrote: > I have some legacy code that I used to dynamically load a template based on > url if it exists and render a 404 if it doesn't exist. > > def content(request, t

Re: Question about using imports within functions/methods

2011-06-02 Thread Brian Bouterse
/zone/import-confusion.htm>on how import works in python. Brian On Thu, Jun 2, 2011 at 10:39 AM, Cal Leeming [Simplicity Media Ltd] < cal.leem...@simplicitymedialtd.co.uk> wrote: > Hey guys, > > This is more of a python question, than a Django specific one, but it's >

Re: Email Accounts

2011-06-10 Thread Brian Bouterse
This conversation is off topic, and should not be facilitated through the Django users mailing list. There are sites setup for these kinds of things<http://www.freelancer.com/> . Brian On Fri, Jun 10, 2011 at 11:09 AM, Cal Leeming [Simplicity Media Ltd] < cal.leem...@simplicitymedia

overriding widget for "group" in User model

2011-06-16 Thread Brian Craft
Is there an easy way to get checkboxes for groups in the User admin, rather than a multiselect? -- 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, s

Re: Easiest way to limit email warnings?

2011-06-19 Thread Brian Bouterse
+1 for django-sentry. I use it on even the smallest sites and it works great there too. Brian On Sun, Jun 19, 2011 at 9:17 AM, graeme wrote: > What is the simplest way of preventing the flood of emails that > results from a site wide error? I do not want to end up with 10,000 > email

Re: Possible interest in a webcast/presentation about Django site with 40mil+ rows of data??

2011-06-22 Thread Brian Bouterse
web visit > https://groups.google.com/d/msg/django-users/-/SZabiWnq_S0J. > > 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

Re: How to use the django-users mailing list properly and doing your homework..

2011-07-01 Thread Brian Bouterse
) so html syntaxing won't always work either. pastebin.com does have the option to retain snippets forever as an alternative to dpaste.com which deleted them eventually. Brian On Fri, Jul 1, 2011 at 5:58 AM, Russell Keith-Magee wrote: > On Friday, July 1, 2011, Herman Schistad > wrote

ListView.get_context_data Exception

2011-07-01 Thread Brian Bouterse
et_context_data twice, yet when it is called from within my post function it fails strangely. I know what I'm doing is kind-of strange, but it should work right? Enlighten me... Thanks, Brian -- Brian Bouterse ITng Services -- You received this message because you are subscribed to the Go

Re: Some thoughts on a package/stack compile system for easy distribution of webapps..

2011-07-06 Thread Brian Bouterse
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 opti

Re: Some thoughts on a package/stack compile system for easy distribution of webapps..

2011-07-06 Thread Brian Bouterse
I write a lot of automation on RHEL / CentOS systems and would like to see the built process to look at potentially porting it. Let me know how I can follow the development. Brian On Wed, Jul 6, 2011 at 3:29 PM, Cal Leeming [Simplicity Media Ltd] < cal.leem...@simplicitymedialtd.co.uk>

Re: anybody using PhoneGap with Django

2011-07-08 Thread Brian Bouterse
sage 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

Re: Some thoughts on a package/stack compile system for easy distribution of webapps..

2011-07-08 Thread Brian Bouterse
it that way. What still needs to be figured out is how to get pypy reading the nginx and gunicorn C code natively and then switching over and using JIT compilation on the python code from the gunicorn->django entry point. I would love to hear what others think about this type of thinking

Re: Some thoughts on a package/stack compile system for easy distribution of webapps..

2011-07-08 Thread Brian Bouterse
o serve as the reference python interpreter. I was talking with the pypy authors at pycon this past spring and they anecdotally that django and pypy are being used in production on some sites. The folks in the pypy community could probably comment more on this than I could. Brian On Fri, Jul 8,

Re: throttling login attempts to avoid brute force attacks

2011-07-09 Thread Brian Neal
On Jul 8, 11:03 am, Shawn Milochik wrote: > This topic came up on the list a few months back, and I just wanted to > share the solution I've put into place. > > Short version: > > 1. Ensure that my Web server (nginx) passes the user's real IP address > in the request. > > 2. For POST requests to t

Re: (UsingTheMailingList) Pre-requisites for newcomers on Django

2011-07-10 Thread Brian Bouterse
a win for everyone (django, python, open source, ...). My personal heuristic on what is off topic on django-users for python specific questions is this: if the question is python only, if it is ultimately going to be used in a django project, then I consider that on topic. Brian On Sun, Jul 10

Adding errors to form after successful validation

2011-07-11 Thread Brian McKeever
I have a search form that is used by a view to search for results and then redirect to display them one at a time. If my search doesn't find any objects matching the criteria, I'd like to display a message saying so. It seems natural to add this error to the search form and redisplay it since it a

Re: Adding errors to form after successful validation

2011-07-11 Thread Brian McKeever
ng forms can be a PITA... Try reading through this > last bit of the form validation docs: > > https://docs.djangoproject.com/en/dev/ref/forms/validation/#cleaning-... > > Cheers, > André Terra > > > > > > > > On Mon, Jul 11, 2011 at 6:02 PM, Brian McKeever

Re: Include Django form in PHP based website

2011-07-27 Thread Brian Bouterse
iframe. This minimizes the look and feel consistence since most every page is loaded from PHP. Brian On Wed, Jul 27, 2011 at 9:34 AM, brian wrote: > I'm learning Django and was hoping to get some advice on an > application I want to try. > > I'm trying to create a Django form

Re: how to create a hidden field

2011-08-02 Thread Brian Neal
On Aug 2, 3:14 pm, webcomm wrote: > ... > Non-interactively, in the automatic admin, what I get is a visible > text input below the title field and above the summary field.  Here's > the relevant model and modelform:http://pastebin.com/azKgdraw > > -Ryan Oh...you are trying to do this in the *adm

Re: spam in response to posting to this list

2011-08-10 Thread Brian Bouterse
and it really does not help at all if we > all just start posting "+1" mails. > > Michal > -- Brian Bouterse ITng Services -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email t

Re: Displaying results in Template in a Table ? What is the proper way ?Any app?

2011-08-10 Thread Brian Bouterse
I know it's not Django specific, but when I need a table for my Django projects, I use jQuery Datatable <http://www.datatables.net/>. It rocks! Brian On Wed, Aug 10, 2011 at 5:26 PM, Adam Zedan wrote: > Or in other words a good datagrid to use with Djano...What do u > peop

Re: Defunct Processes on Server

2011-08-12 Thread Brian Bouterse
legroups.com. > To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com < django-users%2bunsubscr...@googlegroups.com>. > For more options, visit this group at http://groups.google.com/group/django-users?hl=en. > -- Brian Bouterse ITng Services -- You re

Re: __init__.py file executed twice ?

2010-12-14 Thread Brian Bouterse
Why do things get started twice in django sometimes? I see the framework being started twice here. Also if you overload the __init__(self): of models, that too gets called twice. I've never understood this, but the singleton pattern seems to provide a nice workaround. Brian On Mon, D

wsgi.file_wrapper failing silently

2010-12-17 Thread Brian Craft
I'm testing the patch for ticket 2131 (http://code.djangoproject.com/ticket/2131) on 1.2.3. I'm getting back a 500 (internal server error) sometime after returning the HttpResponseSendFile(), with nothing in the apache error log. Any suggestions on how to debug this? -- You received this message

Calling a Method from a Form

2010-12-22 Thread Brian Callies
database data? Would a static HTML page work better? Ah-ha! I see I should use Flatpages, most likely. But, I'm not sure that solves my problem since it would still use templates and would still have to call a method. Thanks, and hope this wasn't too rambling, Brian -- You received

Re: Django Debug Toolbar -- getting 404s for javascript file when using request.GET in SHOW_TOOLBAR_CALLBACK

2010-12-22 Thread Brian S
Thanks to kr who answered this offline. Some static files in the debug_toolbar need to be modified to include the ?debug arg. I put his suggestions into the attached patch file. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

Re: Replace URLResolver?

2010-12-28 Thread Brian Bouterse
x already do so well (and in a more optimized way). my 2 cents, Brian On Tue, Dec 28, 2010 at 6:43 AM, Martin wrote: > Hi. > > I would like to use subdomains in my URL-dispatch. Thats not supported > by Django. > > Is it possible to replace Django URLResolver with my own? Must thi

Re: Django dev server issue

2011-01-03 Thread Brian Bouterse
Have you tried using pdb to debug the call as it arrives? You could step through the code, line by line that way to see what is hanging. My 2 cents, Brian On Mon, Jan 3, 2011 at 4:26 PM, daniels wrote: > I just tested with sock Python 2.6.6 from the link you gave me and > also trie

Re: Django dev server issue

2011-01-04 Thread Brian Bouterse
It sounds like it wasn't able to be reproduced with pdb. I think that should be looked into further. Brian On Tue, Jan 4, 2011 at 6:57 AM, daniels wrote: > Ok, so i used pdb and did a line by line pass, but i didn't get anything. > All data seems to be normal. I even edited s

Re: Can I add custom field to ModelForm?

2011-01-08 Thread Brian Neal
On Jan 7, 8:55 am, robos85 wrote: > Is it possible to add field (I want it to be visible in generated form and > after post) to form which is not included in Model? I need it to make a > check after form.is_valid(), but this field won't go to DB. > > If yes - how can I do that? It is possible. Go

calling django auth from apache RewriteMap

2011-01-12 Thread Brian Craft
I'm interested in using RewriteMap (from mod_rewrite) to check for a django user session. That is, RewriteMap would invoke some script which would return session info, which could be used by mod_rewrite to allow or deny access. Basically, this would require writing a standalone python script that r

Group methods

2011-01-13 Thread Brian Craft
Are there docs somewhere for the Group methods? E.g., I discovered through extensive googling that I can call user.groups.all(), but I can't find docs of an "all()" method, or any other method for Groups. If there aren't docs, how does one discover the methods? -- You received this message becaus

Re: forms, hidden fields

2011-01-18 Thread Brian Neal
On Jan 18, 8:32 am, niall-oc wrote: > ... > There is a simple form.  My question is how do you set a field to be > hidden. > > http://docs.djangoproject.com/en/1.1/topics/forms/#looping-over-the-f... > > This document explains how you may check if a field is hidden, however > there seems to be no

Confusion about the new staticfiles contrib app

2011-01-25 Thread Brian Neal
Hi - I'm trying to cut over my project to use the new staticfiles application. I'm using the dev server with DEBUG = True on a recent SVN trunk checkout. My STATIC_URL is '/static/' and my MEDIA_URL is 'http://localhost:8000/media/' in this environment. My first confusion point: Maybe it was just

Re: Restrict access to the whole application

2011-01-26 Thread Brian Bouterse
art of a django based connection broker <https://github.com/bmbouter/vdi> that manages cloud virtual machines to provide applications to users. Best, Brian On Wed, Jan 26, 2011 at 2:11 AM, tobik wrote: > My first question is whether it is possible to restrict access to the > whole applicat

Re: Confusion about the new staticfiles contrib app

2011-01-26 Thread Brian Neal
On Jan 26, 1:46 am, Jonas Geiregat wrote: > Op 26-jan-2011, om 06:46 heeft Brian Neal het volgende geschreven: > > > Hi - > > I'm trying to cut over my project to use the new staticfiles > > application. I'm using the dev server with DEBUG = True on a recent >

Re: Restrict access to the whole application

2011-01-26 Thread Brian Bouterse
cking. You could use this same scheme to limit access to installed django application I could imagine. Brian On Wed, Jan 26, 2011 at 9:39 AM, tobik wrote: > Thank you for your answer. It is to much information for me and I am > not sure whether I understand it correctly :) > > So basic

Re: Confusion about the new staticfiles contrib app

2011-01-26 Thread Brian Neal
On Jan 26, 8:46 am, Jonas Geiregat wrote: > > MEDIA_ROOT is the path to the directory where your files will live. > > MEDIA_URL is the URL the get to those files. > > So if MEDIA_ROOT='/home/you/media' > and MEDIA_URL='site-media/' > > Then if you want to view a file located at /home/you/media/thi

Re: Confusion about the new staticfiles contrib app

2011-01-26 Thread Brian Neal
I can answer one of my own questions now: On Jan 25, 11:46 pm, Brian Neal wrote: ... > My second confusion point: > I am running the dev server with -Wall and I am seeing warnings: > PendingDeprecationWarning: The view at `django.views.static.serve` is > deprecated;

standalone session checking

2011-01-28 Thread Brian Craft
I'm trying to implement a stand-alone python script to check a session cookie for group authorization. I cribbed from the auth and session middleware, so I could take the sessionid from the cookie, look up the session, look up the user, and get the list of groups. This all basically works, except

caching of Models (not the cache middleware)

2011-01-28 Thread Brian Craft
Digging into the problem I'm having with a standalone django script, the problem seems to be that django doesn't see updates to the database unless it writes to the database. In the following lines, ss = engine.SessionStore(session_id) session=ss.load() If session_id "abcd" has been added t

Re: caching of Models (not the cache middleware)

2011-01-28 Thread Brian Craft
n? On Fri, Jan 28, 2011 at 6:51 PM, Karen Tracey wrote: > On Fri, Jan 28, 2011 at 9:45 PM, Brian Craft > wrote: >> >> Digging into the problem I'm having with a standalone django script, >> the problem seems to be that django doesn't see updates to the >>

newbie question about paths

2011-01-29 Thread Brian Craft
Suppose the project is /var/www/django/project. Following the django with wsgi docs, you would add /var/www/django to the path, and DJANGO_SETTINGS_MODULE would be project.settings. However, in that case, the path scheme described in the tutorial doesn't work, e.g. setting up admin.py for Polls as

Re: caching of Models (not the cache middleware)

2011-01-31 Thread Brian Craft
explicitly commit after every select. On Fri, Jan 28, 2011 at 6:51 PM, Karen Tracey wrote: > On Fri, Jan 28, 2011 at 9:45 PM, Brian Craft > wrote: >> >> Digging into the problem I'm having with a standalone django script, >> the problem seems to be that djan

Re: Why django not found static files?

2011-02-03 Thread Brian Neal
On Feb 3, 6:04 am, Marc Aymerich wrote: > On Thu, Feb 3, 2011 at 12:51 PM, Marc Aymerich wrote: > > Hi, > > I just installed the django-admin-tools app but my django installation > > doesn't load the css, js and other static files. > > > in settings.py I have: > > STATIC_ROOT = '/home/ucp/trunk/s

Re: Redirecting to personal pages.

2011-02-04 Thread Brian Bouterse
Did you read the link in documentation? In case you missed it [1]. Brian [1] http://docs.djangoproject.com/en/dev/topics/auth/ On Fri, Feb 4, 2011 at 8:51 AM, balu wrote: > How "next" parameter works? > > On Feb 4, 3:04 pm, Andres Lucena wrote: > > On Fri, Feb

Re: Looking for IDE + FTP

2011-02-08 Thread Brian Bouterse
+1 for not editing code and uploading it. I recommend vim or gVim Brian On Tue, Feb 8, 2011 at 4:57 PM, Austin Govella wrote: > I use Textmate ($55?) for editing. Great color coding for html, ruby, > php, javascript, css, and python. :-) > > I use Terminal (free) for Subver

Re: How To Populate A Dropdown List

2011-02-08 Thread Brian Neal
On Feb 8, 10:03 am, hank23 wrote: > I have coded a form which will display some data in a dropdown > selection box. The data is being populated from a a queryset that I > have setup in the form's code. However the entries in the dropdown > only display as objects of the table from which they're be

csrf cookie security

2011-02-09 Thread Brian Craft
I notice that the csrf token is not secure, i.e. the Set-Cookie is constructed w/o the "secure" option, so the browser will send it in-the-clear. It's trivial, then, for a 3rd party to discover the csrf token. Am I missing something? -- You received this message because you are subscribed to the

Re: csrf cookie security

2011-02-09 Thread Brian Craft
in an insecure cookie, it can be sniffed. Then I don't understand what prevents the attacker from constructing a valid form. On Wed, Feb 9, 2011 at 11:36 AM, Ian Clelland wrote: > On Wed, Feb 9, 2011 at 11:23 AM, Brian Craft wrote: >> I notice that the csrf token is not secure, i.e

Re: csrf cookie security

2011-02-10 Thread Brian Craft
types the url and hits port 80, the MITM can create an https connection to the target site, and return it via http. I'm not certain there's a csrf attack here, but I suspect there is. On Wed, Feb 9, 2011 at 11:28 PM, Ian Clelland wrote: > On Wed, Feb 9, 2011 at 11:51 AM, Brian

Re: Django + GWT

2011-02-13 Thread Brian Bouterse
ub.com/bmbouter/Opus>is a django+GWT project we implemented; maybe it will show some examples for you. Brian On Sat, Feb 12, 2011 at 4:19 PM, Roman wrote: > Is there a relatively painless way to integrate Django server side and > GWT front-end? I'm new to Django (one simpl

Re: Django Mutlisite Setup

2011-02-13 Thread Brian Bouterse
ompromised, essentially all of your sites could be compromised. This isn't the thread for an in depth discussion of this topic, but I did want to raise some attention towards the needs for simple secure single-server, multi-site Django deployments. Brian On Sun, Feb 13, 2011 at 11:10 PM, E

Re: App engine serving static files?

2011-02-16 Thread Brian Bouterse
I've never used it, but I always wanted to use DryDrop<http://drydrop.binaryage.com/>to push all my static media over to GAE. Brian On Wed, Feb 16, 2011 at 2:44 AM, Praveen Krishna R < rpraveenkris...@gmail.com> wrote: > *Hey Guys,* > * > * > *Does Anyone has exper

Re: Python/Django AMQP?

2011-02-24 Thread Brian Bouterse
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. > > -- Brian Bouters

Re: sqlite path

2011-02-28 Thread Brian Bouterse
Make sure the directory containing your sqlite database is writable by the user your web server is running as. sqlite occasionally creates some temporary files in the same directory side-by-side your actual sqlite file. Brian On Mon, Feb 28, 2011 at 10:45 AM, Tim wrote: > On Feb 28, 10:05

current recommendations for using email as username

2011-03-04 Thread Brian Craft
I've found any number of threads on using email as username in django, but none that are both current and conclusive. "Just do ", followed by "But that breaks [the forms, the templates, the auth site, the registration, the db schema]" etc., where is something like "use email in the User username c

Re: current recommendations for using email as username

2011-03-04 Thread Brian Craft
On Fri, Mar 4, 2011 at 1:34 PM, Shawn Milochik wrote: > What's wrong with writing your own auth backend? It's two piddly functions: > > http://dpaste.com/hold/473373/ > I think this has already been answered, in the comments here: http://djangosnippets.org/snippets/74/ and in the "motivation" s

Re: celery tasks and circular imports

2011-03-07 Thread Brian Bouterse
thus an import occurs for each time the code is run<=== performance problem * import errors aren't discovered until runtime I too am looking for a better way to do this. Brian On Mon, Mar 7, 2011 at 8:25 AM, Shawn Milochik wrote: > If there's a "correct" way to do this

Cycle & Include tags

2011-03-07 Thread Brian Neal
I'm using a recent checkout of Django trunk. If I have a template "test.html" which is this: {{ rowcolors }} the only way I could make cycle and include behave together is to do this: {% for obj in page.object_list %} {% include 'test.html' %} {% endfor %} I thought that perhaps the new "sile

Re: PLEASE HELP ME IN ADDING A CATEGORY IN THE ADMIN SITE

2011-03-08 Thread Brian Bouterse
on_id' in 'field > list'") > > > > > now what to do? do i have to edit some more codes? > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-u

Re: current recommendations for using email as username

2011-03-08 Thread Brian Craft
On Tue, Mar 8, 2011 at 12:53 PM, william ratcliff wrote: > If you look through the code in the django admin, then the limit is set in > the database schema. I've read elsewhere that it's also in all the auth form validations, so you have to subclass all of them. I haven't actually investigated th

database connection from long lasting script

2011-03-09 Thread Brian Craft
I have a script that sits in a loop, doing occasional queries, something like while 1: wait.for.some.event() object=get.some.django.db.object() do.something.with(object) transaction.commit_unless_managed() The last line is required so the script will see updates to the database from other

Re: Django app and Amazon AWS (beginner)

2011-03-09 Thread Brian Bouterse
I recommend running your runserver inside screen<http://www.manpagez.com/man/1/screen/>and leaving it detached when you are logged out. Brian On Wed, Mar 9, 2011 at 9:50 PM, Huy Ton That wrote: > Well, if you are just doing a development test, as it seems below foregoing > apache

mysql OperationalError

2011-03-10 Thread Brian Craft
When a long-running script loses the db connection, I get this exception: _mysql_exceptions.OperationalError Is there any way to trap this in a database-agnostic way? Or must I hard-code it to mysql? -- You received this message because you are subscribed to the Google Groups "Django users" g

how to get csrf cookie in ajax app

2011-03-18 Thread Brian Craft
In an ajax-based site, where the page is static, and makes ajax calls after loading, how would one get a csrf cookie? There aren't any templates associated with the views (they just return json strings). Setting of the cookie seems to be a side effect of serving forms in django, but the client does

Re: how to get csrf cookie in ajax app

2011-03-19 Thread Brian Craft
Yeah, I'm using that technique. It works fine once you have the cookie. My question was about how to get the cookie, which is not described well in the documentation. Manually calling get_token() in the view for the first ajax GET seems to be working. After that I can POST to other views. On Sat,

Re: how to get csrf cookie in ajax app

2011-03-21 Thread Brian Craft
It's in a cookie once you coerce django into sending the cookie to the browser. This is less automatic for ajax apps, because django isn't serving the forms (which is when it usually sends the csrf cookie). On Mon, Mar 21, 2011 at 9:49 AM, Matt Robenolt wrote: > To get the token? It's stored in

Re: how to get csrf cookie in ajax app

2011-03-21 Thread Brian Craft
No, it's not. It's a static file. On Mon, Mar 21, 2011 at 10:23 AM, Matt Robenolt wrote: > Is your main view being rendered by Django or something else? If so, you'll > have access to the cookie. > > On Mar 21, 2011, at 1:09 PM, Brian Craft wrote: > >> It&

Slow query on MySQL

2011-03-22 Thread Brian Neal
I apologize in advance as this is probably only tangentially related to Django. I have a forums type Django application. In my RSS feed class I had this Django model query: return Post.objects.filter(topic__forum__id=obj.id).order_by( '-creation_date').select_related(depth=2)[

Re: Another problem with django static files

2011-03-22 Thread Brian Neal
On Mar 22, 6:49 pm, jim_rain wrote: > I'm running Django 1.2.5 on a linux (Centos 5.5) server and I'm trying > to use a datepicker widget written by Aaron Williamson (http:// > copiesofcopies.org/webl/2010/04/26/a-better-datetime-widget-for- > django/) > > I followed all the steps in his write up

Re: Slow query on MySQL

2011-03-22 Thread Brian Neal
On Mar 22, 8:17 pm, smallfish xy wrote: > hi, you can try split the in statement, with less with "in". > > forums = [1, 2, 3, 4, 5] > r = [] > for f in forums : >     r.append(Post.objects.filter(topic__forum=f.id) > return r That's what I did to work around it. I'd still like to know why it

Re: Slow query on MySQL

2011-03-22 Thread Brian Neal
On Mar 22, 9:56 pm, Javier Guerra Giraldez wrote: > On Tue, Mar 22, 2011 at 9:49 PM, Brian Neal wrote: > > I studied the SQL that Django generated and it seemed fine to me. > > That's why I wonder if it is a MySQL issue since the EXPLAIN said it > > had a possible key (

Re: Another problem with django static files

2011-03-22 Thread Brian Neal
On Mar 22, 9:58 pm, jim_rain wrote: > Brian - > > Thanks for the reply - I missed that step. But when I added it the > behavior changed but still no joy. The form has text field in addition > to the date picker - it looks like this: > > class JTestForm(for

Re: Slow query on MySQL

2011-03-22 Thread Brian Neal
On Mar 22, 10:15 pm, Javier Guerra Giraldez wrote: > On Tue, Mar 22, 2011 at 10:06 PM, Brian Neal wrote: > > I see. There are in fact only 15 forums. But why does it take 40 > > seconds? I can get much better results if I do a select on each forum > > individually and com

Re: Slow query on MySQL

2011-03-23 Thread Brian Neal
On Mar 22, 11:01 pm, Javier Guerra Giraldez wrote: > On Tue, Mar 22, 2011 at 10:42 PM, Brian Neal wrote: > > This is what I came up with to reduce the long times I was > > seeing (but it still is slow). This is probably going to get ugly in > > email, maybe I should have dpa

Re: Slow query on MySQL

2011-03-23 Thread Brian Neal
On Mar 23, 8:49 am, Javier Guerra Giraldez wrote: > are the EXPLAINs from these exact SQL queries?  i don't see why it > cares about the forum_forum table, which isn't mentioned on the > queries. Sorry, my bad. I've been tweaking things in vain. Here are the correct EXPLAINS. http://dpaste.com/5

Re: Slow query on MySQL

2011-03-23 Thread Brian Neal
On Mar 23, 11:45 am, Javier Guerra Giraldez wrote: > > >http://dpaste.com/524865/ > > ok, now it's obvious. > > the second query (the one with topic__forum__in=forums, right?) is > scanning the whole topic table (12Krows).  it seems to be guessing > that picking a significant fraction of a very sm

Re: Slow query on MySQL

2011-03-23 Thread Brian Neal
On Mar 23, 12:59 pm, Javier Guerra Giraldez wrote: > On Wed, Mar 23, 2011 at 12:56 PM, Javier Guerra Giraldez > > wrote: > > in this case the problem arises because of the big mismatch between > > the forums_forum table (just 15 records) and the forums_topic table > > (12k records)  that, and the

Re: Django 1.3 released -- say thanks!

2011-03-23 Thread Brian Neal
On Mar 23, 8:58 am, Shawn Milochik wrote: > Everyone: > >     I just donated $25 to the Django Software Foundation. I would like > to suggest that others who appreciate all the hard work chip in a > couple of bucks if they are able. Especially those who, like me, want > to express their gratitude

Re: Slow query on MySQL

2011-03-23 Thread Brian Neal
On Mar 23, 1:47 pm, Javier Guerra Giraldez wrote: > On Wed, Mar 23, 2011 at 1:35 PM, Brian Neal wrote: > > So you are suggesting I need to shrink the number of topics or > > possibly link the posts directly to the forum? > > right.  since you only want the 30 latest posts

Re: Slow query on MySQL

2011-03-23 Thread Brian Neal
On Mar 23, 9:55 pm, Javier Guerra Giraldez wrote: > On Wed, Mar 23, 2011 at 8:49 PM, Brian Neal wrote: > > items = Post.objects(filter=forum__topic__in=forums).order_by('- > > topic__update_date', '-update_date').select_related(# as before)[:30] > > &g

Re: Rewriting Java UI for Django?

2011-03-25 Thread Brian Bouterse
Alarm bells usually go off for me when I am required to purchase a license for code I have written. Maybe I'm just an open source kinda guy, but if I'm going to write code, I should be free to run it without paying a license fee. Flex is a life choice ... I won't be making it.

Re: OPTIMISING OVERHEAD IN DJANGO WITH MYSQL DATABASE

2011-03-30 Thread Brian Neal
On Mar 30, 9:36 am, Dipo Elegbede wrote: > Hi all, > > I have a django application that uses mysql database. > > Everything works just fine except that I noticed some queries do spend a lot > of time to load. > > I have about 15,000 checklists the system would have to browse through to > render my

Re: Django app for data management and visualization

2011-04-10 Thread Brian Bouterse
I'm a fan of using flot <http://code.google.com/p/flot/> for visualization. I've used the Google Charts and it works well too. Brian On Sun, Apr 10, 2011 at 2:07 AM, ucnt...@gmail.com wrote: > > > On Apr 8, 12:22 am, Chris Matthews wrote: > > Hi Marwan, &

Re: Creating REST APIs in Django...advice

2011-04-12 Thread Brian Bouterse
r way. This is a common pattern I end up implementing a lot, and it would be cool if a rest framework let me accomplish this in an easier way. Brian On Tue, Apr 12, 2011 at 6:23 AM, Tom Christie wrote: > I've been working on this with some folks: > > http://django-rest-framework.org

Re: Creating REST APIs in Django...advice

2011-04-12 Thread Brian Bouterse
This is an interesting approach I had not thought of before. Thanks! Agreed, CRUD is not the same as REST. Brian On Tue, Apr 12, 2011 at 10:51 AM, sebastien piquemal wrote: > Well ... http://django-rest-framework.org allows you to override the > method by adding a post parameter. So i

Any Django developers in Chicago?

2015-02-11 Thread Brian Ray
Hey all, We are having a Django focused meetup with ChiPy (Chicago Python User Group) tomorrow night: RSVP http://chipy.org and/or http://www.meetup.com/_ChiPy_/events/220117890/ Talks will be recorded. Also looking for more talks. Hope to see some of you there. Warm Regards, Brian Ray

Re: How to share apps between projects?

2015-03-21 Thread Brian Schott
You can add an ssh git path http://stackoverflow.com/questions/4830856/is-it-possible-to-use-pip-to-install-a-package-from-a-private-github-repository Sent from my iPhone > On Mar 21, 2015, at 8:50 AM, ThomasTheDjangoFan > wrote: > > Hi guys, > > I developed some apps that I want share betwee

Re: Alternative to fabric

2014-11-17 Thread Brian Schott
Ansible is a good choice. Sent from my iPhone > On Nov 17, 2014, at 11:07 AM, Cal Leeming [iops.io] wrote: > > There isn't really such a thing as a "deployment plugin", there are many > aspects to deployment workflow that should be considered. > > It really depends on how you are intending on

Re: Django and SSL

2014-12-10 Thread Brian Schott
orn-docs.readthedocs.org/en/latest/settings.html#ssl> Brian Schott bfsch...@gmail.com > On Dec 10, 2014, at 11:55 AM, pythonista wrote: > > I am getting a request from the security infrastructure and I could use some > advice/recommendation. > > This is a 3 tier application

<    4   5   6   7   8   9   10   >