title: Unable to serve static files correctly in Django app again
body: <p>A couple of weeks ago I tried to install a django application in google cloud VM (Ubuntu 16.04). As I described in <a href="https://stackoverflow.com/questions/50773819/unable-to-serve-static-files-correctly-in-django-app">this post</a>, I had issues serving the static files correctly in Django app. 
  For some reason the url for the static files were not build correctly. I have fixed this issue by modifying my base.html template (where all the js and css is loaded) and using {% static %} instead of the STATIC_URL method as described <a href="http://staticfiles.productiondjango.com/blog/stop-using-static-url-in-templates/" rel="nofollow noreferrer">here.</a></p>
  
  <p>Yesterday I tried to reinstall the application again in another frest VM but things for some reason do not work as expected. Although I made the above mentioned changes, I started getting the same errors as before:</p>
  
  <p><a href="https://i.stack.imgur.com/jy9RV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jy9RV.png" alt="enter image description here"></a></p>
  
  <p>It seems like that the "static" string is missing from the URL. For example:
  instead of serving the js as:</p>
  
  <pre><code>myIP/static/lib/css/assets.min.css
  </code></pre>
  
  <p>it serves them as:</p>
  
  <pre><code>myIP/lib/css/assets.min.css
  </code></pre>
  
  <p>I am not sure why this happens as I define the STATIC_URL in my local_settings.py file. More over in my settings.py file I have set the paths to directories as:</p>
  
  <pre><code>MEDIA_ROOT = '/var/www/geonode/uploaded'
  STATIC_ROOT = '/var/www/geonode/static/'
  STATIC_URL = '/static/'
  
    TEMPLATE_DIRS = (
      '/etc/geonode/templates',
      os.path.join(GEONODE_ROOT, 'templates'),
    )
    # Additional directories which hold static files
    STATICFILES_DIRS = [
      '/etc/geonode/media',
      os.path.join(GEONODE_ROOT, 'static'),
    ]
  </code></pre>
  
  <p>My base.html file looks like this (DEBUG_STATIC is set to False):</p>
  
  <pre><code>     {% load i18n avatar_tags %}
      {% load account socialaccount %}
      {% load static from staticfiles %}
      &lt;!DOCTYPE html&gt;
      &lt;html lang="en"&gt;
        &lt;head&gt;
          &lt;meta charset="utf-8"&gt;
          &lt;meta http-equiv="X-UA-Compatible" content="IE=edge"&gt;
          &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
  
          &lt;meta Http-Equiv="Cache-Control" Content="no-cache"&gt;
          &lt;meta Http-Equiv="Pragma" Content="no-cache"&gt;
          &lt;meta Http-Equiv="Expires" Content="0"&gt;
          &lt;meta Http-Equiv="Pragma-directive: no-cache"&gt;
          &lt;meta Http-Equiv="Cache-directive: no-cache"&gt;
  
          &lt;title&gt;{% block title %}{{ SITE_NAME }}{% endblock %}&lt;/title&gt;
          {% block head %}
            {% if DEBUG_STATIC %}
                &lt;link href="{{ STATIC_URL }}lib/css/jquery.dataTables.css?v={{ VERSION }}" rel="stylesheet" /&gt;
                &lt;link href="{{ STATIC_URL }}lib/css/select2.css?v={{ VERSION }}" rel="stylesheet"/&gt;
                &lt;link href="{{ STATIC_URL }}lib/css/bootstrap.min.css?v={{ VERSION }}" rel="stylesheet"/&gt;
                &lt;link href="{{ STATIC_URL }}lib/css/jquery-ui.css?v={{ VERSION }}" rel="stylesheet"/&gt;
            {% else %}
              &lt;link href="{% static "lib/css/assets.min.css" %}?v={{ VERSION }}" rel="stylesheet"/&gt;
            {% endif %}
  
            &lt;link href="{% static "geonode/css/ext-compatibility.css" %}?v={{ VERSION }}" rel="stylesheet" /&gt;
            &lt;link href="{% static "geonode/css/ux-all.css" %}?v={{ VERSION }}" rel="stylesheet" /&gt;
            &lt;link href="{% static "geonode/css/base.css" %}?v={{ VERSION }}" rel="stylesheet" /&gt;
            &lt;style type="text/css"&gt;[ng\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide:not(.ng-hide-animate){display:none !important;}&lt;/style&gt;
  
            {% block extra_head %}
            {% endblock %}
          {% endblock %}
          &lt;!--[if IE]&gt;
            &lt;script src="https://html5shim.googlecode.com/svn/trunk/html5.js"&gt;&lt;/script&gt;
            &lt;style&gt;
              #ieflag{
                  display: block !important;
                  height: 150px;
  
  
          text-align: center;
              }
            &lt;/style&gt;
          &lt;![endif]--&gt;
          &lt;link rel="search" type="application/opensearchdescription+xml" href="/catalogue/opensearch" title="GeoNode Search"/&gt;
        &lt;/head&gt;
  
        &lt;body class="{% block body_class %}{% endblock %}"&gt;
          &lt;!-- Navbar --&gt;
          {% block header %}
              &lt;nav class="navbar navbar-inverse navbar-fixed-top" role="navigation"&gt;
                &lt;div class="container"&gt;
              &lt;div class="navbar-header"&gt;
                    &lt;button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"&gt;
                      &lt;i class="fa fa-navicon fa-lg"&gt;&lt;/i&gt;
                    &lt;/button&gt;
                    &lt;a class="navbar-brand" href="{% url "home" %}"&gt;GeoNode&lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div id="navbar" class="navbar-collapse collapse"&gt;
                    &lt;ul class="nav navbar-nav toolbar"&gt;
                      {% block tabs %}
                      &lt;li id="nav_layers"&gt;
                    &lt;a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"&gt;{% trans "Data" %}&lt;i class="fa fa-angle-down fa-lg"&gt;&lt;/i&gt;&lt;/a&gt;
                    &lt;ul class="dropdown-menu"&gt;
                      &lt;li&gt;&lt;a href="{% url "layer_browse" %}?limit={{ CLIENT_RESULTS_LIMIT }}"&gt;{% trans "Layers" %}&lt;/a&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;a href="{% url "document_browse" %}?limit={{ CLIENT_RESULTS_LIMIT }}"&gt;{% trans "Documents" %}&lt;/a&gt;&lt;/li&gt;
                      {% if user.is_authenticated %}
                      &lt;li&gt;&lt;a href="{% url "services" %}?limit={{ CLIENT_RESULTS_LIMIT }}"&gt;{% trans "Remote Services" %}&lt;/a&gt;&lt;/li&gt;
                      &lt;li role="separator" class="divider"&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;a href="{% url "layer_upload" %}"&gt;Upload Layer&lt;/a&gt;&lt;/li&gt;
                      {% if 'geonode.contrib.createlayer' in INSTALLED_APPS %}
                        &lt;li&gt;&lt;a href="{% url "layer_create" %}"&gt;{% trans "Create Layer" %}&lt;/a&gt;&lt;/li&gt;
                      {% endif %}
                      &lt;li&gt;&lt;a href="{% url "document_upload" %}"&gt;Upload Document&lt;/a&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;a href="{% url "register_service" %}"&gt;{% trans "Add Remote Service" %}&lt;/a&gt;&lt;/li&gt;
                      {% endif %}
                      &lt;/ul&gt;
              &lt;/li&gt;
                  &lt;li id="nav_maps"&gt;
                {% if user.is_authenticated %}
                &lt;a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"&gt;{% trans "Maps" %}&lt;i class="fa fa-angle-down fa-lg"&gt;&lt;/i&gt;&lt;/a&gt;
                &lt;ul class="dropdown-menu"&gt;
                  &lt;li&gt;&lt;a href="{% url "maps_browse" %}?limit={{ CLIENT_RESULTS_LIMIT }}"&gt;{% trans "Explore Maps" %}&lt;/a&gt;&lt;/li&gt;
                  &lt;li&gt; &lt;a href="{% url "new_map" %}"&gt;{% trans "Create Map" %}&lt;/a&gt;&lt;/li&gt;
                &lt;/ul&gt;
                {% else %}
                &lt;a href="{% url "maps_browse" %}?limit={{ CLIENT_RESULTS_LIMIT }}"&gt;{% trans "Maps" %}&lt;/a&gt;
                {% endif %}
  
  
  &lt;/li&gt;
          &lt;li&gt;
            &lt;a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"&gt;{% trans "About" %}&lt;i class="fa fa-angle-down fa-lg"&gt;&lt;/i&gt;&lt;/a&gt;
            &lt;ul class="dropdown-menu"&gt;
              &lt;li&gt;&lt;a href="{% url "profile_browse" %}"&gt;{% trans "People" %}&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="{% url "group_list" %}"&gt;{% trans "Groups" %}&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="{% url "group_category_list" %}"&gt;{% trans "Group Categories" %}&lt;/a&gt;&lt;/li&gt;
              {% if perms.announcements.can_manage %}
              &lt;li&gt;&lt;a href="{% url "announcements_list" %}"&gt;{% trans "Announcements" %}&lt;/a&gt;&lt;/li&gt;
              {% endif %}
              &lt;li role="separator" class="divider"&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="{% url "geonode.invitations:geonode-send-invite" %}"&gt;{% trans "Invite Users" %}&lt;/a&gt;&lt;/li&gt;
              {% if user.is_superuser %}
              &lt;li&gt;&lt;a href="/admin/people/profile/add/"&gt;{% trans "Add User" %}&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="{% url "group_create" %}"&gt;{% trans "Create Group" %}&lt;/a&gt;&lt;/li&gt;
              {% endif %}
            &lt;/ul&gt;
          &lt;/li&gt;
  
          {% block extra_tab %}
          {% endblock %}
          {% endblock %}
        &lt;/ul&gt;
            &lt;ul class="nav navbar-nav navbar-right"&gt;
          &lt;li&gt;
            &lt;div class="search"&gt;
  &lt;form id="search" action="{% url "search" %}" &gt;
                    &lt;span class="fa fa-search"&gt;&lt;/span&gt;
                    {% if HAYSTACK_SEARCH %}
                    &lt;input id="search_input" type="text" placeholder="Search" name="q"&gt;
                    {% else %}
                    &lt;input id="search_input" type="text" placeholder="Search" name="title__icontains"&gt;
                    {% endif %}
                  &lt;/form&gt;
                &lt;/div&gt;
                  &lt;/li&gt;
              {% if not user.is_authenticated and ACCOUNT_OPEN_SIGNUP %}
              &lt;li&gt;&lt;a href="{% url "account_signup" %}"&gt;{% trans "Register" %}&lt;/a&gt;&lt;/li&gt;
              {% endif %}
              {% if user.is_authenticated %}
              &lt;li&gt;
                &lt;a href="#" class="dropdown-toggle avatar" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"&gt;
                  {% autoescape off %}{% avatar user 42 %}{% endautoescape %}
                  {% with full_name=user.first_name|add:' '|add:user.last_name %}
                    {% if full_name.strip %}
                      {{ full_name | truncatechars:20 }}
                    {% else %}
                      {{ user.username | truncatechars:20 }}
                    {% endif %}
                  {% endwith %}
                  &lt;i class="fa fa-angle-down fa-lg"&gt;&lt;/i&gt;
                &lt;/a&gt;
                &lt;ul class="dropdown-menu"&gt;
                  &lt;li&gt;&lt;a href="{{ user.get_absolute_url }}"&gt;{% trans "Profile" %}&lt;/a&gt;&lt;/li&gt;
                  &lt;li&gt;&lt;a href="{% url "recent-activity" %}"&gt;{% trans "Recent Activity" %}&lt;/a&gt;&lt;/li&gt;
                  &lt;li&gt;&lt;a href="{% url "messages_inbox" %}"&gt;{% trans "Inbox" %}&lt;/a&gt;&lt;/li&gt;
                  &lt;li role="separator" class="divider"&gt;&lt;/li&gt;
                  &lt;li&gt;&lt;a href="{% url "admin:index" %}"&gt;Admin&lt;/a&gt;&lt;/li&gt;
                  {% if 'geonode.geoserver' in INSTALLED_APPS %}
                  &lt;li&gt;&lt;a href="{% url "proxy" %}?url={{ GEOSERVER_LOCAL_URL }}web"&gt;GeoServer&lt;/a&gt;&lt;/li&gt;
                  {% endif %}
                  {% if user.is_superuser and USE_MONITORING %}
                  &lt;li role="separator" class="divider"&gt;&lt;/li&gt;
                  &lt;li&gt;&lt;a href="{% url "monitoring:index" %}"&gt;{% trans "Monitoring" %}&lt;/a&gt;&lt;/li&gt;
                  {% endif %}
                  &lt;li role="separator" class="divider"&gt;&lt;/li&gt;
                  &lt;li&gt;&lt;a href="{% url "help" %}"&gt;{% trans "Help" %}&lt;/a&gt;&lt;/li&gt;
                  &lt;li role="separator" class="divider"&gt;&lt;/li&gt;
                  &lt;li&gt;&lt;a href="/account/logout/"&gt;Logout&lt;/a&gt;&lt;/li&gt;
                  &lt;/ul&gt;
                  &lt;/li&gt;
                        {% else %}
                        &lt;li&gt;&lt;a href="#" data-toggle="modal" data-target="#SigninModal" role="button" &gt;{% trans "Sign in" %} &lt;/a&gt;&lt;/li&gt;
                {% endif %}
              &lt;/ul&gt;
            &lt;/div&gt; &lt;!--/.nav-collapse --&gt;
          &lt;/div&gt;
        &lt;/nav&gt;
        {% endblock header %}
        &lt;!-- End of Navbar --&gt;
  
      &lt;div class="alert alert-danger alert-dismissible" role="alert" id="ieflag" style="display:none"&gt;
        &lt;button type="button" class="close" data-dismiss="alert" aria-label="Close"&gt;&lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;&lt;/button&gt;
        &lt;h1&gt;You are using an outdated browser that is not supported by GeoNode.&lt;/h1&gt;
        &lt;p&gt;Please use a &lt;strong&gt;modern browser&lt;/strong&gt; like Mozilla Firefox, Google Chrome or Safari.&lt;/p&gt;
      &lt;/div&gt;
  
    &lt;div id="wrap"&gt;
      {% block middle %}
      &lt;div class="container"&gt;
        {% include "_status_message.html" %}
        {% include "_announcements.html" %}
        {% include "_messages.html" %}
        {% block body_outer %}
        &lt;div class="row"&gt;
          &lt;div class="col-md-8"&gt;
          {% block body %}{% endblock %}
          &lt;/div&gt;
          &lt;div class="col-md-4"&gt;
          {% block sidebar %}{% endblock %}
          &lt;/div&gt;
        &lt;/div&gt;
        {% endblock %}
      &lt;/div&gt;
      {% endblock middle %}
    &lt;/div&gt;
  
    {% block monitoring %}
    {% endblock %}
  
    {% block footer %}
  &lt;footer&gt;
      &lt;div class="container"&gt;
        &lt;div class="row"&gt;
          &lt;div class="col-md-2"&gt;
            &lt;ul class="list-unstyled"&gt;
              &lt;li&gt;Data&lt;/li&gt;
              &lt;li&gt;&lt;a href="{% url "layer_browse" %}?limit={{ CLIENT_RESULTS_LIMIT }}"&gt;{% trans "Layers" %}&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="{% url "document_browse" %}?limit={{ CLIENT_RESULTS_LIMIT }}"&gt;{% trans "Documents" %}&lt;/a&gt;&lt;/li&gt;
              {% if user.is_authenticated %}
              &lt;li&gt;&lt;a href="{% url "services" %}?limit={{ CLIENT_RESULTS_LIMIT }}"&gt;{% trans "Remote Services" %}&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="{% url "layer_upload" %}"&gt;Upload Layer&lt;/a&gt;&lt;/li&gt;
              {% if 'geonode.contrib.createlayer' in INSTALLED_APPS %}
                &lt;li&gt;&lt;a href="{% url "layer_create" %}"&gt;{% trans "Create Layer" %}&lt;/a&gt;&lt;/li&gt;
              {% endif %}
              &lt;li&gt;&lt;a href="{% url "document_upload" %}"&gt;Upload Document&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="{% url "register_service" %}"&gt;{% trans "Add Remote Service" %}&lt;/a&gt;&lt;/li&gt;
              {% endif %}
            &lt;/ul&gt;
          &lt;/div&gt;
          &lt;div class="col-md-2"&gt;
            &lt;ul class="list-unstyled"&gt;
              &lt;li&gt;Maps&lt;/li&gt;
              &lt;li&gt;&lt;a href="{% url "maps_browse" %}?limit={{ CLIENT_RESULTS_LIMIT }}"&gt;{% trans "Explore Maps" %}&lt;/a&gt;&lt;/li&gt;
              {% if user.is_authenticated %}
              &lt;li&gt; &lt;a href="{% url "new_map" %}"&gt;{% trans "Create Map" %}&lt;/a&gt;&lt;/li&gt;
              {% endif %}
            &lt;/ul&gt;
          &lt;/div&gt;
                  &lt;div class="col-md-2"&gt;
            &lt;ul class="list-unstyled"&gt;
              &lt;li&gt;About&lt;/li&gt;
              &lt;li&gt;&lt;a href="{% url "profile_browse" %}"&gt;{% trans "People" %}&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="{% url "group_list" %}"&gt;{% trans "Groups" %}&lt;/a&gt;&lt;/li&gt;
              {% if perms.announcements.can_manage %}
              &lt;li&gt;&lt;a href="{% url "announcements_list" %}"&gt;{% trans "Announcements" %}&lt;/a&gt;&lt;/li&gt;
              {% endif %}
              &lt;li&gt;&lt;a href="{% url "geonode.invitations:geonode-send-invite" %}"&gt;{% trans "Invite Users" %}&lt;/a&gt;&lt;/li&gt;
              {% if user.is_superuser %}
  &lt;li&gt;&lt;a href="/admin/people/profile/add/"&gt;{% trans "Add User" %}&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="{% url "group_create" %}"&gt;{% trans "Create Group" %}&lt;/a&gt;&lt;/li&gt;
              {% endif %}
            &lt;/ul&gt;
          &lt;/div&gt;
          &lt;div class="col-md-6 text-right"&gt;
            &lt;ul class="list-unstyled"&gt;
              &lt;li&gt;{% trans "Powered by" %} &lt;a href="http://geonode.org"&gt;{% trans "GeoNode" %}&lt;/a&gt; &lt;em&gt;{% trans "version" %} {{ VERSION }}&lt;/em&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="{% url "developer" %}"&gt;{% trans "Developers" %}&lt;/a&gt; | &lt;a href="{% url "about" %}"&gt;{% trans "About" %}&lt;/a&gt;&lt;li&gt;
            &lt;/ul&gt;
            &lt;label class="hidden"&gt;{% trans "Language" %}&lt;/label&gt;
            {% if csrf_token != "NOTPROVIDED" %}
            {% get_current_language as LANGUAGE %}
            &lt;form class="form-inline" action="/i18n/setlang/" method="post"&gt;
            {% csrf_token %}
              &lt;select class="col-md-6 pull-right" name="language" onchange="javascript:form.submit()"&gt;
                {% for lang in LANGUAGES %}
                &lt;option value="{{ lang.0 }}" {% ifequal LANGUAGE_CODE lang.0 %} selected="selected"{% endifequal %}&gt;
                  {{ lang.1 }}
                &lt;/option&gt;
                {% endfor %}
              &lt;/select&gt;
            &lt;/form&gt;
            {% endif %}
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/footer&gt;
    {% endblock footer %}
  
  
          &lt;!-- Modal must stay outside the navbar --&gt;
          {% if not user.is_authenticated %}
          &lt;div class="modal fade" id="SigninModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"&gt;
            &lt;div class="modal-dialog modal-sm"&gt;
       &lt;div class="modal-content"&gt;
                &lt;div class="modal-header"&gt;
                  &lt;button type="button" class="close" data-dismiss="modal"&gt;&lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;&lt;span class="sr-only"&gt;Close&lt;/span&gt;&lt;/button&gt;
                  &lt;h4 class="modal-title" id="myModalLabel"&gt;{% trans "Sign in" %}&lt;/h4&gt;
                &lt;/div&gt;
                &lt;form class="form-signin" role="form" action="{% url "account_login" %}?next={{ request.path }}" method="post"&gt;
                  &lt;div class="modal-body"&gt;
                    {% csrf_token %}
                    {% get_providers as socialaccount_providers %}
                    {% if socialaccount_providers %}
                        {% include "socialaccount/snippets/provider_list.html" with process="login" %}
                        {% include "socialaccount/snippets/login_extra.html" %}
                      &lt;hr&gt;
                    {% endif %}
                    &lt;div class="form-group"&gt;
                      &lt;label for="id_username" class="sr-only"&gt;{% trans "Username" %}:&lt;/label&gt;
                      &lt;input id="id_username" class="form-control" name="login" placeholder="{% trans "Username" %}" type="text" /&gt;
                    &lt;/div&gt;
                    &lt;div class="form-group"&gt;
                      &lt;label for="id_password" class="sr-only"&gt;{% trans "Password" %}:&lt;/label&gt;
                      &lt;input id="id_password" class="form-control" name="password" placeholder="{% trans "Password" %}" type="password" /&gt;
                    &lt;/div&gt;
                    &lt;label class="checkbox"&gt;
                      &lt;input type="checkbox" /&gt; {% trans "Remember Me" %}
                    &lt;/label&gt;
                  &lt;/div&gt;
                  &lt;div class="modal-footer"&gt;
                    &lt;button type="submit" class="btn btn-primary btn-block"&gt;{% trans "Sign in" %}&lt;/button&gt;
                  &lt;/div&gt;
                &lt;/form&gt;
              &lt;/div&gt;
            &lt;/div&gt;
          &lt;/div&gt;
          {% endif %}
          &lt;!-- End of Modal --&gt;
          {% if DEBUG_STATIC %}
          &lt;script src="{{ STATIC_URL }}lib/js/jquery.min.js?v={{ VERSION }}"&gt;&lt;/script&gt;
          &lt;script src="{{ STATIC_URL }}lib/js/jquery.dataTables.js?v={{ VERSION }}"&gt;&lt;/script&gt;
          &lt;script src="{{ STATIC_URL }}lib/js/jquery.timeago.js?v={{ VERSION }}"&gt;&lt;/script&gt;
          &lt;script src="{{ STATIC_URL }}lib/js/jquery.ajaxprogress.js?v={{ VERSION }}"&gt;&lt;/script&gt;
          &lt;script src="{{ STATIC_URL }}lib/js/jquery.ajaxQueue.js?v={{ VERSION }}"&gt;&lt;/script&gt;
          &lt;script src="{{ STATIC_URL }}lib/js/jquery-ui.custom.js?v={{ VERSION }}"&gt;&lt;/script&gt;
          &lt;script src="{{ STATIC_URL }}lib/js/jquery.raty.js?v={{ VERSION }}"&gt;&lt;/script&gt;
          &lt;script src="{{ STATIC_URL }}lib/js/bootstrap.min.js?v={{ VERSION }}"&gt;&lt;/script&gt;
          &lt;script src="{{ STATIC_URL }}lib/js/moment-with-locales.min.js?v={{ VERSION }}"&gt;&lt;/script&gt;
          &lt;script src="{{ STATIC_URL }}lib/js/bootstrap-datetimepicker.min.js?v={{ VERSION }}"&gt;&lt;/script&gt;
          &lt;script src="{{ STATIC_URL }}lib/js/json2.js?v={{ VERSION }}"&gt;&lt;/script&gt;
          &lt;script src="{{ STATIC_URL }}lib/js/select2.js?v={{ VERSION }}"&gt;&lt;/script&gt;
          &lt;script src="{{ STATIC_URL }}lib/js/waypoints.js?v={{ VERSION }}"&gt;&lt;/script&gt;
          {% else %}
          &lt;script src="{% static "lib/js/assets.min.js" %}?v={{ VERSION }}"&gt;&lt;/script&gt;
          {% endif %}
          &lt;script src="{% static "geonode/js/utils/utils.js" %}?v={{ VERSION }}"&gt;&lt;/script&gt;
          &lt;script src="{% static "geonode/js/base/base.js" %}?v={{ VERSION }}"&gt;&lt;/script&gt;
          {% include 'autocomplete_light/static.html' %}
          &lt;script type="text/javascript" src="{% url "javascript-catalog" %}"&gt;&lt;/script&gt;
          {% block extra_script %}{% endblock extra_script %}
          &lt;script type="text/javascript"&gt;
              var autocomplete = $('#search_input').yourlabsAutocomplete({
                  url: '{% url "autocomplete_light_autocomplete" "ResourceBaseAutocomplete" %}',
                  choiceSelector: 'span',
                  hideAfter: 200,
                  minimumCharacters: 1,
                  placeholder: '{% trans 'Type your search here ...' %}',
                  appendAutocomplete: $('#search_input'),
                  autoHilightFirst: false
              });
              $('#search_input').bind('selectChoice', function(e, choice, autocomplete) {
                  if(choice[0].children[0] == undefined) {
                      $('#search_input').val($(choice[0]).text());
                      $('#search').submit();
                  }
              });
          &lt;/script&gt;
          &lt;script&gt;
              // Workaround to fix the autocomplete box positions
              yourlabs.Autocomplete.prototype.fixPosition = function(html) {
                  this.input.parents().filter(function() {
                      return $(this).css('overflow') === 'hidden';
                  }).first().css('overflow', 'visible');
                  if(this.input.attr('name') !== 'resource-keywords'){
                    this.box.insertAfter(this.input).css({top: 28, left: 0});
                  }else{ ...
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <p>My virtualhost for the apache looks like this:</p>
  
  <pre><code>WSGIDaemonProcess geonode user=www-data threads=15 processes=2
  &lt;VirtualHost *:80&gt;
      Servername localhost
      ServerAdmin webmaster@localhost
      LimitRequestFieldSize 32760
      LimitRequestLine 32760
      ErrorLog /var/log/apache2/error.log
      LogLevel warn
      CustomLog /var/log/apache2/access.log combined
      WSGIProcessGroup geonode
      WSGIPassAuthorization On
      WSGIScriptAlias / /var/www/geonode/wsgi/geonode.wsgi
      &lt;Directory "/var/www/geonode/"&gt;
         Order allow,deny
         Options -Indexes
         Allow from all
      &lt;/Directory&gt;
      Alias /static/ /var/www/geonode/static/
      Alias /uploaded/ /var/www/geonode/uploaded/
      Alias /robots.txt /var/www/geonode/robots.txt
      &lt;Directory "/var/www/geonode/uploaded/documents/"&gt;
         Order allow,deny
         Deny from all
      &lt;/Directory&gt;
      &lt;Directory "/var/www/geonode/uploaded/layers/"&gt;
         Order allow,deny
         Deny from all
      &lt;/Directory&gt;
  
   &lt;Directory "/var/www/geonode/static_root/"&gt;
          Order allow,deny
          Options Indexes FollowSymLinks
          Allow from all
          Require all granted
          IndexOptions FancyIndexing
      &lt;/Directory&gt;
  
      &lt;Directory "/var/www/geonode/uploaded/thumbs/"&gt;
          Order allow,deny
          Options Indexes FollowSymLinks
          Allow from all
          Require all granted
          IndexOptions FancyIndexing
      &lt;/Directory&gt;
  
      &lt;Directory "/var/www/geonode/uploaded/avatars/"&gt;
          Order allow,deny
          Options Indexes FollowSymLinks
          Allow from all
          Require all granted
          IndexOptions FancyIndexing
      &lt;/Directory&gt;
  
      &lt;Directory "/var/www/geonode/uploaded/people_group/"&gt;
          Order allow,deny
          Options Indexes FollowSymLinks
          Allow from all
          Require all granted
          IndexOptions FancyIndexing
      &lt;/Directory&gt;
  
      &lt;Directory "/var/www/geonode/uploaded/group/"&gt;
          Order allow,deny
          Options Indexes FollowSymLinks
          Allow from all
          Require all granted
          IndexOptions FancyIndexing
      &lt;/Directory&gt;
  
  &lt;Proxy *&gt;
        Order allow,deny
        Allow from all
      &lt;/Proxy&gt;
  
      ProxyPreserveHost On
      ProxyPass /geoserver http://localhost:8080/geoserver
      ProxyPassReverse /geoserver http://localhost:8080/geoserver
  &lt;/VirtualHost&gt;
  </code></pre>