Re: staticfiles ManifestStaticFilesStorage and Form Media

2015-12-07 Thread Brian Neal
> > -- > Denis > > Am Sonntag, 6. Dezember 2015 um 17:17 schrieb Brian Neal: > > I'm investigating using staticfiles ManifestStaticFilesStorage. Unless I'm > missing something, there seems to be a hole with Django forms Media class. > If you use an inner Media class you do no

staticfiles ManifestStaticFilesStorage and Form Media

2015-12-06 Thread Brian Neal
I'm investigating using staticfiles ManifestStaticFilesStorage. Unless I'm missing something, there seems to be a hole with Django forms Media class. If you use an inner Media class you do not get the hashed versions of the assets filenames. This leads me to believe you can't use the Forms

Guide for migrating to a custom user model?

2013-04-17 Thread Brian Neal
Hello - I have a Django site that I've been maintaining for 4 years. It is running Django 1.4 now and is using the usual Django User model plus the get_profile() method to retrieve some extra information for each user. Now that Django 1.5 has landed and we can substitute our own custom user

Re: ANNOUNCE: Django 1.4 released

2012-03-24 Thread Brian Neal
On Friday, March 23, 2012 12:11:22 PM UTC-5, James Bennett wrote: > > Django 1.4 is finally here! > > For details, checkout the weblog: > > https://www.djangoproject.com/​weblog/2012/mar/23/14/ > > And the release notes: > >

Re: CACHE_MIDDLEWARE_ANONYMOUS_ONLY isn't working for me

2011-12-29 Thread Brian Neal
than I thought. On Dec 28, 10:25 am, Brian Neal <bgn...@gmail.com> wrote: > I have CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True. It seems to cache pages > even for people who have logged in. For example, I can log into the > admin, and edit an object. If I then visit the view for that ap

Re: YouTube Integration

2011-12-28 Thread Brian Neal
On Dec 28, 11:46 am, Hassan wrote: > Dear All, > > I want to know if there is a way that i can get youtube videos to my > website using a video url ? > > Best Regards , > > Hassan AL-Natour Have you seen the oEmbed specification? http://oembed.com/ I believe there is

CACHE_MIDDLEWARE_ANONYMOUS_ONLY isn't working for me

2011-12-28 Thread Brian Neal
I have CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True. It seems to cache pages even for people who have logged in. For example, I can log into the admin, and edit an object. If I then visit the view for that app, my changes do not get seen until the 5 minute cache timeout hits. I suspect my middleware

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

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.

Re: The import staticfiles_urlpatterns is not working in django 1.3

