Dajaxice not found on production server
Question: I have a Django 1.4 project, running on Python 2.7 in which I'm using
[Dajaxice](http://www.dajaxproject.com/) 0.5.4.1. I have set it up on my
development machine (Windows 7) and everything works perfectly. However when I
deploy my app to production server (Ubuntu 12.04) I get 404 error for
`dajaxice.core.js` file and cannot resolve this problem no matter what.
Production server works with exactly the same versions of all software.

My project structure looks like this:

    
    
    /myproject
    /myproject/myproject-static/ <-- all the static files are here
    /myproject/myproject-static/css/
    /myproject/myproject-static/img/
    /myproject/myproject-static/js/
    /myproject/templates/
    
    /myproject/myproject/
    /myproject/main/
    /myproject/app1/
    /myproject/app2/
    /myproject/app3/
    etc.
    

I was following the Dajaxice installation steps [here](http://django-
dajaxice.readthedocs.org/en/latest/installation.html) and put everything in
its place (in `settings.py`, ˙urls.py`and`base.html` files).

My `settings.py` file has also these values:

    
    
    from unipath import Path
    PROJECT_ROOT = Path(__file__).ancestor(3)
    
    STATIC_ROOT = ''
    STATIC_URL = '/myproject-static/'
    STATICFILES_DIRS = (
        PROJECT_ROOT.child('myproject-static'),
    )
    STATICFILES_FINDERS = (
        'django.contrib.staticfiles.finders.FileSystemFinder',
        'django.contrib.staticfiles.finders.AppDirectoriesFinder',
        'dajaxice.finders.DajaxiceFinder',
    )
    
    DAJAXICE_MEDIA_PREFIX = "dajaxice"
    DAJAXICE_DEBUG = True
    

I have an `Alias` directive in my `django.conf` file which looks like this:

    
    
    Alias /myproject-static/ "/path/to/myproject/myproject-static/"
    

I did `collectstatic` on my production server and got all static files
collected within few folders in the root of my project. So, now when I look at
my deployed web site, I can see that CSS is properly applied, JavaScript is
working fine and navigation around the site works as intended. Everything is
fine except Ajax is totally broken since `dajaxice.core.js` is never included.

My project folder structure after collecting static looks like this:

    
    
    /myproject
    /myproject/myproject-static/ <-- all the static files are originally here
    /myproject/myproject-static/css/
    /myproject/myproject-static/img/
    /myproject/myproject-static/js/
    /myproject/templates/
    
    /myproject/admin/ <-- folder created with 'collectstatic' command
    /myproject/css/ <-- folder created with 'collectstatic' command
    /myproject/dajaxice/ <-- dajaxice.core.js is located here
    /myproject/django_extensions/ <-- folder created with 'collectstatic' command
    /myproject/img/ <-- folder created with 'collectstatic' command
    /myproject/js/ <-- folder created with 'collectstatic' command
    
    /myproject/myproject/
    /myproject/main/
    /myproject/app1/
    /myproject/app2/
    /myproject/app3/
    etc.
    

Am I doing something completely wrong with my static files here?  
What else should I try to fix this simple error?


Answer: Have you check if as the rest of the assets, `dajaxice.core.js` is inside your
`static/dajaxice` folder? If not, the issue could be related with a miss
configuration of the `STATICFILES_FINDERS`, check [Installing dajaxice
again](http://django-
dajaxice.readthedocs.org/en/latest/installation.html#installing-dajaxice)

Another usual issue with collectstatic and dajaxice is to run the first using
`--link` Are you using this option?

Hope this helps

