 (defun look-for-virtualenv (subdirectory)
   "Look for python virtualenv inside SUBDIRECTORY."
 
+  (when (getenv "PROJECTROOT")
     (when (directory-files (getenv "PROJECTROOT")
                            nil
                            (concat "^" subdirectory "$"))

(defun locate-django-project ()
  "Look for Django project."

  (do-if
   (locate-file "manage.py"
                (mapcar (lambda (item) (concat (getenv "PROJECTROOT") item))
                        '("" "/server/src")))
   (lambda (path) (replace-regexp-in-string "manage\.py$" "" path))))


(defun add-django-to-env (env)


        (message (concat "[ENVIRONMENT] Detected python virtualenv at "
                         virtualenv))
        virtualenv))))


(defun enable-virtualenv ()
