Deleted __pycache__ and __init__.py
Question:   * Django 1.6
  * Ubuntu 12.04
  * Python 3.2.3

Accidentally deleted a Django app's `__pycache__` folder & its `__init__.py`
file, and it crashed Django. when I `python3 manage.py runserver`, it'll
instantly claims there's no module by the name _agepct_ even though the app's
directory exists and all files are in it (except the ones I deleted). I
emptied the trash so I can't get the files back. Is there any way to get the
app working again short of recreating the whole app from scratch?

Here's the traceback it spits out when I try to `runserver`:

    
    
    Traceback (most recent call last):
      File "manage.py", line 10, in <module>
        execute_from_command_line(sys.argv)
      File "/usr/local/lib/python3.2/dist-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
        utility.execute()
      File "/usr/local/lib/python3.2/dist-packages/django/core/management/__init__.py", line 392, in execute
        self.fetch_command(subcommand).run_from_argv(self.argv)
      File "/usr/local/lib/python3.2/dist-packages/django/core/management/base.py", line 242, in run_from_argv
        self.execute(*args, **options.__dict__)
      File "/usr/local/lib/python3.2/dist-packages/django/core/management/base.py", line 280, in execute
        translation.activate('en-us')
      File "/usr/local/lib/python3.2/dist-packages/django/utils/translation/__init__.py", line 130, in activate
        return _trans.activate(language)
      File "/usr/local/lib/python3.2/dist-packages/django/utils/translation/trans_real.py", line 188, in activate
        _active.value = translation(language)
      File "/usr/local/lib/python3.2/dist-packages/django/utils/translation/trans_real.py", line 177, in translation
        default_translation = _fetch(settings.LANGUAGE_CODE)
      File "/usr/local/lib/python3.2/dist-packages/django/utils/translation/trans_real.py", line 159, in _fetch
        app = import_module(appname)
      File "/usr/lib/python3.2/importlib/__init__.py", line 124, in import_module
        return _bootstrap._gcd_import(name[level:], package, level)
      File "/usr/lib/python3.2/importlib/_bootstrap.py", line 824, in _gcd_import
        raise ImportError(_ERR_MSG.format(name))
    ImportError: No module named agepct
    


Answer: The `__pycache__` directory is a cache for byte-compiled files and will be re-
built when you import the package.

The `__init__.py` file on the other hand is what makes a directory a module.
If it was initially empty, simply recreate it in the `agepct` directory for
the imports to work again. Note that `__init__.py` would _not_ have been
inside the `__pycache__` directory.

If `__init__.py` was more than just an empty 'make this a package' file, then
you have to recreate that code from scratch or restore the file from a backup.

