title: Getting started with django and heroku, "application error" after upload
body: <ol>
  <li>I have been using this guide: <a href="https://devcenter.heroku.com/articles/getting-started-with-django" rel="nofollow">https://devcenter.heroku.com/articles/getting-started-with-django</a></li>
  </ol>
  
  <h2>requirements.txt</h2>
  
  <pre><code>Django==1.6.5
  argparse==1.2.1
  dj-database-url==0.3.0
  dj-static==0.0.5
  django-toolbelt==0.0.1
  gunicorn==18.0
  psycopg2==2.5.3
  pystache==0.5.4
  static==1.0.2
  wsgiref==0.1.2
  </code></pre>
  
  <hr>
  
  <h2>file structure</h2>
  
  <pre><code>   hellodjango
     ├── hellodjango
     │   ├── __init__.py
     │   ├── settings.py
     │   ├── settings.py~
     │   ├── urls.py
     │   ├── wsgi.py
     │   └── wsgi.py~
     └── manage.py
     1 directory, 7 files
  </code></pre>
  
  <hr>
  
  <h2>other files in directory Projects/projects/6.2.2014</h2>
  
  <pre><code>    (venv)user@user-VirtualBox:~/Projects/projects/6.2.2014$ ls
      hellodjango  Procfile  Procfile~  requirements.txt  venv
  </code></pre>
  
  <h2>A snippet from the heroku logs:</h2>
  
  <pre><code>    2014-06-02T23:42:49.621172+00:00 app[web.1]: ImportError: No module named  
      hellodjango.wsgi
      2014-06-02T23:42:49.621171+00:00 app[web.1]:     __import__(module)
      2014-06-02T23:42:49.621219+00:00 app[web.1]: 2014-06-02 23:42:49 [7] [INFO] Worker
      exiting (pid: 7)
      2014-06-02T23:42:49.790790+00:00 app[web.1]: 2014-06-02 23:42:49 [2] [INFO] Shutting
      down: Master
      2014-06-02T23:42:51.344028+00:00 heroku[web.1]: Process exited with status 3
      2014-06-02T23:42:47.298345+00:00 heroku[web.1]: Starting process with command 
      `gunicorn hellodjango.wsgi`
      2014-06-02T23:42:51.355014+00:00 heroku[web.1]: State changed from starting to 
      crashed
      (venv)user@user-VirtualBox:~/Projects/projects/6.2.2014$ 
  </code></pre>
  
  <h2>Procfile</h2>
  
  <pre><code>    web: gunicorn hellodjango.wsgi -b 0.0.0.0:$PORT
  </code></pre>
  
  <p>Can anyone point me in the direction of what I'm missing here?
  I had the same "application error" after visiting my site when the Procfile only had this:</p>
  
  <h2>Procfile (old)</h2>
  
  <pre><code>    web: gunicorn hellodjango.wsgi
  </code></pre>
  
  <h2>Settings file</h2>
  
  <pre><code>    # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
      import os
      BASE_DIR = os.path.dirname(os.path.dirname(__file__))
  
  
      # Quick-start development settings - unsuitable for production
      # See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/
  
      # SECURITY WARNING: keep the secret key used in production secret!
      # I removed this line for the stack overflow posting SECRET_KEY = ''
  
      # SECURITY WARNING: don't run with debug turned on in production!
      DEBUG = True
  
      TEMPLATE_DEBUG = True
  
      ALLOWED_HOSTS = ['*']
  
  
      # Application definition
  
      INSTALLED_APPS = (
          'django.contrib.admin',
          'django.contrib.auth',
          'django.contrib.contenttypes',
          'django.contrib.sessions',
          'django.contrib.messages',
          'django.contrib.staticfiles',
          'gunicorn', #this wasn't here before, i added it and still got the application 
           # error
          )
  
      MIDDLEWARE_CLASSES = (
          'django.contrib.sessions.middleware.SessionMiddleware',
          'django.middleware.common.CommonMiddleware',
          'django.middleware.csrf.CsrfViewMiddleware',
          'django.contrib.auth.middleware.AuthenticationMiddleware',
          'django.contrib.messages.middleware.MessageMiddleware',
         'django.middleware.clickjacking.XFrameOptionsMiddleware',
       )
  
      ROOT_URLCONF = 'hellodjango.urls'
  
      WSGI_APPLICATION = 'hellodjango.wsgi.application'
  
  
      # Database
      # https://docs.djangoproject.com/en/1.6/ref/settings/#databases
  
      """
      DATABASES = {
          'default': {
              'ENGINE': 'django.db.backends.sqlite3',
              'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
          }
       }
      """
      # Internationalization
      # https://docs.djangoproject.com/en/1.6/topics/i18n/
  
      LANGUAGE_CODE = 'en-us'
  
      TIME_ZONE = 'UTC'
  
      USE_I18N = True
  
      USE_L10N = True
  
      USE_TZ = True
  
  
      # Static files (CSS, JavaScript, Images)
      # https://docs.djangoproject.com/en/1.6/howto/static-files/
  
      STATIC_URL = '/static/'
  
      # Parse database configuration from $DATABASE_URL
      import dj_database_url
      DATABASES['default'] =  dj_database_url.config()
  
      # Honor the 'X-Forwarded-Proto' header for request.is_secure()
      SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
  
  
      # Static asset configuration
      import os
      BASE_DIR = os.path.dirname(os.path.abspath(__file__))
      STATIC_ROOT = 'staticfiles'
      STATIC_URL = '/static/'
  
      STATICFILES_DIRS = (
          os.path.join(BASE_DIR, 'static'),
      )
  </code></pre>
  
  <h2>This is my current wsgi.py file in /Projects/projects/6.2.2014/hellodjango/hellodjango</h2>
  
  <pre><code>    import os
      from django.core.wsgi import get_wsgi_application
      from dj_static import Cling
      os.environ.setdefault("DJANGO_SETTINGS_MODULE", "hellodjango.settings")
  
  
      application = Cling(get_wsgi_application())
  </code></pre>