2011-04-21 Thread Brian Neal
On Apr 21, 12:48 pm, Guevara wrote: > Hello! > My project is failing to import the staticfiles_urlpatterns, using > Eclipse Helios: > > urls.py > > import from django.contrib.staticfiles.urls staticfiles_urlpatterns > > In django 1.3 I already have: > > INSTALLED_APPS = (

Re: base.html (extended by others) has to be in project (not app) root?

2011-04-15 Thread Brian Neal
On Apr 15, 2:23 pm, Jeff Blaine wrote: > Thank you all.  I will digest the replies when I have the time to properly > focus back on the issue (it's obviously small, since I have a workaround in > place by shoving base.html into the project root). > > It still, regardless of

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

Re: Slow query on MySQL

2011-03-23 Thread Brian Neal
On Mar 23, 9:55 pm, Javier Guerra Giraldez <jav...@guerrag.com> wrote: > On Wed, Mar 23, 2011 at 8:49 PM, Brian Neal <bgn...@gmail.com> wrote: > > items = Post.objects(filter=forum__topic__in=forums).order_by('- > > topic__update_date', '-update_date').sele

Re: Slow query on MySQL

2011-03-23 Thread Brian Neal
On Mar 23, 1:47 pm, Javier Guerra Giraldez <jav...@guerrag.com> wrote: > On Wed, Mar 23, 2011 at 1:35 PM, Brian Neal <bgn...@gmail.com> wrote: > > So you are suggesting I need to shrink the number of topics or > > possibly link the posts directly to the forum? >

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

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

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

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.

Re: Slow query on MySQL

2011-03-23 Thread Brian Neal
On Mar 22, 11:01 pm, Javier Guerra Giraldez <jav...@guerrag.com> wrote: > On Tue, Mar 22, 2011 at 10:42 PM, Brian Neal <bgn...@gmail.com> 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 g

Re: Slow query on MySQL

2011-03-22 Thread Brian Neal
On Mar 22, 10:15 pm, Javier Guerra Giraldez <jav...@guerrag.com> wrote: > On Tue, Mar 22, 2011 at 10:06 PM, Brian Neal <bgn...@gmail.com> wrote: > > I see. There are in fact only 15 forums. But why does it take 40 > > seconds? I can get much better results if

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(forms.Form): >     input

Re: Slow query on MySQL

2011-03-22 Thread Brian Neal
On Mar 22, 9:56 pm, Javier Guerra Giraldez <jav...@guerrag.com> wrote: > On Tue, Mar 22, 2011 at 9:49 PM, Brian Neal <bgn...@gmail.com> 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

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

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

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(

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

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

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

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 <bgn...@gmail.com> 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 &g

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

Re: Confusion about the new staticfiles contrib app

2011-01-26 Thread Brian Neal
On Jan 26, 1:46 am, Jonas Geiregat <jo...@geiregat.org> 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 =

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

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?

Re: Updating a video rating using AJAX

2010-10-20 Thread Brian Neal
On Oct 20, 8:23 am, Sithembewena Lloyd Dube wrote: > Hi all, > > I have a page where users can rate a video, and in models.py I have a video > model with a 'rating' property. I wish to find out how I can AJAXify the > rating button on the page, so that if a user clicks on it,

Re: form validation for empty checkboxes that are not required (and they are the only fields present)

2010-09-28 Thread Brian Neal
On Sep 27, 11:35 am, Skylar Saveland wrote: > I have some modelforms within a .  Each form has one > checkboxselectmultiple that is not required.  If I post nothing (all > checkboxes are empty) then all of the forms are invalid.  If I post > anything then all of the

Re: How to clear wrong form data (e.g password field), but still show error?

2010-09-16 Thread Brian Neal
On Sep 16, 9:55 pm, Brian Neal <bgn...@gmail.com> wrote: > On Sep 16, 7:37 pm, Karen Tracey <kmtra...@gmail.com> wrote: > > > Use this widget for the field: > > >http://docs.djangoproject.com/en/1.2/ref/forms/widgets/#django.forms > > > with render_v

Re: How to clear wrong form data (e.g password field), but still show error?

2010-09-16 Thread Brian Neal
On Sep 16, 7:37 pm, Karen Tracey wrote: > > Use this widget for the field: > > http://docs.djangoproject.com/en/1.2/ref/forms/widgets/#django.forms > > with render_value=False > Note that the docs indicate the default value for render_value is True but in the code it is

Re: PayPAL-IPN-request doesn't call the view

2010-09-10 Thread Brian Neal
On Sep 10, 12:01 pm, Bill Freeman wrote: > > My advice is to protect everything with try or by using get, > log your progress (we had a logging model, but you can > also append to a file, wrapping everything in a try-finally > that closes the filehandle to be sure things get

Re: Please wait page trouble

2010-09-08 Thread Brian Neal
On Sep 8, 5:56 pm, Bradley Hintze wrote: > This is what I have in my please_wait.html > > src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js";> >

Re: python manage.py runserver - can't see error stack traces when an Ajax handler throws an exception

2010-09-08 Thread Brian Neal
On Sep 7, 5:10 pm, Phlip wrote: > [...] > > How do I get Ajax errors to print a simple exception trace to STDOUT, > instead of going through all that baloney? > Firebug can display these Ajax errors quite easily and give you a lot more information. -BN -- You received

Re: broken default view of the django admin site

2010-07-15 Thread Brian Neal
On Jul 15, 2:05 pm, Colleen A Josephson wrote: > Hello, > > I'm very new to django. I just set up my first site using apache and mod_wsgi. > > The admin area does not seem to have the nice, neat blue default theme...its > horrifically ugly and difficult to navigate. > Here's a

Re: Log errors to file

2010-07-07 Thread Brian Neal
On Jul 7, 4:35 pm, Jonathan Hayward wrote: > I'm working on a view made to output JSON for Ajax use. My log has: > > [07/Jul/2010 17:47:13] "POST /ajax/login HTTP/1.1" 500 50678 > > That looks like Django gave a helpful and detailed stacktrace page, albeit >

Re: AJAX request does not seem to have request.user

2010-06-02 Thread Brian Neal
On Jun 2, 10:14 am, Carl Nobile wrote: > > Could the new code not work with a class. I'm still looking into this > and may discover the answer myself, but if anybody knows or has an > idea I'd be much appreciative. > > ~Carl Carl, those decorators no longer work on class

Re: Turning "DEPUG=False" results in missing CSS

2010-05-25 Thread Brian Neal
On May 25, 2:51 pm, tom wrote: > Hi, > > I have currently built a website with Django. After developing > everything locally with "python manage.py runserver", I have switched > for testing to Apache and mod_python. > > Everything worked fine there as well. All pages

Re: List of Users online

2010-05-19 Thread Brian Neal
On May 19, 12:31 pm, EmileZola wrote: > I want to list the logged in users on my index page and was wondering > what was the right way to do this. > > Can I do it similar to this ? > def index(request): >     return render_to_response('index.html', { >         'online_users':

Re: ajax setup

2010-05-18 Thread Brian Neal
On May 18, 9:57 am, Matt W wrote: > Hello Everyone, > > I just started to use Django and I was wondering how I could setup > javascipt (AJAX to be more specfic) in my djagno project in order to > run a script. Here is the script code. > [snip] > > In specific I was

Re: insert html in html

2010-05-18 Thread Brian Neal
On May 18, 2:00 pm, CrabbyPete wrote: > I want to insert a html calendar into an existing web page. What is > the best way to insert html into a template that I have for the web > page? In what form do you have this calendar HTML? Do you compute it in a view? Is it already

Re: No stylesheet in administration panel

2010-05-18 Thread Brian Neal
On May 18, 10:47 am, Carlo Trimarchi wrote: > Hi, > I'm following the django tutorial to build the poll application. I'm > working mostly on a remote server (using wsgi), but I'm also trying > stuff on my local machine, just running the manage.py runserver > command. > I've

Re: Considering Django: How simple is customising django-admin?

2010-04-08 Thread Brian Neal
On Apr 8, 5:15 am, UnclaimedBaggage wrote: > Hi folks, > [..] > Any > suggestions on the following would be very appreciated: > > #1.) For usability's sake, I'd like to have foreign key models > embedded in the same admin form as the model they're referencing. For > example,

Re: url template tag taking a long time

2010-04-07 Thread Brian Neal
On Apr 6, 11:53 pm, Russell Keith-Magee <freakboy3...@gmail.com> wrote: > On Wed, Apr 7, 2010 at 12:08 PM, Brian Neal <bgn...@gmail.com> wrote: > > I am on trunk, somewhere around revision 127xx and just updated to > > 12936. A couple of my views render this one particul

url template tag taking a long time

2010-04-06 Thread Brian Neal
I am on trunk, somewhere around revision 127xx and just updated to 12936. A couple of my views render this one particular template, which used to take less than a second to see a response. Now it is taking almost a minute. The Django debug toolbar reports nothing out of the ordinary in terms of

Re: Formatting datetimes - simple question

2010-04-06 Thread Brian Neal
On Apr 6, 5:29 pm, Paweł Roman wrote: > Hi all, > > Django has this DATETIME_FORMAT setting, which allows to format all > datetime values, whenever they are displayed. But the problem is this > is a _global_ setting, so whoever uses the application would see all > the

Re: Hostmonster shared hosting and django tinymce

2010-03-21 Thread Brian Neal
On Mar 21, 7:49 am, Bobby Roberts wrote: > can anyone help me out here?  I'm stuck and cannot get the text areas > to work using ckeditor. Does any static media work? How are you deploying? mod_python, mod_wsgi? What is the configuration? Can you access the javascript in

Re: Using markdown to clean html

2010-03-20 Thread Brian Neal
On Mar 19, 8:35 am, Tor Nordam wrote: > I'm currently writing a blog application in django, and a part of what > I want to do is allow some HTML in posts and comments. I discovered > yesterday, more or less by accident, that the markdown filter actually > allows some HTML.

Re: How to cache the output of Django 1.2 RSS class based views?

2010-03-11 Thread Brian Neal
On Mar 7, 10:48 pm, Brian Neal <bgn...@gmail.com> wrote: > Before the Django 1.2 beta and the class-based Feed views, I was doing > this to cache my RSS feeds: > > urls.py: > from django.contrib.syndication.views import feed as syndication_feed > from django.views

How to cache the output of Django 1.2 RSS class based views?

2010-03-07 Thread Brian Neal
Before the Django 1.2 beta and the class-based Feed views, I was doing this to cache my RSS feeds: urls.py: from django.contrib.syndication.views import feed as syndication_feed from django.views.decorators.cache import cache_page urlpatterns = patterns('', url(r'^feeds/(?P.*)/$',

Re: How to display PendingDeprecationWarning using dev. server?

2010-03-06 Thread Brian Neal
On Mar 6, 10:29 am, Karen Tracey wrote: > This appears to be due to the way runserver reloads the process when > monitoring for source code changes.  If you specify --noreload on runserver > I bet you will see the warnings. The behavior appears to be OS-specific: I > can

Re: How to display PendingDeprecationWarning using dev. server?

2010-03-05 Thread Brian Neal
Any ideas? Can anyone else try this and report back? Just insert the code below into a view function and start the dev. server with "python -Wall manage.py runserver". Thanks. On Feb 28, 5:28 pm, Brian Neal <bgn...@gmail.com> wrote: > I'm having trouble seeing PendingD

How to display PendingDeprecationWarning using dev. server?

2010-02-28 Thread Brian Neal
I'm having trouble seeing PendingDeprecationWarning's on stderr when using the dev server. To make sure I'm not crazy, I wrote a simple Python program that looks like this: print "** WARNING **" import warnings warnings.warn( "Testing the warnings module!",

Re: Added-value over PHP?

2010-02-06 Thread Brian Neal
On Feb 3, 1:39 am, Delifisek Tux wrote: > > A decent framework eats up your %50 of > cpu resource. For example that Uber Zend FW gives you 1/6 in a hello world > app comparing plain php. Why would you want to write a Hello World program in a framework? Try writing a

Re: Best way to track user presence

2010-01-14 Thread Brian Neal
On Jan 14, 7:30 pm, E17 wrote: > Hi, > > in my Django application I need a way to track logged users presence. > > User gets an 'online' status when he/she logs in and 'offline' status > when logs out, it's pretty simple. But what is the best way to handle >

Re: Overhead of using django.contrib.markup vs. pre-rendered HTML field

2009-12-21 Thread Brian Neal
On Dec 21, 7:12 am, Jesaja Everling wrote: > Hi All! > > I'm wondering how expensive it is in terms of processing power to use > the django.contrib.markup filters for displaying blog posts instead of > storing pre-rendered HTML in a db field. > The Pinax blog application

Re: Cron vs event triggered action

2009-12-14 Thread Brian Neal
On Dec 14, 12:27 pm, Tim Daniel wrote: > ... > > Creecode what do you mean with "custom management commands"? I just > wrote a simple python script that can be called from bash like this > python myscript.py, inside it I set up the enviroment to be able to > call my

Re: {{ form.as_table }} not displaying in template

2009-12-12 Thread Brian Neal
On Dec 12, 5:04 pm, GoSantoni wrote: > Hey i've got a very basic question about django form processing. Got > haystack installed and searching works fine in the standard search > template (http://haystacksearch.org/docs/tutorial.html#search- > template) in the /search .

Re: settings.TIME_ZONE

2009-12-06 Thread Brian Neal
On Dec 6, 7:40 pm, XtraGreen wrote: > I've changed settings.TIME_ZONE to 'UTC' and restarted my server but > when I create records (postgresql) they're not UTC, they're 'America/ > Chicago' (-6) in the table. > > Am I missing something or is settings.TIME_ZONE useless?

Re: How to show site down for maintenance page

2009-12-05 Thread Brian Neal
On Dec 5, 6:54 pm, zweb wrote: > What is the best way to show site down for maintenance page ? If you are using mod_wsgi: http://www.caktusgroup.com/blog/2009/05/25/seamlessly-switch-off-and-on-a-django-or-other-wsgi-site-for-upgrades/ -- You received this message

Re: overridden delete method not being called on cascade

2009-12-03 Thread Brian Neal
On Dec 3, 12:53 pm, "eric.frederich" wrote: > ... > > The problem now it that when I delete an Offering object through the > Django admin it cascade deletes the Enrollment objects as it should > but it is not calling the delete method and thus restoring their > interest.

Re: Adding a dashboard to admin

2009-12-01 Thread Brian Neal
On Dec 1, 10:56 am, Bill Freeman wrote: > > I then created my own template file in one of my TEMPLATE_DIRS called > > 'admin/custom_index.html" that extends 'admin/index.html'. I ended up > > copying the {% block content %} from the admin/index.html and > > inserting my

Adding a dashboard to admin

2009-11-30 Thread Brian Neal
On my site, users submit content that needs to be approved before getting published. Thus I wanted a simple "dashboard" on the admin page to show me how many pending items from each model are waiting for approval. I created a template tag for the dashboard. I then mulled my options for getting

Re: Use Subversion to Download the Latest Django Version

2009-11-17 Thread Brian Neal
On Nov 17, 12:05 pm, Angel Cruz wrote: > So it seems TortoiseSVN does not include svn.exe? No, it doesn't. > > You need to install Subversion packaging then > No, he doesn't have to. He's got TortoiseSVN, which is a GUI for svn. He can checkout Django by creating a new

Re: datetime problems with Django application

2009-11-11 Thread Brian Neal
On Nov 10, 5:41 pm, BEC wrote: > I have a Django application running with mod_python on Apache. In > settings.py I have set TIME_ZONE="America/New_York". Within my > application I verify that os.environ['TZ'] is indeed set to this > value. Within my view.py I use

Re: how to exclude DateTime that are None

2009-11-02 Thread Brian Neal
On Nov 2, 3:44 pm, Felipe Reyes wrote: > Hi everybody, > > I'm using django 0.96, one of my models has a DateTimeField, I'm > trying to exclude the from the queryset the rows that have null in the > datetimefield, I'm using something like this: > >

Debugging SQL Queries: Correlating with Python Code

2009-10-22 Thread Brian Neal
Currently I am keeping an eye on SQL queries by displaying at the bottom of my base template sql_queries. I'm seeing some queries that look kind of strange to me, and I was wondering if there was a way to somehow correlate the queries with my app's Python code. For example, amongst the SQL

Re: Showing unescaped HTML in Admin pages

2009-10-12 Thread Brian Neal
On Oct 12, 11:15 am, "ruidevie...@googlemail.com" wrote: > Hi everyone, > > Is is possible to render unescaped HTML in admin pages? > Does this help? Start here: http://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.list_display and

Re: nested block definitions

2009-09-21 Thread Brian Neal
On Sep 21, 10:37 am, Daniel Roseman wrote: > > Anything in a child template that is outside of a > {% block %} is ignored. > I usually have a few {% load %} tags in child templates above {% block %} to bring in needed template tags. BN

Re: django forum

2009-09-20 Thread Brian Neal
On Sep 20, 11:10 am, dijxtra wrote: > Is there a free robust django forum app? Or more precisely, a free and > robust forum app which uses django.contrib.auth for authentication? > > Or should I just try out those several projects enabling django to > access phpBB's user info

Re: DST or not

2009-09-05 Thread Brian Neal
On Sep 5, 4:03 pm, zweb wrote: > Is there any way to know if for a timezone , on a praticular date > time, is DST active or not? > it is required by localize command of pytz. How to find it > programatically? > > >>> est_dt = eastern.localize(loc_dt, is_dst=True) > >>>

Re: how to deploy an app that gets used by people in multiple time zones

2009-09-04 Thread Brian Neal
On Sep 4, 10:47 am, Margie wrote: > > Can someone clarify what format dates and times are stored in when > using just a standard DateTimeField?  Is my timezone encoded in the > database or is some generic, non-timezone-specific date/time stored? There is no timezone

Re: Does post_save signal need to be in models.py?

2009-07-11 Thread Brian Neal
On Jul 11, 12:54 pm, Ryan K wrote: > I am trying to avoid circular dependency issues  between signals.py > and models.py. Is there any reason why I can't connect the post_save > signal in signals.py itself (the function is connects with would be in > the same file? Should I

Re: context objects get cached/stored across requests, somehow

2009-07-06 Thread Brian Neal
On Jul 6, 10:08 am, Haes wrote: > Hi, > > I've created a view which displays a simple list of all objects of one > model. If a 'search_string' URL parameter is defined, the list is > filtered by this search string and the search string itself will be > displayed in the

Re: Using formfield_overrides to add TinyMCE

2009-06-25 Thread Brian Neal
On Jun 25, 2:33 pm, Pes wrote: > Hi All, > > I feel like there’s something simple I’m overlooking here. I can't > seem to get TinyMCE to work when I use the built-in widget from Django- > TinyMCE. This works if I uncomment the Media class at the bottom, but > the widget

Re: Encryption question

2009-06-23 Thread Brian Neal
On Jun 23, 8:39 am, daniel wrote: > Good morning, > > I have a MySQL (version 5.0.5 running on Ubuntu 8.04) database > containing encrypted fields (the encryption was done using mysql's > AES_ENCRYPT). The database is normally accessed by an application > written in C++

Re: Question IMAGE in Django

2009-06-23 Thread Brian Neal
Also check the permissions on your images. I had set the FILE_UPLOAD_PERMISSIONS to 0640 in development, but this wasn't correct for my production server. Ensure that Apache or whatever user the webserver is running has read access to your images.

Re: Apache 2.2 >> Forbidden You don't have a permission to access /static_media on this server

2009-06-23 Thread Brian Neal
On Jun 23, 5:29 am, MarcoCanali wrote: > I have this error message from apache 2.2 server when i try to access > at mine static_media for my django project. Apache serve my project in > django without static file such as css or image ... Check your file permissions. Can

Re: Django and CSS

2009-06-18 Thread Brian Neal
On Jun 18, 2:50 pm, Chris DPS wrote: > Hi, > > I'm new to Django. > I've read the > doc:http://docs.djangoproject.com/en/dev/howto/static-files/?from=olddocs > which is about static files but still do not quite understand what to > call everything and it isn't working > On

Re: Django for Google API - Google Search, Google Map

2009-06-18 Thread Brian Neal
On Jun 18, 5:42 pm, Olavgo wrote: > I want to write a website that I think will be using the Google API > (search and map). > > Is there any special reason the do it with Python?  Django? Well, I'm not real sure about the search API, but the Maps API is all Javascript. BN

Re: Memcached, out of sockets

2009-06-16 Thread Brian Neal
On Jun 15, 7:28 pm, Miles wrote: > I've been running the python memcached connector for a while, without > much trouble. But just today during a stress test of one of the feeds > (read: many many requests expected), I've ran into an out of sockets > situation. > > After every

Re: Is there a version of @login_required that requires the user to log in as a specific user?

2009-05-25 Thread Brian Neal
On May 25, 3:41 am, Andy wrote: > > But how do I stop user A from trying to edit the profile of user B? You don't let them. You control which profile you get from and save to the database, right? You look at the request.user object and only manipulate the data

Re: Is there a version of @login_required that requires the user to log in as a specific user?

2009-05-24 Thread Brian Neal
On May 24, 6:50 pm, Continuation wrote: > For example, I have a view edit_profile that edits a user's profile. > Obviously I want to make sure that each user can edit his own profile > only. > > So before the profile of user A is being edited by edit_profile, I > want to

Re: Callable objects instead of functions in views.py

2009-05-20 Thread Brian Neal
On May 20, 8:33 am, Filip Gruszczyński wrote: > I was wondering: have you considered using some callable objects to > serve requests in views.py instead of functions? Sure, check out this blog post (not the only example):

Re: A puzzling problem with admin

2009-05-13 Thread Brian Neal
On May 13, 10:13 am, andybak wrote: > Getting somewhere... > > I'm running on Django 1.0 via nginx/fcgi > > When I run via the dev server (leaving everything else the same) the > problem goes away. > > How can the effects of a POST to a model form in admin be affected > purely

Re: Flatpages only works when settings.DEBUG = True

2009-05-04 Thread Brian Neal
On May 4, 10:28 am, Ronghui Yu wrote: > Hi,All, > > I am going to use Flatpages app for those simple pages. And everything > works fine when settings.DEBUG is True, but when it is turned to False, > a URL not configured in urlpatterns will trigger 500, not 404. Do you have a

Re: Problem with in long text fields in templates

2009-04-20 Thread Brian Neal
On Apr 20, 11:31 am, NoviceSortOf wrote: [...] > When attempt to using {{ book.description }} in the template, it > outputs all the tags onto the screen, > when what we want is actual line breaks. > [...] > > Can someone please give me a clue as to how to make this work

Re: TemplateSyntaxError: Settings issue?

2009-04-16 Thread Brian Neal
On Apr 16, 11:33 am, Aneesh K wrote: > > Why is the TemplateSyntaxError raised, and why don't I see this > problem on my development server? > > Thanks! > Aneesh Could be a python path problem? Put the directory that has your application in it on the python path. I

Re: newbie: syncdb doesnt update schema after model change?

2009-04-16 Thread Brian Neal
On Apr 16, 11:00 am, gry wrote: > [django: 1.1 beta 1 SVN-10407, python 2.5.2, ubuntu] > My first django toy app.  I've been working through the > tutorialhttp://docs.djangoproject.com/en/dev/intro/tutorial02/. > I've already done a few cycles of  (change-model,

Re: Converting from local DST to UTC

2009-04-14 Thread Brian Neal
On Apr 14, 7:26 pm, Jamie wrote: > I am working on an app that will export a calendar event to Google > Calendar. Google Calendar requires that event datetimes be in UTC > format. I can make the conversion from local (America/New_York) to UTC > using pytz, but the time is off

Re: Trouble with DateField

2009-04-13 Thread Brian Neal
On Apr 13, 11:47 am, Brandon Taylor wrote: > Hi everyone, > > I need a sanity check here. I'm using a jQueryUI DatePicker, with the > dateFormat option set to 'yy-mm-dd', which is returning a date in - > MM-DD format, if I check my request.POST values. > > I have a

Re: Use Python to parse HTML and integrating said script into Django

2009-04-13 Thread Brian Neal
On Apr 13, 9:44 am, Tonne wrote: > It's the calendar with the unusual form/structure  that I'm > struggling to implement with the stock Django tools. > > I'll take a step back and give it another shot with logic in view and > parsing in the template. I'm not sure what

Re: Mulitple Time Zone support?

2009-04-12 Thread Brian Neal
On Apr 12, 7:15 pm, ydjango wrote: > What is the best way to provide multiple Time zone support? Definitely check out the Python pytz module. > (Also where can I get list of all time zones to populate the  select > dropdown.) > There is almost 400 time zones in the

  1   2   >