Question

I'm working fine with dajaxice.

Now, I want to use dajax. I installed it, and I put

<script type="text/javascript" src="{% static 'dajax/jquery.core.js' %}"></script>

that line is changed as

<script type="text/javascript" src="/static/dajax/jquery.core.js"></script>

But there is no js file in that location.

Did I missed somthing? where is usually that js file?

I think this is caused by url.py setting, since if I check that url, I can see url error page from django.

--- edited

When I run -- manage.py collectstatic -- following is log.

You have requested to collect static files at the destination
location as specified in your settings.

This will overwrite existing files!
Are you sure you want to do this?

Type 'yes' to continue, or 'no' to cancel: yes
Copying '/var/folders/8w/w7cl5wvx1kvd1vkgz83179j00000gn/T/tmpXouwqg'

1 static file copied, 79 unmodified.

In my opinion, 1 static file is just dajaxice file, not dajax file. ( I vi-ed that file )

Was it helpful?

Solution 2

I answered myself.

Dajax document is not currently supported and not updated.

The dajax file is not 'jquery.js' or somthing, it is, jquery.dajax.core.js.

I googled and found many programmer asked about it, but no answer.

Checking dajax directory in project App, then you will find jquery.dajax.core.js file.

Not jquery.core.js as dajax document said.

OTHER TIPS

By default, Django will not serve static files unless it is in debug mode (in settings.py, set DEBUG=True, setting this will have a series of other insecure implications). However, it provides you a management command for you to collect the static files to a central location (./manage.py collectstatic), then you could configure your web server to serve those files directly, without going through the Django framework.

The collectstatic command will collect the static files from all the apps installed (and any files specified in the settings STATICFILES_DIRS) to the directory specified in STATIC_ROOT, assuming that the URL as the setting STATIC_URL.

For more information, please take a look on these pages from Django document: https://docs.djangoproject.com/en/1.3/howto/static-files

https://docs.djangoproject.com/en/1.3/ref/contrib/staticfiles/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top