title: Django IOError - No such file or directory
body: <p>I've read the previous threads on this topic and tried to modify the code, but no success again.
  The problem is that I get <code>IOError message at %s. No such file or directory</code> error in the following view:</p>
  
  <pre><code>def some_view(request): 
     MYDIR = os.path.dirname(__file__)
      with open(os.path.join(MYDIR, '/static/egais_files/client.xml'), 'w') as f:
      # ....
  </code></pre>
  
  <p><code>client.xml</code> is located in the following folder:</p>
  
  <pre><code>\\10.8.0.1\share\djprj\djprj\static\static\egais_files\client.xml  
  </code></pre>
  
  <p>Any ideas what am I doing wrong ?</p>
  
  <p><strong>UPDATE 1:</strong>
  The .py file containing <code>some_view</code> is located in <code>\\10.8.0.1\share\djprj\djprj\djprj\egais\views.py</code></p>
  
  <p><strong>UPDATE 2</strong>. The settings.py file</p>
  
  <pre><code>import os   
  BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
  DEBUG = True
  
  ROOT_URLCONF = 'supermarket_project.urls'
  TEMPLATES = [
      {
          'BACKEND': 'django.template.backends.django.DjangoTemplates',
          'DIRS': [os.path.join(os.path.dirname(BASE_DIR),"static","templates")],
          #'DIRS': [os.path.join(BASE_DIR,"templates")],
          'APP_DIRS': True,
          'OPTIONS': {
              'context_processors': [
                  'django.template.context_processors.debug',
                  'django.template.context_processors.request',
                  'django.contrib.auth.context_processors.auth',
                  'django.contrib.messages.context_processors.messages',                 
              ],},},]
  
  WSGI_APPLICATION = 'supermarket_project.wsgi.application'
  PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
  STATIC_URL = '/static/'
  if DEBUG:
      MEDIA_URL = '/media/'
      STATIC_ROOT = os.path.join(os.path.dirname(BASE_DIR),"static","static-only")
      MEDIA_ROOT = os.path.join(os.path.dirname(BASE_DIR),"static","media")
      STATICFILES_DIRS = (os.path.join(os.path.dirname(BASE_DIR),"static","static"),
       )
  </code></pre>