Failed to get Javascript Dajaxice syntax file

I searched everywhere to answer my questions for the past few hours and could not find anything, so I decided to ask.

I followed the installation instructions in the Dajaxice docs, getting all the settings at the same level, but unfortunately my Dajax.core.js file does not receive parsing, so when I click on the javascript link in the html page source, it is still contains template tags, I turned on Dajaxice search in staticfiles_finder (in fact, I have all the settings, as in the ins instruction.

I am using django 1.4.1 to develop the server at the moment for testing, and the latest version of Dajaxice, which is 0.9, is there any difference?

Does the order of var in settings.py mean?

What are the main reasons that Javascript files are not processed, and in fact, when should they be parsed?

Please help me, as I really would like to use this application, but just can't get it to work.

Thanks in advance.

+4
source share
1 answer

I advise you to check the STATICFILES_FINDERS settings and other parameters related to the django.contrib.staticfiles application. Dajaxice uses the hook in this application to generate the dajaxice.core file.

When you use the debug server, this static file is generated on the fly; in a production environment, the file is generated when the collectstatic command is run.

In your case, it looks like the dajaxice.core.js file is created by another static dajaxice.core.js or served in any other way.

To verify this, run the following command

 python manage.py findstatic dajaxice/dajaxice.core.js 

The result should look like

 Found 'dajaxice/dajaxice.core.js' here: /tmp/tmp9nzeEd 

The file name in tmp dir will be different

Also 2 traps with a collective static application:

  • When you update your ajax.py file to include new dajaxice views, you need to run collectstatic again
  • The file is created in the /tmp/ folder. Therefore, if you use the -l switch to generate links instead of copying files, make sure that you do not delete this file by accident.
+7
source

Source: https://habr.com/ru/post/1435363/


All Articles