Re: django not reading css after switch to apache

2008-11-11 Thread Keith Eberle
You can add an alias in the directive that maps to where the admin media files are. Like so: Alias /media /home/dev//Django-1.0/django/contrib/admin/media keith On Tue, Nov 11, 2008 at 2:15 PM, prem1er <[EMAIL PROTECTED]> wrote: > > This is the location of my css files. /home/dev//Django-1.

Re: django not reading css after switch to apache

2008-11-11 Thread Keith Eberle
nHandler django.core.handlers.modpython >SetEnv DJANGO_SETTINGS_MODULE xxx.settings >PythonDebug On >PythonPath "['/home/dev/djprojects'] + sys.path" > > > > On Nov 11, 2:29 pm, "Keith Eberle" <[E

Re: django not reading css after switch to apache

2008-11-11 Thread Keith Eberle
orry that extra slash was removed and yes I did reload apache and > clear my cache on the browser. > > On Nov 11, 3:09 pm, "Keith Eberle" <[EMAIL PROTECTED]> wrote: > > Alias /media /home/dev//Django-1.0/django/contrib/admin/media > >

Re: what's wrong with the djangoadmin tool of mine

2008-08-26 Thread Keith Eberle
The static media files aren't getting served properly. Are you using the development server or Apache in your screenshot? keith On Tue, Aug 26, 2008 at 9:01 PM, App Engine <[EMAIL PROTECTED]> wrote: > look,please, > I don't konw why the django admin display like this.[attach] > > > ubuntu apach

Re: what's wrong with the djangoadmin tool of mine

2008-08-26 Thread Keith Eberle
ysqldb > > I install django follow the guide but when I finish it ,I found the admin > tool can't display the static files.like img and css > > On Wed, Aug 27, 2008 at 9:09 AM, Keith Eberle <[EMAIL PROTECTED]>wrote: > >> The static media files aren't gett

Re: what's wrong with the djangoadmin tool of mine

2008-08-26 Thread Keith Eberle
! * > ** > *Karen Tracey and Keith Eberle , Thank you! > * > On Wed, Aug 27, 2008 at 9:48 AM, Keith Eberle <[EMAIL PROTECTED]>wrote: > >> Django by default does not serve out static content (Javascript, CSS, >> images, etc) because the web server, such as Apache, i

Re: intpoint filter

2008-08-28 Thread Keith Eberle
I use similar functions for some of my template filters, but I use locale instead. import locale locale.setlocale(locale.LC_ALL, '') def whole_currency(value): return locale.format_string("$%0.f", value, grouping=True) def decimal_currency(value): return locale.format_string("$%0.2f", va

Re: ***SPAM*** A trick to force autoreloading, in case of changes in views.py

2008-09-12 Thread Keith Eberle
i don't think he marked it as spam, but rather "spam assassin" did... keith On Fri, Sep 12, 2008 at 10:47 AM, n00m <[EMAIL PROTECTED]> wrote: > > > This way I don't need to change any code > > Seems you absolutely misunderstand what I was talking about but > you dared, in bold manner, to label

Re: Setting up Admin on Fedora 9

2008-09-12 Thread Keith Eberle
The path to the admin media files is: ../site-packages/django/contrib/admin/media If you did not touch ADMIN_MEDIA_PREFIX in your project's settings.py, it should be '/media/' All you have to do is create a link. For Ubuntu, it would look like this: $ ln -s /usr/lib/python2.5/site-pack

Re: Admin: design question

2008-09-13 Thread Keith Eberle
Maybe you can do something similar to what's in this post (using queryset): http://groups.google.com/group/django-users/browse_thread/thread/c59b3807631d2914/a07cabfb4725447d?lnk=gst&q=restrict+users+to+their+own+data#a07cabfb4725447d keith On Sat, Sep 13, 2008 at 10:30 AM, Gertjan Klein <[EMAIL

Re: Making sure published date is respected in views

2008-09-13 Thread Keith Eberle
Building on Marcelo's response, and an example from James Bennett's book (Ch 5), you could also add a custom manager. It'd go something like this: class PublishedEntryManager(models.Manager): def get_query_set(self): return super(PublishedEntryManager, self).get_query_set().filter(pub_date_

Re: How do I get the domain the application is running on?

2008-09-17 Thread Keith Eberle
You can use the django.contrib.sites application, which is listed in INSTALLED_APPS by default, for this. Here's something to show how to use it. from django.contrib.sites.models import Site def get_domain(): return Site.objects.get_current().domain You just need to update the domain name in

Re: Extra space in the match string

2008-09-24 Thread Keith Eberle
the space indicates passing the URL off to an included urls.py. keith On Wed, Sep 24, 2008 at 8:28 AM, bruno desthuilliers < [EMAIL PROTECTED]> wrote: > > > > On 24 sep, 13:03, tsmets <[EMAIL PROTECTED]> wrote: > > I am refactoring my URL matching configuration file and I get this : > > [snip]

Re: unable to resolve URL in template

2008-09-28 Thread Keith Eberle
i the same problem the other day... i was using the name "search" for my named url. i dropped in the the python interpreter and tried it there, failed. i tried some other named urls in the same urls.py, and they worked. i didn't look at it long and just moved onto another piece of the project..

Re: How to invoke a request to an URL inside a web app without making a real request?

2008-09-30 Thread Keith Eberle
sure can! take a look @ http://docs.python.org/lib/module-urllib.html keith On Tue, Sep 30, 2008 at 8:00 PM, maverick <[EMAIL PROTECTED]> wrote: > > Hi, I have a django web application, I want to invoke a request of one > URL inside this application, e.g. "/getdata/", and capture the output >

Re: SlugField & prepopulate_from

2008-09-30 Thread Keith Eberle
Yea... I didn't know for sure, but I thought it used to. That's why I asked. I wonder why that functionality wasn't there by default... keith On Tue, Sep 30, 2008 at 9:22 PM, Karen Tracey <[EMAIL PROTECTED]> wrote: > On Tue, Sep 30, 2008 at 2:41 PM, lingrlongr <[EMAIL PROTECTED]>wrote: > >> >

Re: SlugField & prepopulate_from

2008-10-01 Thread Keith Eberle
populate_fields" for that matter. But the lack of clarity seems to suggest always... keith On Wed, Oct 1, 2008 at 11:01 AM, Carl Meyer <[EMAIL PROTECTED]> wrote: > > On Sep 30, 9:27 pm, "Keith Eberle" <[EMAIL PROTECTED]> wrote: > > Yea... I didn't know f

Re: TabularInline Template

2008-10-01 Thread Keith Eberle
something like this seems to work: {{ field.field.form.initial.name }} keith On Wed, Oct 1, 2008 at 11:28 AM, lingrlongr <[EMAIL PROTECTED]> wrote: > > I want to show a formset as just text in a table in the admin. So I'm > trying to override the tabular.html template. How can I just extract

Re: Dumb question about "Limiting Access to Generic Views"

2008-10-03 Thread Keith Eberle
The view function should look something like this: from django.views.generic.list_detail import object_list @login_required def xxx(request): return object_list( request, queryset=MyObject.objects.all(), ) Pass in other parameters necessary, like template_name, etc... k

Re: Regex pattern for URL matching

2008-10-06 Thread Keith Eberle
it looks like you have mismatched parens, and no trailing slash, which will matter if APPEND_SLASH = True. the regex should look like: r'^find/(?P[-\w]+)/$' should be urls.py too, not views.py. keith On Mon, Oct 6, 2008 at 1:17 PM, Merrick <[EMAIL PROTECTED]> wrote: > > I am trying to fi

Re: Regex pattern for URL matching

2008-10-06 Thread Keith Eberle
.wired.com%2F > > > > > I still get > > > > > Not Found > > > > > The requested URL /find/http://www.wired.com/wasnot found on this > > > server. > > > > > I did figure out how to decode the URL in python using unquote_plus(), > >

Re: Django Admin - Does not see templates, images or templates.

2008-10-06 Thread Keith Eberle
ADMIN_MEDIA_PREFIX is set incorrectly. It should be a URL, not a filesystem path. If you want the admin media files served at http://myhost.com/media/, set the value to '/media/' (which is the default). To serve the admin media, just create a softlink to the admin media files on disk in your we

Re: Development server serves media from wrong directory

2008-10-09 Thread Keith Eberle
you need to change these: #from settings.py MEDIA_ROOT = 'D:/workspace/isiscore/media/' MEDIA_URL = '/site_media/' ADMIN_MEDIA_PREFIX = '/media/' #from urls.py from django.conf import settings (r'^media/(?P.*)$', 'django.views.static.serve', { 'document_root': settings.MEDIA_URL, 'show_indexes':

Re: Development server serves media from wrong directory

2008-10-09 Thread Keith Eberle
ll settings are currently exactly as you outlined above. > > Kind regards, > Robert > > > On Oct 9, 1:45 pm, "Keith Eberle" <[EMAIL PROTECTED]> wrote: > > you need to change these: > > > > #from settings.py > > MEDIA_ROOT = 'D:/workspace/is

Re: Development server serves media from wrong directory

2008-10-09 Thread Keith Eberle
hould my urls.py then be r'^site_media/$'? I fail to > understand the role it plays in all this. > > Thanks again for your replies. > > Kind regards, > Robert > > On Oct 9, 3:35 pm, "Keith Eberle" <[EMAIL PROTECTED]> wrote: > > Correct, they can't

Re: current user

2008-10-14 Thread Keith Eberle
ah yes, threadlocals... i was thinking maybe there was a newer way. its nice how you can override the queryset method of a ModelAdmin class because that gets passed a request. I was hoping there'd be some similar new functionality with the ModelForm class... thx keith On Tue, Oct 14, 2008 at

Re: current user

2008-10-14 Thread Keith Eberle
model(self, request, obj, form, change): keith On Tue, Oct 14, 2008 at 4:20 PM, James Bennett <[EMAIL PROTECTED]>wrote: > > On Tue, Oct 14, 2008 at 3:17 PM, Keith Eberle <[EMAIL PROTECTED]> > wrote: > > ah yes, threadlocals... i was thinking maybe there was a newer way.

Re: Using Tutorial

2008-10-15 Thread Keith Eberle
Did you name your project "MySite" or "mysite". There is a difference... keith On Wed, Oct 15, 2008 at 10:55 AM, maumir <[EMAIL PROTECTED]> wrote: > > I'm to start using the tutorial but during the steps about 'Writing > your first Django app, part 1', specifically in 'Activating models' > th

Re: Admin won't display datetime widget with custom form?

2008-10-17 Thread Keith Eberle
I had a project where I needed to set the initial value to the current week's week ending date (Sat), so I needed a custom form too. I used the AdminDateWidget, but I think this will be the correct widget for your needs. # import the widgets from django.contrib.admin import widgets # use the wid

Re: Admin won't display datetime widget with custom form?

2008-10-17 Thread Keith Eberle
]> wrote: > > Thanks Keith, that worked perfectly. Can you tell me the reason I have > to use the admin widgets and can't use regular form widgets as I might > with any other form? > > > > On Oct 17, 7:11 am, "Keith Eberle" <[EMAIL PROTECTED]> wrote: > &

Re: Named URL Patterns

2008-10-18 Thread Keith Eberle
i think you may need to "name" the argument. For example: url(r'^$', list_detail.object_list, {'queryset': Project.objects.all()}, name='project-home'), keith On Fri, Oct 17, 2008 at 4:59 PM, Karen Tracey <[EMAIL PROTECTED]> wrote: > On Fri, Oct 17, 2008 at 3:30 PM, dkadish <[EMAIL PROTECTED]