I am using django 0.96 for the appengine project. I wanted to use javascript and css in my html files unfortunately i am unable to do it via django... One solution(which i don't like) is to make my app.yaml something like this:
handlers:
- url: /media
static_dir: static/media
But i want it to do with django itself so i avoided using the above line and hence am seeking a "django" way of doing it. The directory structure of my project is like(not complete just the relevants project /myapp /static /media /css /js /images settings.py app.yaml
and a sample template file header is:
<link type="text/css" href="/media/css/ui-lightness/jquery-ui-1.7.1.custom.css" rel="Stylesheet" />
<script type="text/javascript" src="/media/js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="/media/js/jquery-ui-1.7.1.custom.min.js">$('#date').datepicker();</script>
the settings.py has:
MEDIA_ROOT = os.path.join(os.path.dirname(__file__), 'static')
MEDIA_URL ='/media/'
TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
os.path.join(os.path.dirname(__file__), 'myapp/templates'),
os.path.join(os.path.dirname(__file__), 'static'),
)
I know i am making a mistake in the headers or setting because when i use absolute url like:
then atleast the css works. The solution exists to do it with app.yaml(as i mentioned above) but i wanted to do it from django itself. Any hints? Thanks