title: Deploying Django On Amazon Ec2 Error
body: <p>I am trying to start a project with Django on my EC2 instance, but when I type in: </p>
  
  <pre><code>django-admin.py startproject mysite
  </code></pre>
  
  <p>This is what I get: </p>
  
  <pre><code>    Traceback (most recent call last):
    File "/usr/bin/django-admin.py", line 2, in &lt;module&gt;
      from django.core import management
    File "/usr/lib/python2.6/site-packages/django/core/management/__init__.py", line 68
      commands = {name: 'django.core' for name in find_commands(__path__[0])}
                                        ^
  SyntaxError: invalid syntax
  </code></pre>
  
  <p>I have been trying to find some reference online, but I can't find any. I thought Python2.6.9, which is the version on EC2 wouldn't support Django, but that's not the case. </p>
  
  <p>What made me suspicious is the output I get when I install Django on the machine, which succeeds but there are several Syntax Errors that don't ring any bell to me. </p>
  
  <p>This is it: </p>
  
  <pre><code>    Downloading/unpacking django
    Running setup.py egg_info for package django
      warning: no previously-included files matching '__pycache__' found under directory '*'
      warning: no previously-included files matching '*.py[co]' found under directory '*'
  Installing collected packages: django
    Running setup.py install for django
      warning: no previously-included files matching '__pycache__' found under directory '*'
      warning: no previously-included files matching '*.py[co]' found under directory '*'
      SyntaxError: ('invalid syntax', ('/usr/lib/python2.6/site-packages/django/core/management/__init__.py', 68, 39, "    commands = {name: 'django.core' for name in find_commands(__path__[0])}\n"))
  
      SyntaxError: ('invalid syntax', ('/usr/lib/python2.6/site-packages/django/core/management/commands/makemessages.py', 351, 44, "        dir_suffixes = {'%s*' % path_sep for path_sep in {'/', os.sep}}\n"))
  
      SyntaxError: ('invalid syntax', ('/usr/lib/python2.6/site-packages/django/utils/lru_cache.py', 28, 34, '                 fasttypes = {int, str, frozenset, type(None)},\n'))
  
      SyntaxError: ('invalid syntax', ('/usr/lib/python2.6/site-packages/django/contrib/humanize/tests.py', 95, 40, "        with translation.override('ja'), self.settings(USE_L10N=True):\n"))
  
      SyntaxError: ('invalid syntax', ('/usr/lib/python2.6/site-packages/django/contrib/formtools/tests/wizard/wizardtests/tests.py', 128, 40, "        with open(THIS_FILE, 'rb') as f, temp_storage.open(UPLOADED_FILE_NAME) as f2:\n"))
  
      SyntaxError: ('invalid syntax', ('/usr/lib/python2.6/site-packages/django/contrib/formtools/tests/wizard/namedwizardtests/tests.py', 160, 40, "        with open(THIS_FILE, 'rb') as f, temp_storage.open(UPLOADED_FILE_NAME) as f2:\n"))
  
      SyntaxError: ('invalid syntax', ('/usr/lib/python2.6/site-packages/django/contrib/auth/tests/test_forms.py', 123, 42, "        with self.settings(USE_I18N=True), translation.override('pt-br', deactivate=True):\n"))
  
      SyntaxError: ('invalid syntax', ('/usr/lib/python2.6/site-packages/django/contrib/gis/db/backends/postgis/operations.py', 79, 34, "    valid_aggregates = {'Collect', 'Extent', 'Extent3D', 'MakeLine', 'Union'}\n"))
  
      SyntaxError: ('invalid syntax', ('/usr/lib/python2.6/site-packages/django/contrib/gis/db/backends/oracle/operations.py', 86, 32, "    valid_aggregates = {'Union', 'Extent'}\n"))
  
      SyntaxError: ('invalid syntax', ('/usr/lib/python2.6/site-packages/django/contrib/gis/db/backends/spatialite/operations.py', 68, 33, "    valid_aggregates = {'Extent', 'Union'}\n"))
  
      SyntaxError: ('invalid syntax', ('/usr/lib/python2.6/site-packages/django/contrib/gis/db/models/constants.py', 4, 17, "    'bbcontains', 'bboverlaps', 'contained', 'contains',\n"))
  
      SyntaxError: ('invalid syntax', ('/usr/lib/python2.6/site-packages/django/test/signals.py', 103, 41, "    if kwargs['setting'] in {'LANGUAGES', 'LANGUAGE_CODE', 'LOCALE_PATHS'}:\n"))
  
      SyntaxError: ('invalid syntax', ('/usr/lib/python2.6/site-packages/django/db/backends/mysql/schema.py', 39, 61, "        return field.db_type(self.connection) in {'longtext', 'longblob'}\n"))
  
      SyntaxError: ('invalid syntax', ('/usr/lib/python2.6/site-packages/django/db/models/fields/__init__.py', 639, 21, "            'iexact', 'contains', 'icontains',\n"))
  
      SyntaxError: ('invalid syntax', ('/usr/lib/python2.6/site-packages/django/db/utils.py', 190, 44, '    TEST_SETTING_RENAMES_REVERSE = {v: k for k, v in TEST_SETTING_RENAMES.items()}\n'))
  
      SyntaxError: ('invalid syntax', ('/usr/lib/python2.6/site-packages/django/template/loader_tags.py', 145, 19, '                for name, var in six.iteritems(self.extra_context)\n'))
  
      SyntaxError: ('invalid syntax', ('/usr/lib/python2.6/site-packages/django/forms/utils.py', 57, 34, '        return {f: e.as_data() for f, e in self.items()}\n'))
  
      changing mode of /usr/bin/django-admin.py to 755
      Installing django-admin script to /usr/bin
  Successfully installed django
  Cleaning up...
  </code></pre>
  
  <p>I am pretty sure I am not the first one using Django on EC2, so I was wondering if someone already came across this issue. </p>
  
  <p>Thanks in advance. </p>