Monday, December 2, 2013

Re: Problems with default settings.py file

2013/12/2 Blake Adams <blakesadams@gmail.com>
Hello I am a python noob going through the getttingstarted with django tutorial.

For some reason When I start a new project, the default settings.py file is missing a lot of default settings (Admin, Media, Some of the Databse info, Statis_file, Logging, etc.).  Im looking for any direction on why this is happening and what I might be doing wrong.  Thanks!

Here is my current complete settings file below (version that gets created with missing info):

"""
Django settings for microblog2 project.

For more information on this file, see

For the full list of settings and their values, see
"""

# 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

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 

# 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 = 'microblog2.urls'

WSGI_APPLICATION = 'microblog2.wsgi.application'


# Database

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
    }
}

# Internationalization

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)

STATIC_URL = '/static/'

They are not "missing", they are just not specified. In 1.5, a lot of settings were present in the default settings file but they only contained the default values for those settings, you could easily remove them and nothing would change.

1.6 simplified [1] the default project template, it's a lot less confusing for someone who's just starting with Django, and if you need the extras, take a look at the settings reference [2].

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAP5dYfOrKVzL9viQb3FMN%2BwxJAfFqEEKbgesbEZg%3D%3DW26pv2RQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment