Problems with default settings.py file
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 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 = # 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 # 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/' -- 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+unsubscr...@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/57bfb916-d170-4ad2-ab3c-18dbff7fd495%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Problems with default settings.py file
Thanks Felipe! On Monday, December 2, 2013 11:03:54 AM UTC-5, Felipe Coelho wrote: > > 2013/12/2 Blake Adams > > >> 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 >> 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 = >> >> # 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 >> # 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/' >> > > 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]. > > [1] > https://docs.djangoproject.com/en/dev/releases/1.6/#simplified-default-project-and-app-templates > [2] https://docs.djangoproject.com/en/1.6/ref/settings/ > -- 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+unsubscr...@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/63d4cceb-bc9a-46c5-a20e-d52adcb3ae33%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Best practice for utilizing vagrant and virtual env
I am following the getting started with Django tutorial and managed to finish the 1st project but when I re-entered Vagrant SSH all packages i installed on my vagrant shared folder and my virtual environment were gone. I think it might be because virtual box has several different version of my precise box. This might be whats causing the missing Envs and packages that ive already installed. It seems like im doing something wrong spinnng up the vagrant instance. Whats is best practice for setting up a development environment once in Vagrant SSH? Currently i have done: 1) Vagrant SSH 2) Installed default python packages (pip, dev, git, etc.) 3) Install Virtual env 4) CD to shared folder (ie /vagrant) 5) Create virtual env ( 'virtualenv env_name') 6) Source virtual env (source env_name/bin/activate) 7) Install Virtual env pkgs (ie. Django, pyscho2, etc.) Once im done for the day: 8) deactivate virtual env 9) exit out of ssh 10) vagrant halt Is this generally the correct workflow? I'm confused about step 5 in particular. Is this the correct way to create the virtual env or should I default to a different folder (the tutorial starts the folder with '~/')?. Am i'm shutting things down properly? Any help would be appreciated - Thanks in advance! Windows 7 (Cygwin) Python 2.7x Django 1.5x Vagrant 1.3 -- 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+unsubscr...@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/e903831d-816b-43a2-88f2-ad27caa5934f%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.