Re: Return something specific on 404's on a particular path

2009-09-11 Thread Gabriel Gunderson
On Fri, Sep 11, 2009 at 8:26 PM, Jordon Wii wrote: > How can return a specific image when there is a 404 error for an image on a > path? Don't make it harder then it needs to be. Don't let it get all the way to a 404. If they upload the image, you likely have the name of the file in your databa

Re: How to server static media secured by Django authentication

2009-09-11 Thread Gabriel Gunderson
On Fri, Sep 11, 2009 at 3:03 PM, Jim Myers wrote: > I have a requirement to serve static files only to users authenticated > through Django secure login. http://docs.djangoproject.com/en/dev/howto/apache-auth/ Gabe --~--~-~--~~~---~--~~ You received this message

Re: Snow Leopard Issues?

2009-09-11 Thread Anthony
Thanks to all for the info. On Sep 10, 9:11 pm, Graham Dumpleton wrote: > On Sep 11, 9:38 am, Anthony wrote: > > > Has anyone running Django on their MacBook updgraded to Snow Leopard > > successfully?  I've been holding off to avoid any potential hassles, > > but with the release of 10.6.1,

Re: Load Templates from outside TEMPLATE_DIRS

2009-09-11 Thread Kenneth Gonsalves
On Saturday 12 Sep 2009 9:26:15 am mviamari wrote: > I'm trying to load a template file from outside of TEMPLATE_DIRS, i.e. > the template file does not reside in any of the template directories > specified in TEMPLATE_DIRS. > > Does anyone know if this is possible? I tried just specifying a path:

Load Templates from outside TEMPLATE_DIRS

2009-09-11 Thread mviamari
I'm trying to load a template file from outside of TEMPLATE_DIRS, i.e. the template file does not reside in any of the template directories specified in TEMPLATE_DIRS. Does anyone know if this is possible? I tried just specifying a path: i.e.'../../new_dir/template.html' but that doesn't seem to

Re: Return something specific on 404's on a particular path

2009-09-11 Thread Tiago Serafim
Hi, You can take a look on how the contrib.redirect handles 404 and then create a custom Middleware for your specific need. http://code.djangoproject.com/browser/django/trunk/django/contrib/redirects/middleware.py HTH, Tiago On Fri, Sep 11, 2009 at 11:26 PM, Jordon Wii wrote: > Hi,I want set

Return something specific on 404's on a particular path

2009-09-11 Thread Jordon Wii
Hi,I want set up something where users upload an article, and an associated image. If they do not provide an image, then, when someone reads the article, I'd like return a specific image. I've looked at custom storage backends, but those are too complex. How can return a specific image when ther

Re: Couple of basic Django questions

2009-09-11 Thread Tiago Serafim
Hi, On Fri, Sep 11, 2009 at 10:04 PM, Dan06 wrote: > > 1. Is there supposed to be only one 'view' (controller) file per > application, with all the 'action' functions? Or can there be multiple > different 'view' (controller) files for the same application? If the > latter, how? > > No, you can h

Couple of basic Django questions

2009-09-11 Thread Dan06
I'm in the process of deciding between learning/using django and rails. I've already made a simple site in rails, and now I'm in the process of doing the same with django. However, there are a couple of points I'm stuck on: 1. Is there supposed to be only one 'view' (controller) file per applicat

Re: Link for new page

2009-09-11 Thread Peter Coles
Your second url will catch anything that you serve under the path "/ abc/", you should change it from (r'^abc/', main_page) to (r'^abc/$', main_page). Then you need to: 1. define a view for your forgot password page that renders the content 2. add a url for that view to your urls.py file Further

Re: Having Trouble with Reverse method

2009-09-11 Thread Peter Coles
Hrm… If your server is serving the actual page fine, then it should be configured all right. I'll have to take a different approach, maybe I'm overlooking where and how you're doing this? 1. Is this is failing when you do the reverse from the shell? Do you have all the proper environment variabl

Re: Custom url in django Django sitemap

2009-09-11 Thread Peter Coles
Ah, sorry :) You just have to write a custom Sitemap class. The docs say that it doesn't matter what type of objects are returned by items as long as your sitemap class knows how to get the necessary information from them. Read the docs here: http://docs.djangoproject.com/en/dev/ref/contrib/sit

Re: How to server static media secured by Django authentication

2009-09-11 Thread Javier Guerra
On Fri, Sep 11, 2009 at 4:26 PM, Tim Chase wrote: > You may be interested in: > > http://code.djangoproject.com/ticket/2131 > > Both mod_python and mod_wsgi support the ability to return a > header that instructs the web-server to "dump this local file > back as my response" freeing up Django res

Re: custom tag - render() isn't called

2009-09-11 Thread Peter Coles
I tried the above template_tag and it worked fine for me, maybe you're doing something wrong in the template? My best guess for why "__init__" would be called and not "render" is that the template_tag is not getting rendered due to some other logic in the template. All of these examples below wi

Re: How to invoke hasNoProfanities?

2009-09-11 Thread Brandon
Uh, where? I see the definition in settings.py, but I can certainly enter any of the words on the profanities list in: django.conf.global_settings.py into a text field and it will not throw an exception. On Sep 9, 3:55 pm, Chris Withers wrote: > Brandon Taylor wrote: > > I would like to do some

Re: How to server static media secured by Django authentication

2009-09-11 Thread Tim Chase
> I have a requirement to serve static files only to users authenticated > through Django secure login. You may be interested in: http://code.djangoproject.com/ticket/2131 Both mod_python and mod_wsgi support the ability to return a header that instructs the web-server to "dump this local file

Re: How to server static media secured by Django authentication

2009-09-11 Thread Maksymus007
On Fri, Sep 11, 2009 at 11:03 PM, Jim Myers wrote: > > I have a requirement to serve static files only to users authenticated > through Django secure login. > That means I can't use apache basic/digest authentication for those > files. > > So far in my searches of the web and Django docs, I've fo

How to server static media secured by Django authentication

2009-09-11 Thread Jim Myers
I have a requirement to serve static files only to users authenticated through Django secure login. That means I can't use apache basic/digest authentication for those files. So far in my searches of the web and Django docs, I've found no way to do this. Of course my alternative is to serve ALL t

Internationalization

2009-09-11 Thread Javi
Hello guys, I'm trying to use some translations in my project. I've read the doc about i18n, but I must be missing in some step. I've embedded translation strings in my templates. I've got translations for those strings in the languages I want to support (makemessages and compilemessages) and I'

Re: How to generate po files ?

2009-09-11 Thread Mirat Can Bayrak
hellooo -- Mirat Can Bayrak --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to

Re: Editors of choice

2009-09-11 Thread ma siqi
ulipad !! 2009/9/7 Samuel Hopkins > Hello Django peeps, > > I am a Django newbee. I have had my eye on Djanjo for a year or so now but > held off because I had limited python experience. However, after a summer of > python and watching Django's popularity snowball, I think I am ready to go > :)

Re: Parsing / Deserializing a JSON String

2009-09-11 Thread Eric
As I have been receiving all along, the code you suggested gives me the following error: " TypeError at /course/savegantt/ string indices must be integers " There must be something not quite right about the for loop statement ("for obj in serializers.deserialize('json', gantt_data): ") On Se

Re: Editors of choice

2009-09-11 Thread sebastian serrano
I use eclipse + pydev. Anyway I found writing python code very easy, so any editor with highlighting and intergrated debugging is good. On Sep 7, 12:55 pm, Samuel Hopkins wrote: > Hello Django peeps, > > I am a Django newbee. I have had my eye on Djanjo for a year or so now but > held off becaus

Re: Django admin templates not loading

2009-09-11 Thread Simon Lee
Hi Karen, Thank you for pointing this out. I followed your advise and it works beautifully. As you see, I am a newbie to all these. On another subject, is there a preferred location to put the production website(s) files/directories on Linux? Is it right to put them in /var/www/ or should I put

