Django project wont run on ubuntu with aditional installed apps
Question: My setup

  * Local machine 10.9.3 
  * Django 1.6.2 - local machine
  * Server Ubuntu 12.04
  * Django 1.6 - ubuntu server

When deploying a django project to a server running Ubunto 12.04 I found that
having an additional, but non existent application listed in my
`INSTALLED_APPS` section of my `settings.py` file prevented me from using any
of the `python manage.py` commands.

    
    
    INSTALLED_APPS = (
        'django.contrib.admin',
        'django.contrib.auth',
        'django.contrib.contenttypes',
        'django.contrib.sessions',
        'django.contrib.messages',
        'django.contrib.staticfiles',
        'polls',
        'survey',
        'django_countries',
    )
    

In this case I had previously had a `django_countries` application in the
project which I subsequently deleted. However that never prevented me from
being able to use any of the `python manage.py` commands on my local machine
`OSX 10.9.3`

However when I uploaded the project to my production server it would give me
errors e.g. running `python manage.py runserver`

would get me

    
    
    $ python manage.py runserver
    Traceback (most recent call last):
      File "manage.py", line 10, in <module>
        execute_from_command_line(sys.argv)
      File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
        utility.execute()
      File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 392, in execute
        self.fetch_command(subcommand).run_from_argv(self.argv)
      File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 242, in run_from_argv
        self.execute(*args, **options.__dict__)
      File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 280, in execute
        translation.activate('en-us')
      File "/usr/local/lib/python2.7/dist-packages/django/utils/translation/__init__.py", line 130, in activate
        return _trans.activate(language)
      File "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py", line 188, in activate
        _active.value = translation(language)
      File "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py", line 177, in translation
        default_translation = _fetch(settings.LANGUAGE_CODE)
      File "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py", line 159, in _fetch
        app = import_module(appname)
      File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 40, in import_module
        __import__(name)
    ImportError: No module named django_countries
    

Of course removing the unnecessary `django_countries` app in the `settings.py`
solved my problem but I would like to know: Why is it different between the
two environments? are there significant other differences that I should watch
out for?


Answer: That's a completely expected behaviour - `INSTALLED_APPS` defines which
applications you have installed and Django tries to find theirs models, urls
etc. If it can't find anything _installed_ , you'll get this error. Either
remove it from `INSTALLED_APPS` or install it.

Also it looks like you don't use VirtualEnv. Learn how to use it and use it
for every project otherwise you'll get nuts soon .)

