Re: Subdomain/Accounts

2010-12-29 Thread Andy Shaw
Tim's solution would obviously work, but it sounds to me like you would need to manually configure a subdomain (including a copy of settings.py) for each user. Widoyo's solution (or rather, Ross Poulton's linked solution) would also work but requires quite a lot of boilerplate code in your view

Re: interaction of django with paypal

2009-08-30 Thread Andy Shaw
orschiro wrote: > Well and that is also the problem with my solution. Everyone who knows > the URL can download the data without to pay before. > > What I'm now looking for is a possibility to inquire whether the > customer has paid before he was visiting the download page. Whilst you could check

Re: How to find out id of the first record?

2006-03-08 Thread Andy Shaw
Andy Shaw wrote: > lowest ID, or you can write a custom SQL query to do the same thing. I > don't know if Django currently has a built-in feature to let you do > this, though it is possible that the database will return the records in Julio Nobrega wrote: > first_record

Re: How to find out id of the first record?

2006-03-08 Thread Andy Shaw
PythonistL wrote: > Hi, > is there a way how to find out id of the first record in a table? > I will explain what I mean. > When I insert the first record into a table the id is 1. > when I insert next record, the id for this record will be 2. > But if I delete the first record, the id of the firs

Extending admin privileges

2006-01-23 Thread Andy Shaw
Hi all, Quick query: is there an easy way to limit staff users so that they can only alter records that belong to them? Specifically, so that only their own records show up in the admin interface. All the relevant models have an owner field that points to the correct user (via an intermediary mod

Re: Managing static media urls

2006-01-14 Thread Andy Shaw
Amit Upadhyay wrote: > Static files are best served by basic http servers and not django. > Django tries to support serving static files, but that is only for > convenience in development. Just now I finished deploying a django > project under mod_pythong/apache, and my approach was to setup a /s

debug tag

2005-11-28 Thread Andy Shaw
Can anyone give me any pointers on where to look for the {% debug %} template tag implementation? For some reason, it's neither working within my template (it's actually causing an unrecognised tag error) and it doesn't show up in the admin tag docs, either. (nb: I'm using the current develo

Re: site url

2005-10-20 Thread Andy Shaw
Kenneth Gonsalves wrote: hi, i know it must be somewhere, but cant find it. How do you refer to the site url in a template? Say my css file is in http://mysite.com/css/layout.css, to make this portable i would have to make the template as: {{ site_url }}/css/layout.css. how do i do this?

Model subclass accessing parent instances?

2005-10-04 Thread Andy Shaw
Hi all; I'm experimenting with subclassing models at the moment. Specifically, I'm trying to add an optional element to the user class. The following code works fine: from django.core import meta from django.models.auth import User class MyUser(User): about = meta.TextField(blank=Tr

Re: CSS and PNG files in templates

2005-08-23 Thread Andy Shaw
Jacob Kaplan-Moss wrote: The point is that serving media from Django is a Bad Idea(tm), and one of the philosophies behind Django is that we want to make it easier to do the right thing than to do the wrong thing. I'm not going to go into why serving media from an application server is bad

Re: CSS and PNG files in templates

2005-08-23 Thread Andy Shaw
Bryan L. Fordham wrote: Sure it's useful. It's not unusual at all to have static content served from a server that's designed for that (ie apache) even when you're running a very expensive app server such as weblogic. Okay, I was exaggerating somewhat. But as I see it, there are three basic

Re: CSS and PNG files in templates

2005-08-23 Thread Andy Shaw
Sam Newman wrote: Or more simply put, the Django web server doesn't serve your media (e.g. images, PNG, CSS) and there isn't a plan to (the related ticket is marked as WONTFIX). Which majorly blows IMHO. Yeah, that's slightly more to-the-point! It does seem somewhat contradictory to refuse t

Re: CSS and PNG files in templates

2005-08-22 Thread Andy Shaw
Krzysztof Drozd wrote: hi i hawe make a template 'base.html' and i use it in my apps. but 'base.html' use CSS and PNG files. my app template use 'base.html' but can't find my CSS and PNG files. what can i do? what in settings/template shuld i wrote? a example... kd. You either need to s

Re: Concurrent applications

2005-08-18 Thread Andy Shaw
Matthew Marshall wrote: For dynamic data that you need on every page, I would make a custom template tag. Check this out for how to do it: http://code.djangoproject.com/file/djangoproject.com/django_website/apps/blog/templatetags/latestblogentry.py MWM As it happens, I've just finished doin

Concurrent applications

2005-08-17 Thread Andy Shaw
Is there any easy way to have two or more applications run simultaneously? Having created one fully-working application, which provides content for part of my site, I now want to construct another which will provide site-global menus and other such features. However, I see no easy way of working t