Note that there are some explanatory texts on larger screens.

plurals
  1. POConfiguring Django
    primarykey
    data
    text
    <p>I just installed Django 1.6 on OS X 10.8 with python 2.7 and am having trouble going through the tutorial. After setting creating a server called mysite by running:</p> <pre><code>django-admin.py startproject mysite </code></pre> <p>I then cd'ed into mysite and ran</p> <pre><code>python manage.py runserver </code></pre> <p>and got this error:</p> <pre><code>Traceback (most recent call last): File "manage.py", line 10, in &lt;module&gt; execute_from_command_line(sys.argv) File "/Library/Python/2.7/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line utility.execute() File "/Library/Python/2.7/site-packages/django/core/management/__init__.py", line 392, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/Library/Python/2.7/site-packages/django/core/management/base.py", line 242, in run_from_argv self.execute(*args, **options.__dict__) File "/Library/Python/2.7/site-packages/django/core/management/base.py", line 280, in execute translation.activate('en-us') File "/Library/Python/2.7/site-packages/django/utils/translation/__init__.py", line 130, in activate return _trans.activate(language) File "/Library/Python/2.7/site-packages/django/utils/translation/trans_real.py", line 188, in activate _active.value = translation(language) File "/Library/Python/2.7/site-packages/django/utils/translation/trans_real.py", line 177, in translation default_translation = _fetch(settings.LANGUAGE_CODE) File "/Library/Python/2.7/site-packages/django/utils/translation/trans_real.py", line 159, in _fetch app = import_module(appname) File "/Library/Python/2.7/site-packages/django/utils/importlib.py", line 40, in import_module __import__(name) File "/Library/Python/2.7/site-packages/django/contrib/admin/__init__.py", line 6, in &lt;module&gt; from django.contrib.admin.sites import AdminSite, site File "/Library/Python/2.7/site-packages/django/contrib/admin/sites.py", line 4, in &lt;module&gt; from django.contrib.admin.forms import AdminAuthenticationForm File "/Library/Python/2.7/site-packages/django/contrib/admin/forms.py", line 6, in &lt;module&gt; from django.contrib.auth.forms import AuthenticationForm File "/Library/Python/2.7/site-packages/django/contrib/auth/forms.py", line 17, in &lt;module&gt; from django.contrib.auth.models import User File "/Library/Python/2.7/site-packages/django/contrib/auth/models.py", line 361, in &lt;module&gt; class AbstractUser(AbstractBaseUser, PermissionsMixin): File "/Library/Python/2.7/site-packages/django/db/models/base.py", line 212, in __new__ new_class.add_to_class(field.name, copy.deepcopy(field)) File "/Library/Python/2.7/site-packages/django/db/models/base.py", line 264, in add_to_class value.contribute_to_class(cls, name) File "/Library/Python/2.7/site-packages/django/db/models/fields/__init__.py", line 303, in contribute_to_class cls._meta.add_field(self) File "/Library/Python/2.7/site-packages/django/db/models/options.py", line 172, in add_field self.local_fields.insert(bisect(self.local_fields, field), field) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/functools.py", line 56, in &lt;lambda&gt; '__lt__': [('__gt__', lambda self, other: other &lt; self), File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/functools.py", line 56, in &lt;lambda&gt; ......... </code></pre> <p>this error ends up being repeatedly printed until the end:</p> <p><strong>File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/functools.py", line 56, in '_<em>lt</em>_': [('_<em>gt</em>_', lambda self, other: other &lt; self),</strong></p> <p>And here are the last few lines of output:</p> <pre><code> File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/functools.py", line 56, in &lt;lambda&gt; '__lt__': [('__gt__', lambda self, other: other &lt; self), File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/functools.py", line 56, in &lt;lambda&gt; '__lt__': [('__gt__', lambda self, other: other &lt; self), File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/functools.py", line 56, in &lt;lambda&gt; '__lt__': [('__gt__', lambda self, other: other &lt; self), RuntimeError: maximum recursion depth exceeded while calling a Python object </code></pre> <p>After looking at the last line:</p> <pre><code>RuntimeError: maximum recursion depth exceeded while calling a Python object </code></pre> <p>I also ran:</p> <pre><code>django-admin.py check </code></pre> <p>and got this output:</p> <pre><code>django.core.exceptions.ImproperlyConfigured: Requested setting DEFAULT_INDEX_TABLESPACE, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings. </code></pre> <p>I also tried setting my environment variable in tcsh by typing in:</p> <pre><code>setenv DJANGO_SETTINGS_MODULE "mysite.settings" </code></pre> <p>but it still gave me the recursion depth error. Running</p> <pre><code>django-admin.py check </code></pre> <p>then gave me this error:</p> <pre><code>ImportError: Could not import settings 'mysite.settings' (Is it on sys.path? Is there an import error in the settings file?): No module named mysite.settings </code></pre> <p>Here is my settings.py:</p> <pre><code>""" Django settings for mysite project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # 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! SECRET_KEY = '3e%g^*y!3$2=ln75%usf2ftjf&amp;urt7&amp;kuj@_-yc+53pjm)$@9^' # 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', ) 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 = 'mysite.urls' WSGI_APPLICATION = 'mysite.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/' </code></pre> <p>And my file structure:</p> <pre><code>mysite/ manage.py mysite/ __init__.py settings.py urls.py __init__.pyc settings.pyc wsgi.py </code></pre> <p>I am a newbie at django and am really stuck. Can anyone offer some insight?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload