title: Django-admin.py runserver not working
body: <p>I am new to python and django and I recently faced some problems.
  Django-admin.py runserver does not work (ubuntu 12.04).</p>
  
  <p>Terminal error code:</p>
  
  <pre><code>    linas@ubuntu:~$ django-admin.py runserver
  Traceback (most recent call last):
    File "/usr/local/bin/django-admin.py", line 5, in &lt;module&gt;
      management.execute_from_command_line()
    File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 443, in execute_from_command_line
      utility.execute()
    File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 382, in execute
      self.fetch_command(subcommand).run_from_argv(self.argv)
    File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 261, in fetch_command
      klass = load_command_class(app_name, subcommand)
    File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 69, in load_command_class
      module = import_module('%s.management.commands.%s' % (app_name, name))
    File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 35, in import_module
      __import__(name)
    File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/runserver.py", line 8, in &lt;module&gt;
      from django.core.servers.basehttp import AdminMediaHandler, run, WSGIServerException, get_internal_wsgi_application
    File "/usr/local/lib/python2.7/dist-packages/django/core/servers/basehttp.py", line 26, in &lt;module&gt;
      from django.views import static
    File "/usr/local/lib/python2.7/dist-packages/django/views/static.py", line 95, in &lt;module&gt;
      template_translatable = ugettext_noop(u"Index of %(directory)s")
    File "/usr/local/lib/python2.7/dist-packages/django/utils/translation/__init__.py", line 75, in gettext_noop
      return _trans.gettext_noop(message)
    File "/usr/local/lib/python2.7/dist-packages/django/utils/translation/__init__.py", line 48, in __getattr__
      if settings.USE_I18N:
    File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line 184, in inner
      self._setup()
    File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 40, in _setup
      raise ImportError("Settings cannot be imported, because environment variable %s is undefined." % ENVIRONMENT_VARIABLE)
  ImportError: Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined.
  </code></pre>
  
  <p>Thanks for any help.</p>
  
  <p>EDIT:
  This is what i get when i use ./manage.py runserver</p>
  
  <pre><code>linas@ubuntu:~/Dokumentai/python/FirstBlog$ ./manage.py runserver
  Validating models...
  
  Unhandled exception in thread started by &lt;bound method Command.inner_run of &lt;django.contrib.staticfiles.management.commands.runserver.Command object at 0x1148c90&gt;&gt;
  Traceback (most recent call last):
    File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/runserver.py", line 91, in inner_run
      self.validate(display_num_errors=True)
    File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 266, in validate
      num_errors = get_validation_errors(s, app)
    File "/usr/local/lib/python2.7/dist-packages/django/core/management/validation.py", line 103, in get_validation_errors
      connection.validation.validate_field(e, opts, f)
    File "/usr/local/lib/python2.7/dist-packages/django/db/backends/mysql/validation.py", line 14, in validate_field
      db_version = self.connection.get_server_version()
    File "/usr/local/lib/python2.7/dist-packages/django/db/backends/mysql/base.py", line 411, in get_server_version
      self.cursor()
    File "/usr/local/lib/python2.7/dist-packages/django/db/backends/__init__.py", line 306, in cursor
      cursor = self.make_debug_cursor(self._cursor())
    File "/usr/local/lib/python2.7/dist-packages/django/db/backends/mysql/base.py", line 387, in _cursor
      self.connection = Database.connect(**kwargs)
    File "/usr/local/lib/python2.7/dist-packages/MySQL_python-1.2.3-py2.7-linux-x86_64.egg/MySQLdb/__init__.py", line 81, in Connect
      return Connection(*args, **kwargs)
    File "/usr/local/lib/python2.7/dist-packages/MySQL_python-1.2.3-py2.7-linux-x86_64.egg/MySQLdb/connections.py", line 187, in __init__
      super(Connection, self).__init__(*args, **kwargs2)
  _mysql_exceptions.OperationalError: (1049, "Unknown database 'FirstBlog'")
  </code></pre>