Re: Javascript working on development, not apache

2009-09-11 Thread geraldcor
Hehe...well, tiredness has proven yet again to be a viscous enemy. I forgot that I changed jquery-1.3.2.min.js to jquery.min.js. the console cleared that right up. Sorry for the stupid mistake. Thanks Tiago. Greg On Sep 11, 9:51 am, Tiago Serafim wrote: > Open the Firefox console and try to see

Re: Javascript working on development, not apache

2009-09-11 Thread Tiago Serafim
Open the Firefox console and try to see what's going on. On Fri, Sep 11, 2009 at 12:44 PM, geraldcor wrote: > > Hello all, > > I have a site that has quite a bit of javascript/jquery going on. All > of this works fine on my development server, but basically no > javascript works when I deploy on

Javascript working on development, not apache

2009-09-11 Thread geraldcor
Hello all, I have a site that has quite a bit of javascript/jquery going on. All of this works fine on my development server, but basically no javascript works when I deploy on Apache. This previously worked on this same site before some changes (suspiscious, I know) and other sites work fine on

Re: Include under an "if" statement

2009-09-11 Thread NealWalters
A follow-up question. The following works [filename=baseMain.html]: {% include templateHead %} {% include templateBody1 %} StartBodyBlock {%block body%} Default Block Body {%endblock%} EndBodyBlock {% include templateBody2 %} but if I combine templateBody1 and templateBody2 int

Re: Editors of choice

2009-09-11 Thread bobhaugen
Do y'all Ubuntu Vim users install vim-gnome or vim-gtk or neither? Any differences re plugin compatibility? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to dj

Re: Populating ChoiceField values in Form

2009-09-11 Thread Adam N
> class TestForm(forms.ModelForm): >     category = forms.ModelChoiceField(queryset=TestModel.objects.filter > (filtercriterion__id=1)) > >     class Meta: >         model = TestModel > > In this example, TestModel.objects.filter(filtercriterion__id=1) will > return a QuerySet of what I want to en

Re: custom tag - render() isn't called

2009-09-11 Thread eli
I have problem when tag is called from for loop in template. It's called only once (sic!). Why? --~--~-~--~~~---~--~~ 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@g

Re: Why doesn't Django display template line number of errors?

2009-09-11 Thread NealWalters
Maybe on Google App Engine there is no error line? Here's an example of an "endif" insteaf of an "endifequal". Neal Traceback (most recent call last): File "c:\Program Files\Google\google_appengine\google\appengine\ext \webapp\__init__.py", line 501, in __call__ handler.get(*groups) Fil

complex query - howto do with django orm?

2009-09-11 Thread tom
Hi all, i have a complex query and want to do this query with the django orm. I already use django, but the raw-sql-way: def get_windenergy_data(self, windspeed_channel, winddirection_channel, project_id, logger_serial): from django.db import connection cursor = connection.cursor

Populating ChoiceField values in Form

2009-09-11 Thread Adam Nelson
I'm trying to limit the ChoiceField values of a given Form with a queryset: class TestForm(forms.ModelForm): category = forms.ModelChoiceField(queryset=TestModel.objects.filter (filtercriterion__id=1)) class Meta: model = TestModel In this example, TestModel.objects.filter(filt

get_query_set() in automatic managers

2009-09-11 Thread filippo
Hey, Django documentation says: "If you override the get_query_set() method and filter out any rows, Django will return incorrect results. Don't do that. A manager that filters results in get_query_set() is not appropriate for use as an automatic manager." http://docs.djangoproject.com/en/1.0//

fastcgi deployment through htaccess, with multiple projects using same account

2009-09-11 Thread Evert
Hi folks, I'm trying to run two projects through the same apache + fastcgi combination, but I keep running into trouble. Can this actually be done? One general error I get is an 'attempt to write readonly database' when I go to the admin page of the second project (in this example: www.example.

Re: custom tag - render() isn't called

