Hi Djangonauts™,
Have you seen
http://uncyclopedia.org/wiki/Django
and especially
http://uncyclopedia.org/wiki/Django_gods
? ROFL
--
Carlo C8E Miron, ICQ #26429731
--
Disclaimer:
If I receive a message from you, you are agreeing that:
1. I am by definition, "the intended recipient".
2. All inform
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
On 10/5/05, JKR <[EMAIL PROTECTED]> wrote:
>
> i'm able to see tags, filter and models. but nothing under view? is
> this normal when I'm using generic view.
View info only shows up if you have added the setting:
ADMIN_FOR = ['myproject.settings.main']
which lists the settings files for the sit
Some examples of use (mis-use?) cases for making settings accessible to
templates:
1. To avoid hard coding media url domains in your templates when you're
moving between different test and production server setups.
2. To use, for example, the ADMIN_EMAIL setting in a generic error
template that
Thanks for the helps,
No link from admin page, but i got it work under /admin/doc/ link. it
required a python-docutils installed in order to view this page.
i'm able to see tags, filter and models. but nothing under view? is
this normal when I'm using generic view.
Johny
Adrian Holovaty wrote:
Right now, there's no other way to get to MEDIA_URL, because it's
intended to be used only by the FileFields. Out of curiosity, what's
your use case for using it otherwise?
For the same thing that admin site uses admin_media: referencing
stylesheets and javascripts.
I either do something like this:
---
class SettingsNode(Node):
def render(self, context):
from django.conf import settings
context['settings'] = settings
return ''
def do_put_settings(parser, token):
"""
Put the site settings into the context as 'settings'.
Usa
On 10/4/05, Maniac <[EMAIL PROTECTED]> wrote:
> What's the recommended (if any) way to reference MEDIA_URL defined in
> settings file from templates?
MEDIA_URL is used by all FileFields to give their objects a
get_FOO_url() method. See this page:
http://www.djangoproject.com/documentation/db_api
On 10/4/05, Jacob Kaplan-Moss <[EMAIL PROTECTED]> wrote:
> On Oct 4, 2005, at 8:42 AM, Andreas wrote:
> > What's the best way to check if a user is logged in on every page
> > (read: view) of a website? I'd like to be able to display the username
> > in the template if a user is logged in. At the
Matt wrote:
good question. looking at the {% debug %} output I'd hoped that this
would work:
{{ myproject.settings.main.MEDIA_URL }}
It doesn't look to me that it should... Those modules in debug aren't in
a Context, they are in a different dict that I suspect is not available
outside of
good question. looking at the {% debug %} output I'd hoped that this
would work:
{{ myproject.settings.main.MEDIA_URL }}
but it doesn't output for me.
On Oct 4, 2005, at 3:20 PM, JKR wrote:
In the template guide, there is a statement that referring to feature
in administration interface.
"""
Because Django can be used to develop any sort of site, the tags,
filters and variables available are different depending on the
application. To make it
On Oct 4, 2005, at 8:42 AM, Andreas wrote:
What's the best way to check if a user is logged in on every page
(read: view) of a website? I'd like to be able to display the username
in the template if a user is logged in. At the moment, I'm using the
following code:
If you use django.core.extens
Hi,
In the template guide, there is a statement that referring to feature
in administration interface.
"""
Because Django can be used to develop any sort of site, the tags,
filters and variables available are different depending on the
application. To make it easy to figure out what's available
What's the recommended (if any) way to reference MEDIA_URL defined in
settings file from templates?
Admin site uses custom template tag for it. Is there anything similar
for general usage in projects?
What's the best way to check if a user is logged in on every page
(read: view) of a website? I'd like to be able to display the username
in the template if a user is logged in. At the moment, I'm using the
following code:
# Helper function:
def get_user(request):
try:
user = users.ge
Adrian Holovaty wrote:
> Oooh, that's a good idea. Django already displays the __repr__() of
> the corresponding record on the *change* page, but it'd be nice to do
> it automatically (via Ajax) right after the field is populated on the
> add page (or changed on the change page).
Yup... I notice
17 matches
Mail list logo