Search code examples
pythondjangodjango-admindjango-autocomplete-light

Django autocomplete select does not work when deployed


I deployed an app in Pythonanywhere, and the Django autocomplete light for the admin page isn't being loaded, However when I run the app in the local host it works.

For it to load, I need to set where the static files for the DAL are

/home/myusername/.virtualenvs/django17/lib/python3.4/site-packages/dal/static/autocomplete_light

/home/myusername/.virtualenvs/django17/lib/python3.4/site-packages/dal_select2/static/autocomplete_light

I'm using django 1.10, python 3.4


Solution

  • I solved by doing the following

    STATIC_URL = '/static/'
    STATIC_ROOT = '/home/myuser/myapp/static'
    

    Static Files

    URL Directory

    /static/    /home/myuser/myapp/static