2009-09-11 Thread anentropic
Any feedback on this? I have the same problem... I have some of my own custom tags working but the ones that come with django-tagging it seems like render does not get called I've tried moving things around, putting them in the same file as my tags that do work etc. __init__ of the custom tag i

Re: glibc detected

2009-09-11 Thread Tom Evans
On Fri, 2009-09-11 at 04:13 -0700, rufus nayagam wrote: > Often we get the following error. > > b79d5000-b79d7000 rw-p b79d*** glibc detected *** python: double free > or corruption (fasttop): 0x084dcaa8 *** > > We understand its a memory related error... And we give... > > export MALLOC_CHECK_

glibc detected

2009-09-11 Thread rufus nayagam
Often we get the following error. b79d5000-b79d7000 rw-p b79d*** glibc detected *** python: double free or corruption (fasttop): 0x084dcaa8 *** We understand its a memory related error... And we give... export MALLOC_CHECK_=0 as a temporary solution.. What will be the permanent soluti

Re: Django Project Management App

2009-09-11 Thread Thomas Guettler
Greg schrieb: > Hi all, > > Since I started with django a year or so ago, I've been gradually > building a very simple project management app for myself - it started > as a project to learn the language but has evolved into a very useful > tool, handling all my timetracking, task management and i

Re: django deploy problem

2009-09-11 Thread Graham Dumpleton
On Sep 11, 7:05 pm, Mike Ramirez wrote: > On Friday 11 September 2009 01:52:10 lfrodrigues wrote: > > > > > > > Hi, > > > I want to deploy 2 django sites in different subdirectories so I have: > > > > >   > >       SetHandler python-program > >       PythonHandler django.core.handlers.modpyth

Django template include context

2009-09-11 Thread jaap
I'm using django 1.0's templates on GAE. I've got a for loop that outputs elements. I update their contents using ajax. I want to reuse the part of the template that renders the content of these elements. I have two handlers that handle /stufflist and /stuff/? reload=ajax. The first handler pa

Local html documentation problems

2009-09-11 Thread LuisC
Hi!!! I am trying to generate the local html doc on a WinXP laptop... I installed setuptools, then easy-install SPHINX and failed whith "make html". Then, installed UnxUtils and somewhat able to "make html". Finally, in a command window did the makefile manually for the html tag... I am getting

Re: Proper way of importing projects modules

2009-09-11 Thread Filip Gruszczyński
Thanks for your answers, I'll try to choose a solution that suits our needs best :-) 2009/9/10 Andrew Gwozdziewycz : > > This whole discussion is pretty much what virtualenv solves > http://pypi.python.org/pypi/virtualenv > > Basically, for each package that you wanna reuse, install it into the >

Re: django deploy problem

2009-09-11 Thread Mike Ramirez
On Friday 11 September 2009 01:52:10 lfrodrigues wrote: > Hi, > > I want to deploy 2 django sites in different subdirectories so I have: > > > > SetHandler python-program > PythonHandler django.core.handlers.modpython > SetEnv DJANGO_SETTINGS_MODULE admin.settings > Pyth

Re: django deploy problem

2009-09-11 Thread Kenneth Gonsalves
On Friday 11 Sep 2009 2:22:10 pm lfrodrigues wrote: > When I go to http://host/admin/url/whatever sometimes sometimes it > works ok, sometimes I get a "page no found" error from the other > application " Using the URLconf defined in webservice.urls, ... " > > Any ideas why the applications are ove

django deploy problem

2009-09-11 Thread lfrodrigues
Hi, I want to deploy 2 django sites in different subdirectories so I have: SetHandler python-program PythonHandler django.core.handlers.modpython SetEnv DJANGO_SETTINGS_MODULE admin.settings PythonDebug On PythonOption django.root /admin SetHandler

questions about django-ratings

2009-09-11 Thread andreas schmid
hi , i have a few questions about how to use django-ratings but i dont really understand a few things: from djangoratings import RatingField class MyModel(models.Model): rating = RatingField(range=5) # 5 possible rating values, 1-5 that part is clear! then it comes to adding