Re: custom attributes of model field

2011-12-10 Thread trubliphone
Actually, I wound up doing this a bit differently due to some other
constraints in my application.  For what it's worth, I thought I'd
reply to myself.

Using your example as a guide, I came up with the following:

I defined some classes to store a set of field types:


from collections import deque

class FieldType(object):
def __init__(self, type=None, name=None):
self._type = type
self._name = name

def getType(self):
return self._type

def getName(self):
return self._name

class FieldTypeList(deque):
def __getattr__(self,type):
for ft in self:
if ft.getType() == type:
return ft
raise AttributeError

FieldTypes = FieldTypeList([FieldType("ONE","The Name Of Field
One"),FieldType("TWO","The Name Of Field Two")])


And a few models each of which has a set of mappings from field types
to particular field names:


class ParentModel(models.Model):
  _fieldsByType = {}

  a = models.CharField()
  b = models.CharField()

  def __init__(self, *args, **kwargs):
  super(ParentModel, self).__init__(*args, **kwargs)
  for ft in FieldTypes:
self.setFieldsOfType(ft, [])
  self.setFieldsOfType(FieldTypes.ONE, ['a','b'])

  def setFieldsOfType(self,type,fields):
typeKey = type.getType()
if typeKey in self._fieldsByType:
  self._fieldsByType[typeKey] += fields
else:
  self._fieldsByType[typeKey] = fields

class ChildModel(ParentModel):
  _fieldsByType = {}   # not really sure why I have to repeat this
attribute in the derived class

  c = models.CharField()
  d = models.CharField()

  def __init__(self, *args, **kwargs):
super(ChildModel, self).__init__(*args, **kwargs)
self.setFieldsOfType(FieldTypes. ['c'])
self.setFieldsOfType(FieldTypes. ['d'])


I have a basic form:


class MyForm(forms.ModelForm):
  class Meta:
model = ChildModel


And a custom filter to return all fields of a given type from a
particular form:


@register.filter
def getFieldsOfType(form,type):
return form.Meta.model._fieldsByType[type.getType()]


And, finally, a template to pull it all together (the template takes
MyForm and FieldTypes):


  {% for type in types %}

  {% with fieldsOfType=form|getFieldsOfType:type %}
{% for field in form %}
  {% if field.name in fieldsOfType %}
{{ field }}
  {% endif %}
{% endfor %}
  {% endwith %}

  {% endfor %}


And this, finally, works.  It sticks fields 'a', 'b', and 'c' into a
div with id="ONE" and field 'd' into a div with id="TWO".

On Dec 7, 3:16 pm, trubliphone  wrote:
> Thanks very much for this.
>
> This looks very promising.  And I know that it may seem inappropriate
> to mix presentation logic with application logic, but I plan on doing
> other things on themodelbased on thesefieldtypes.  So your second
> example should fit well.
>
> On Dec 7, 1:22 am, Doug Ballance  wrote:
>
>
>
>
>
>
>
> > Just to clarify that last bit about a mapping on themodelsince it's
> > closest to what you originally described.  Just pseudo-code, but you
> > can see the idea.
>
> > class Model1(models.Model):
> >    FIELD_DISPLAY={
> >       'foo': ['a'],
> >       'bar': ['b','c']
> >    }
> >    a = models.CharField()
> >    b = models.ForeignKey('Model2')
> >    c = models.IntegerField()
>
> > {% forfieldin form|field_type:"foo" %}{{field}}{% endfor %}
> > {% forfieldin form|field_type:"bar" %}{{field}}{% endfor %}
>
> > @register.filter
> > def form_field(form,key):
> >     fields=form.Meta.model.FIELD_DISPLAY[key]
> >     return [form.fields[fn] for f in fields]

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: List of Django release dates?

2011-12-10 Thread James Bennett
On Sun, Dec 11, 2011 at 12:26 AM, Peter Herndon  wrote:
> The info is available in the Django project blog
> (https://www.djangoproject.com/weblog/), though you will need to do
> some spelunking to find the release dates. You can also find the
> release dates in the mailing list archives, for example, search for
> "released" in the Django-developers Google group.

Or just view this handy all-in-one page:

https://code.djangoproject.com/log/django/trunk/django/__init__.py

:)


-- 
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: List of Django release dates?

2011-12-10 Thread Peter Herndon
The info is available in the Django project blog
(https://www.djangoproject.com/weblog/), though you will need to do
some spelunking to find the release dates. You can also find the
release dates in the mailing list archives, for example, search for
"released" in the Django-developers Google group.

On Sat, Dec 10, 2011 at 11:52 PM, Tim Chase
 wrote:
> After a bit of googling around, I was unable to come up with a catalog of
> release dates for various versions.  I was mostly just interested in things
> like
>
>  for release in "0.95 0.96 1.0 1.1 1.2 1.2.6 1.3".split():
>    print release, get_release_year_and_month(release)
>
> sort of information, though point information would be interesting rather
> than noise (such as security fixes on older versions, e.g. 1.2.6).
>
> Is this info readily available in some place my Googling couldn't find?  Or
> do I have to do a bit of wading in Subversion to extract this info?
>
> Thanks,
>
> -tkc
>
>
> --
> 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
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



List of Django release dates?

2011-12-10 Thread Tim Chase
After a bit of googling around, I was unable to come up with a 
catalog of release dates for various versions.  I was mostly just 
interested in things like


  for release in "0.95 0.96 1.0 1.1 1.2 1.2.6 1.3".split():
print release, get_release_year_and_month(release)

sort of information, though point information would be 
interesting rather than noise (such as security fixes on older 
versions, e.g. 1.2.6).


Is this info readily available in some place my Googling couldn't 
find?  Or do I have to do a bit of wading in Subversion to 
extract this info?


Thanks,

-tkc


--
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: converting from function based views to class based views

2011-12-10 Thread Reinout van Rees

On 10-12-11 21:40, Jake Richter wrote:

I'm working through this tutorial
http://www.webmonkey.com/2010/02/Use_URL_Patterns_and_Views_in_Django/

It's written for Django 1.0 and I'm using 1.3 which has changed to
class based views. I'm having a hard time converting from function
based to class based. Can anyone offer help on how to change the
following to class based views?


I've written a blog post with an old-style function view and a new class 
based one next to each other:


http://reinout.vanrees.org/weblog/2011/08/24/class-based-views-usage.html

Does that article give you enough hints?


Reinout

--
Reinout van Reeshttp://reinout.vanrees.org/
rein...@vanrees.org http://www.nelen-schuurmans.nl/
"If you're not sure what to do, make something. -- Paul Graham"

--
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: DateTimeField(auto_now_add=True) and admin page

2011-12-10 Thread DC
Hello Amit,

Yes, this is solution - I wanted those fields to be shown in admin, I
understand they're read-only. So, I put this in EcoPointAdmin and it
works:

readonly_fields = ['entry_date', 'last_change_date']

Thank you.

On Dec 10, 2:23 pm, Amit  wrote:
> Hi,
>
> You can display entry_date on admin by using readonly attribute of
> admin.
> Set readonly = (entry_date,) this will do your task, but You cannot
> modify this on admin.
>
> Thanks
> Amit
>
> On Dec 9, 7:46 pm, DC  wrote:
>
>
>
>
>
>
>
> > Hi,
>
> > I have the following lines in my model:
> >     entry_date = models.DateTimeField(auto_now_add=True)
> >     pub_date = models.DateTimeField('date published', blank=True,
> > null=True)
> >     last_change_date = models.DateTimeField(auto_now=True)
>
> > Basically, I want the entry date to be added automatically, and last
> > change date to be updated on every save(), just as described in
> > documentation. The problem is that those fields don't appear on the
> > admin page. I tried with explicitly setting those fields in my admin
> > class, per Tutorial:
>
> > class EcoPointAdmin(admin.ModelAdmin):
> >     fieldsets = [
> >         ('Details', {'fields': ['title', 'description', 'type',
> > 'status']}),
> >         ('Geo data', {'fields': ['latitude', 'longitude']}),
> >         ('Dates', {'fields': ['entry_date', 'pub_date',
> > 'last_change_date']}),
> >     ]
>
> > But now I get the error shown below.
>
> > Any chance to have those fields on admin page, without creating my
> > custom admin? I couldn't find anything useful in the archives.
>
> > Thanks,
> > DC, Django novice
>
> > The error msg:
>
> > ImproperlyConfigured at /admin/ecopoint/ecopoint/3/
>
> > 'EcoPointAdmin.fieldsets[2][1]['fields']' refers to field 'entry_date'
> > that is missing from the form.

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



converting from function based views to class based views

2011-12-10 Thread Jake Richter
Hi group,

I'm working through this tutorial
http://www.webmonkey.com/2010/02/Use_URL_Patterns_and_Views_in_Django/

It's written for Django 1.0 and I'm using 1.3 which has changed to
class based views. I'm having a hard time converting from function
based to class based. Can anyone offer help on how to change the
following to class based views?

#urls.py

urlpatterns = patterns('',
  url(r'^admin/', include(admin.site.urls)),
(r'^blog/', include('djangoblog.blog.urls')),
(r'^tags/(?P[a-zA-Z0-9_.-]+)/$', 
'djangoblog.tag_views.tag_detail'),
)


#blog/urls.py
from django.conf.urls.defaults import *
from djangoblog.blog.models import Entry
from tagging.views import tagged_object_list

info_dict = {
'queryset': Entry.objects.filter(status=1),
'date_field': 'pub_date',
}

urlpatterns = patterns('django.views.generic.date_based',

(r'(?Pd{4})/(?P[a-z]{3})/(?Pw{1,2})/(?P[-w]+)/$',
'object_detail', dict(info_dict,
slug_field='slug',template_name='blog/detail.html')),

(r'^(?Pd{4})/(?P[a-z]{3})/(?Pw{1,2})/(?P[-w]+)/$',
'object_detail', dict(info_dict, template_name='blog/list.html')),

(r'^(?Pd{4})/(?P[a-z]{3})/(?Pw{1,2})/$','archive_day',dict(info_dict,template_name='blog/list.html')),
(r'^(?Pd{4})/(?P[a-z]{3})/$','archive_month',
dict(info_dict, template_name='blog/list.html')),
(r'^(?Pd{4})/$','archive_year', dict(info_dict,
template_name='blog/list.html')),
(r'^$','archive_index', dict(info_dict, 
template_name='blog/list.html')),
)

# views.py
from django.views.generic.list_detail import object_detail
from tagging.models import Tag,TaggedItem
from blog.models import Entry

def tag_detail(request, slug):
unslug = slug.replace('-', ' ')
tag = Tag.objects.get(name=unslug)
qs = TaggedItem.objects.get_by_model(Entry, tag)
return object_list(request, queryset=qs, extra_context={'tag':slug},
template_name='tags/detail.html')

Thanks!
- Jake

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: 404 only in Chrome

2011-12-10 Thread neridaj
I think it might be related to a jquery plugin i'm using. It appears
that the plugin is not finding an attribute on an image, and is
therefore appending the undefined status to the url in developer
tools. If I comment out the plugin the error is gone.

On Dec 10, 7:36 am, Tomasz Zieliński
 wrote:
> Can it be a browser caching 
> issue:http://www.google.pl/support/forum/p/Chrome/thread?tid=3bb0a94bfb0637...
>  ?
>
> Best,
> Tomasz Zielinski

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Redirect from get_queryset() in a class view?

2011-12-10 Thread Eli Criffield

So in a class based view inheriting generic.ListView I want to redirect on 
a condition, The logical place to do it is get_queryset, but you can't go 
returning a HttpResponseRedirect from a method that should return a query 
set. The django.shortcuts.redirect() just kinda does that for you so that 
doesn't work either. I can raise a  Http404 from inside get_queryset, but 
not something like raise Redirect('url/').

I saw one answer to the problem where you put the condition 
in render_to_response but that'll gets called after get_queryset. I guess 
the other option is to put the condition in get and check there and return 
redirect. But that seems hacky.

I'm just wonder whats the best way to do this.

Eli Criffield

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/pyY9hQ7iCPAJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: 404 only in Chrome

2011-12-10 Thread Tomasz Zieliński
Can it be a browser caching issue: 
http://www.google.pl/support/forum/p/Chrome/thread?tid=3bb0a94bfb063745=en
 ?

Best,
Tomasz Zielinski

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/YXHy-SR-m0cJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: 404 only in Chrome

2011-12-10 Thread Bruno Tikami
Hi,

don't know if that helps but when I was working with app engine there were
errors that would only occur while using the "Incognito" windows.

Cheers,

Tkm

On Fri, Dec 9, 2011 at 11:52 PM, neridaj  wrote:

> Thanks for the reply but that didn't help.
>
> On Dec 9, 5:41 pm, Furbee  wrote:
> > In urls.py:
> >
> > Change:
> > (r'^portfolio/', include('project.urls.web')),
> >
> > To:
> > (r'^portfolio/$', include('project.urls.web')),
> >
> > The dollar sign makes it the end of the regular expression string.
> Without
> > it, /portfolio/ will match with /portfolio/funstuff,
> > /portfolio/?my_hax_rock, etc. See if that helps.
> >
> > Furbee
> >
> >
> >
> >
> >
> >
> >
> > On Fri, Dec 9, 2011 at 5:33 PM, neridaj  wrote:
> > > Hello,
> >
> > > For some reason I'm getting a 404 in google chrome when I visit /
> > > portfolio/. The url entered is /portfolio/ but it returns as a 404 at /
> > > portfolio/undefined/ in the chrome developer tools window. I read a
> > > post about some issues with chrome handling errors and to resolve it
> > > by unchecking "Use a web service to help resolve navigation errors"
> > > but this didn't help with my problem. I'm not sure why undefined is
> > > being appended to the url, any ideas?
> >
> > > urls.py:
> >
> > > (r'^portfolio/', include('project.urls.web')),
> >
> > > project/urls/web.py:
> >
> > > urlpatterns = patterns('django.views.generic.list_detail',
> > >(r'^$', 'object_list', web_project_info_dict,
> > > 'project_web_archive_index'),
> > >(r'^(?P[-\w]+)/$', 'object_detail', web_project_info_dict),
> > > )
> >
> > > If it was a real 404 why isn't my error page displayed i.e., when I
> > > visit /portfolio/non-existent-slug, I get the proper 404 page.
> >
> > > >>> django.VERSION
> > > (1, 2, 0, 'alpha', 0)
> >
> > > Thanks for any help!
> >
> > > --
> > > 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
> > > django-users+unsubscr...@googlegroups.com.
> > > For more options, visit this group at
> > >http://groups.google.com/group/django-users?hl=en.
>
> --
> 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
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: What's the django convention for templates?

2011-12-10 Thread Torsten Bronger
Hallöchen!

Torsten Bronger writes:

> [...]  If someone wants to create a local variation of a template,
> he simply creates
>
> my_app_local/templates/my_app/my_view.html
>
> and puts my_app_local instead of my_app into INSTALLED_APPS.

Sorry, this was rubbish.  It must read: "... and puts my_app_local
before my_app into INSTALLED_APPS."

Tschö,
Torsten.

-- 
Torsten BrongerJabber ID: torsten.bron...@jabber.rwth-aachen.de
  or http://bronger-jmp.appspot.com

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: What's the django convention for templates?

2011-12-10 Thread Torsten Bronger
Hallöchen!

Mauro writes:

> [...]
>
> Following the djangobook I've build a projects who has the following 
> strurcture:
>
> projects |
>  ---
> | __init__.py
> | manage.py
> | settings.py
> | urls.py
>
> | app folder |
>  --
>| many files
>| templates |
> 
> | 
> index.php
>
> As you can see the templates directory is stored inside the app
> directory.

I go even one step further:

my_app/templates/my_app/my_view.html

This is redundant but it makes overriding of templates easier.  If
someone wants to create a local variation of a template, he simply
creates

my_app_local/templates/my_app/my_view.html

and puts my_app_local instead of my_app into INSTALLED_APPS.  This
way, you don't have to modify the original files.  This assumes that
you use django.template.loaders.app_directories.Loader in
TEMPLATE_LOADERS.

Tschö,
Torsten.

-- 
Torsten BrongerJabber ID: torsten.bron...@jabber.rwth-aachen.de
  or http://bronger-jmp.appspot.com

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: static file problem with modwsgi+ apache2 with django1.3

2011-12-10 Thread Jisson Varghese
@ Ramiro Morales Thank you for your response, *edit the configuration file
as you suggested ,But still am facing the problem.*
I have one doubt about the configuration
I used collectstatic command for static files,
STATIC_ROOT =
'/home/jisson/Desktop/testcloud.aws/DjangoApis/teststaticfiles/'
 STATIC_URL = '/static/'

Whether I add static or teststaticfiles in the last of following line now
am added  'static'

 Alias /static/ /home/jisson/Desktop/testcloud.aws/DjangoApis/static/


teststaticfiles - is the directory in my project where collect static
command collects and save all of my static contents.

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: What's the django convention for templates?

2011-12-10 Thread Mauro
Thank you :)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/LCxQRS7kTnkJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: static file problem with modwsgi+ apache2 with django1.3

2011-12-10 Thread Ramiro Morales
On Sat, Dec 10, 2011 at 7:01 AM, Jiss  wrote:
> Settings.py
> STATIC_ROOT = '/home/jisson/Desktop/testcloud.aws/DjangoApis/
> teststaticfiles/'

This is wrong (although it shouldn' t affect your apache+mod_wsgi deployment),
 per the tree structure you posted earlier, you don't have a teststaticfiles
directory.

>
> /etc/apache2/sites/enabled/DjangoApis:
>
> [...]
> Alias /static/ /home/jisson/Desktop/testcloud.aws/DjangoApis/static
> 
> Order deny,allow
> Allow from all
> 
>
> [...]
>
> apache errorlog:
> tail /var/log/apache2/error.log
> [Sat Dec 10 03:16:36 2011] [error] [client 127.0.0.1] File does not
> exist: /home/jisson/Desktop/testcloud.aws/DjangoApis/staticjs,
> referer: http://test.webapp/

Looks like you are missing a trailing / in the Alias definition. i.e.
it should read:

Alias /static/ /home/jisson/Desktop/testcloud.aws/DjangoApis/static/

(see https://docs.djangoproject.com/en/1.3/howto/deployment/modwsgi/)

but the fact that all the error log entries are about subdirectories
of the static dir (js, images) but no about actual static files is a
bit strange.

-- 
Ramiro Morales

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



static file problem with modwsgi+ apache2 with django1.3

2011-12-10 Thread Jiss
Hi all,
 I am new to django and web development. I am facing a problem
with static files(Django1.3) when tried to deploy it in my local
apache server(apache2+mod_wsgi),the problem only for the static
contents other parts ok[its worked in the devlopment server].
My project now in a folder 'testcloud' in Ubandu Desktop,My project
name is DjangoApis,Following is my project structure:
Desktop->testcloud:

DjangoApis
  urls.py
  mywebapp
 static
 templates
 templatetags
 urls.py
 views.py
  myapis
   .
Settings.py
STATIC_ROOT = '/home/jisson/Desktop/testcloud.aws/DjangoApis/
teststaticfiles/'
 STATIC_URL = '/static/'

TEMPLATE_CONTEXT_PROCESSORS = (
"django.core.context_processors.media",
"django.core.context_processors.static",
)

TEMPLATE_DIRS = (
os.path.join(os.path.dirname(__file__),'templates').replace('\
\','/'),
)
INSTALLED_APPS = (
'DjangoApis.mywebapp',
'DjangoApis.myapis',
)
STATICFILES_DIRS = (
  os.path.join(os.path.dirname(__file__),'static').replace('\
\','/'),
)
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
)

/etc/apache2/sites/enabled/DjangoApis:

Alias /favicon.ico /home/jisson/Desktop/testcloud.aws/DjangoApis/
static/favicon.ico
AliasMatch ^/([^/]*\.css) /home/jisson/Desktop/testcloud.aws/
DjangoApis/static/styles/$1
Alias /static/ /home/jisson/Desktop/testcloud.aws/DjangoApis/static

Order deny,allow
Allow from all

WSGIScriptAlias / /home/jisson/Desktop/testcloud.aws/DjangoApis/
django.wsgi

apache errorlog:
tail /var/log/apache2/error.log
[Sat Dec 10 03:16:36 2011] [error] [client 127.0.0.1] File does not
exist: /home/jisson/Desktop/testcloud.aws/DjangoApis/staticjs,
referer: http://test.webapp/
[Sat Dec 10 03:16:36 2011] [error] [client 127.0.0.1] File does not
exist: /home/jisson/Desktop/testcloud.aws/DjangoApis/staticjs,
referer: http://test.webapp/
[Sat Dec 10 03:16:36 2011] [error] [client 127.0.0.1] File does not
exist: /home/jisson/Desktop/testcloud.aws/DjangoApis/staticjs,
referer: http://test.webapp/
[Sat Dec 10 03:16:36 2011] [error] [client 127.0.0.1] File does not
exist: /home/jisson/Desktop/testcloud.aws/DjangoApis/staticjs,
referer: http://test.testapp/
[Sat Dec 10 03:16:45 2011] [error] [client 127.0.0.1] File does not
exist: /home/jisson/Desktop/testcloud.aws/DjangoApis/staticimages,
referer: http://test.webapp/
[Sat Dec 10 03:16:45 2011] [error] [client 127.0.0.1] File does not
exist: /home/jisson/Desktop/testcloud.aws/DjangoApis/staticimages,
referer: http://test.webapp/
[Sat Dec 10 03:16:45 2011] [error] [client 127.0.0.1] File does not
exist: /home/jisson/Desktop/testcloud.aws/DjangoApis/staticimages,
referer: http://test.webapp/
[Sat Dec 10 03:16:45 2011] [error] [client 127.0.0.1] File does not
exist: /home/jisson/Desktop/testcloud.aws/DjangoApis/staticimages,
referer: http://test.webapp/
[Sat Dec 10 03:16:45 2011] [error] [client 127.0.0.1] File does not
exist: /home/jisson/Desktop/testcloud.aws/DjangoApis/staticimages,
referer: http://test.webapp/
[Sat Dec 10 03:16:45 2011] [error] [client 127.0.0.1] File does not
exist: /home/jisson/Desktop/testcloud.aws/DjangoApis/staticimages,
referer: http://testwebapp/

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.