diff --git a/src/.gitignore b/src/.gitignore deleted file mode 100644 index 2dd724d..0000000 --- a/src/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -db.sqlite3 -geckodriver.log -virtualenv -**__pycache__** \ No newline at end of file diff --git a/src/chap1/functional_tests.py b/src/chap1/functional_tests.py deleted file mode 100644 index d9f9595..0000000 --- a/src/chap1/functional_tests.py +++ /dev/null @@ -1,6 +0,0 @@ -from selenium import webdriver - -browser = webdriver.Firefox() -browser.get('http://localhost:8000') - -assert 'Django' in browser.title \ No newline at end of file diff --git a/src/chap1/manage.py b/src/chap1/manage.py deleted file mode 100755 index 3e6d019..0000000 --- a/src/chap1/manage.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python -import os -import sys - -if __name__ == "__main__": - os.environ.setdefault("DJANGO_SETTINGS_MODULE", "superlists.settings") - try: - from django.core.management import execute_from_command_line - except ImportError: - # The above import may fail for some other reason. Ensure that the - # issue is really that Django is missing to avoid masking other - # exceptions on Python 2. - try: - import django - except ImportError: - raise ImportError( - "Couldn't import Django. Are you sure it's installed and " - "available on your PYTHONPATH environment variable? Did you " - "forget to activate a virtual environment?" - ) - raise - execute_from_command_line(sys.argv) diff --git a/src/chap1/superlists/__init__.py b/src/chap1/superlists/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/chap1/superlists/settings.py b/src/chap1/superlists/settings.py deleted file mode 100644 index 647c044..0000000 --- a/src/chap1/superlists/settings.py +++ /dev/null @@ -1,120 +0,0 @@ -""" -Django settings for superlists project. - -Generated by 'django-admin startproject' using Django 1.11.29. - -For more information on this file, see -https://docs.djangoproject.com/en/1.11/topics/settings/ - -For the full list of settings and their values, see -https://docs.djangoproject.com/en/1.11/ref/settings/ -""" - -import os - -# Build paths inside the project like this: os.path.join(BASE_DIR, ...) -BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) - - -# Quick-start development settings - unsuitable for production -# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/ - -# SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = '_a7r3(0ov2(f)wc4xg5vthv4f-y2z!#x9^u6uvr$^8ofpb$o12' - -# SECURITY WARNING: don't run with debug turned on in production! -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 = [ - 'django.middleware.security.SecurityMiddleware', - '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 = 'superlists.urls' - -TEMPLATES = [ - { - 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [], - 'APP_DIRS': True, - 'OPTIONS': { - 'context_processors': [ - 'django.template.context_processors.debug', - 'django.template.context_processors.request', - 'django.contrib.auth.context_processors.auth', - 'django.contrib.messages.context_processors.messages', - ], - }, - }, -] - -WSGI_APPLICATION = 'superlists.wsgi.application' - - -# Database -# https://docs.djangoproject.com/en/1.11/ref/settings/#databases - -DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), - } -} - - -# Password validation -# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators - -AUTH_PASSWORD_VALIDATORS = [ - { - 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', - }, -] - - -# Internationalization -# https://docs.djangoproject.com/en/1.11/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.11/howto/static-files/ - -STATIC_URL = '/static/' diff --git a/src/chap1/superlists/urls.py b/src/chap1/superlists/urls.py deleted file mode 100644 index 5218133..0000000 --- a/src/chap1/superlists/urls.py +++ /dev/null @@ -1,21 +0,0 @@ -"""superlists URL Configuration - -The `urlpatterns` list routes URLs to views. For more information please see: - https://docs.djangoproject.com/en/1.11/topics/http/urls/ -Examples: -Function views - 1. Add an import: from my_app import views - 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') -Class-based views - 1. Add an import: from other_app.views import Home - 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') -Including another URLconf - 1. Import the include() function: from django.conf.urls import url, include - 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) -""" -from django.conf.urls import url -from django.contrib import admin - -urlpatterns = [ - url(r'^admin/', admin.site.urls), -] diff --git a/src/chap1/superlists/wsgi.py b/src/chap1/superlists/wsgi.py deleted file mode 100644 index e2d9e59..0000000 --- a/src/chap1/superlists/wsgi.py +++ /dev/null @@ -1,16 +0,0 @@ -""" -WSGI config for superlists project. - -It exposes the WSGI callable as a module-level variable named ``application``. - -For more information on this file, see -https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/ -""" - -import os - -from django.core.wsgi import get_wsgi_application - -os.environ.setdefault("DJANGO_SETTINGS_MODULE", "superlists.settings") - -application = get_wsgi_application() diff --git a/src/chap2/chap2_1/functional_tests.py b/src/chap2/chap2_1/functional_tests.py deleted file mode 100644 index 441c2ed..0000000 --- a/src/chap2/chap2_1/functional_tests.py +++ /dev/null @@ -1,33 +0,0 @@ -from selenium import webdriver - -browser = webdriver.Firefox() - -# Edith has heard about a cool new online to-do app. She goes -# to check out its homepage -browser.get('http://localhost:8000') - -# She notices the page title and header mention to-do lists -assert 'To-Do' in browser.title - -# She is invited to enter a to-do item straight away - -# She types "Buy peacock feathers" into a text box (Edith's hobby -# is tying fly-fishing lures) - -# When she hits enter, the page updates, and now the page lists -# "1: Buy peacock feathers" as an item in a to-do list - -# There is still a text box inviting her to add another item. She -# enters "Use peacock feathers to make a fly" (Edith is very methodical) - -# The page updates again, and now shows both items on her list - -# Edith wonders whether the site will remember her list. Then she sees -# that the site has generated a unique URL for her -- there is some -# explanatory text to that effect. - -# She visits that URL - her to-do list is still there. - -# Satisfied, she goes back to sleep - -browser.quit() \ No newline at end of file diff --git a/src/chap2/chap2_1/manage.py b/src/chap2/chap2_1/manage.py deleted file mode 100755 index 3e6d019..0000000 --- a/src/chap2/chap2_1/manage.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python -import os -import sys - -if __name__ == "__main__": - os.environ.setdefault("DJANGO_SETTINGS_MODULE", "superlists.settings") - try: - from django.core.management import execute_from_command_line - except ImportError: - # The above import may fail for some other reason. Ensure that the - # issue is really that Django is missing to avoid masking other - # exceptions on Python 2. - try: - import django - except ImportError: - raise ImportError( - "Couldn't import Django. Are you sure it's installed and " - "available on your PYTHONPATH environment variable? Did you " - "forget to activate a virtual environment?" - ) - raise - execute_from_command_line(sys.argv) diff --git a/src/chap2/chap2_1/superlists/__init__.py b/src/chap2/chap2_1/superlists/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/chap2/chap2_1/superlists/settings.py b/src/chap2/chap2_1/superlists/settings.py deleted file mode 100644 index 982385b..0000000 --- a/src/chap2/chap2_1/superlists/settings.py +++ /dev/null @@ -1,120 +0,0 @@ -""" -Django settings for superlists project. - -Generated by 'django-admin startproject' using Django 1.11.29. - -For more information on this file, see -https://docs.djangoproject.com/en/1.11/topics/settings/ - -For the full list of settings and their values, see -https://docs.djangoproject.com/en/1.11/ref/settings/ -""" - -import os - -# Build paths inside the project like this: os.path.join(BASE_DIR, ...) -BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) - - -# Quick-start development settings - unsuitable for production -# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/ - -# SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = '6e)gc-^#bn@*3k)c#=l)7cu_95zc&zj4@@o%qddf#og697pz%a' - -# SECURITY WARNING: don't run with debug turned on in production! -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 = [ - 'django.middleware.security.SecurityMiddleware', - '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 = 'superlists.urls' - -TEMPLATES = [ - { - 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [], - 'APP_DIRS': True, - 'OPTIONS': { - 'context_processors': [ - 'django.template.context_processors.debug', - 'django.template.context_processors.request', - 'django.contrib.auth.context_processors.auth', - 'django.contrib.messages.context_processors.messages', - ], - }, - }, -] - -WSGI_APPLICATION = 'superlists.wsgi.application' - - -# Database -# https://docs.djangoproject.com/en/1.11/ref/settings/#databases - -DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), - } -} - - -# Password validation -# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators - -AUTH_PASSWORD_VALIDATORS = [ - { - 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', - }, -] - - -# Internationalization -# https://docs.djangoproject.com/en/1.11/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.11/howto/static-files/ - -STATIC_URL = '/static/' diff --git a/src/chap2/chap2_1/superlists/urls.py b/src/chap2/chap2_1/superlists/urls.py deleted file mode 100644 index 5218133..0000000 --- a/src/chap2/chap2_1/superlists/urls.py +++ /dev/null @@ -1,21 +0,0 @@ -"""superlists URL Configuration - -The `urlpatterns` list routes URLs to views. For more information please see: - https://docs.djangoproject.com/en/1.11/topics/http/urls/ -Examples: -Function views - 1. Add an import: from my_app import views - 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') -Class-based views - 1. Add an import: from other_app.views import Home - 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') -Including another URLconf - 1. Import the include() function: from django.conf.urls import url, include - 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) -""" -from django.conf.urls import url -from django.contrib import admin - -urlpatterns = [ - url(r'^admin/', admin.site.urls), -] diff --git a/src/chap2/chap2_1/superlists/wsgi.py b/src/chap2/chap2_1/superlists/wsgi.py deleted file mode 100644 index e2d9e59..0000000 --- a/src/chap2/chap2_1/superlists/wsgi.py +++ /dev/null @@ -1,16 +0,0 @@ -""" -WSGI config for superlists project. - -It exposes the WSGI callable as a module-level variable named ``application``. - -For more information on this file, see -https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/ -""" - -import os - -from django.core.wsgi import get_wsgi_application - -os.environ.setdefault("DJANGO_SETTINGS_MODULE", "superlists.settings") - -application = get_wsgi_application() diff --git a/src/chap2/chap2_2/functional_tests.py b/src/chap2/chap2_2/functional_tests.py deleted file mode 100644 index e407a3e..0000000 --- a/src/chap2/chap2_2/functional_tests.py +++ /dev/null @@ -1,25 +0,0 @@ -from selenium import webdriver -import unittest - -class NewVisitorTest(unittest.TestCase): - - def setUp(self): - self.browser = webdriver.Firefox() - - def tearDown(self): - self.browser.quit() - - def test_can_start_a_list_and_retrieve_it_later(self): - # Edith has heard about a cool new online to-do app. She goes - # to check out its homepage - self.browser.get('http://localhost:8000') - - # She notices the page title and header mention to-do lists - self.assertIn('To-Do', self.browser.title) - self.fail('Finish the test!') - - # She is invited to enter a to-do item straight away - # [...rest of comments as before] - -if __name__ == '__main__': - unittest.main() \ No newline at end of file diff --git a/src/chap2/chap2_2/manage.py b/src/chap2/chap2_2/manage.py deleted file mode 100755 index 3e6d019..0000000 --- a/src/chap2/chap2_2/manage.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python -import os -import sys - -if __name__ == "__main__": - os.environ.setdefault("DJANGO_SETTINGS_MODULE", "superlists.settings") - try: - from django.core.management import execute_from_command_line - except ImportError: - # The above import may fail for some other reason. Ensure that the - # issue is really that Django is missing to avoid masking other - # exceptions on Python 2. - try: - import django - except ImportError: - raise ImportError( - "Couldn't import Django. Are you sure it's installed and " - "available on your PYTHONPATH environment variable? Did you " - "forget to activate a virtual environment?" - ) - raise - execute_from_command_line(sys.argv) diff --git a/src/chap2/chap2_2/superlists/__init__.py b/src/chap2/chap2_2/superlists/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/chap2/chap2_2/superlists/settings.py b/src/chap2/chap2_2/superlists/settings.py deleted file mode 100644 index 5b13ab9..0000000 --- a/src/chap2/chap2_2/superlists/settings.py +++ /dev/null @@ -1,120 +0,0 @@ -""" -Django settings for superlists project. - -Generated by 'django-admin startproject' using Django 1.11.29. - -For more information on this file, see -https://docs.djangoproject.com/en/1.11/topics/settings/ - -For the full list of settings and their values, see -https://docs.djangoproject.com/en/1.11/ref/settings/ -""" - -import os - -# Build paths inside the project like this: os.path.join(BASE_DIR, ...) -BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) - - -# Quick-start development settings - unsuitable for production -# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/ - -# SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = 'ggg*d^_%l%(@go21&54hjh+-#b@qfo_0g)w)-&ehptwusbqr1p' - -# SECURITY WARNING: don't run with debug turned on in production! -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 = [ - 'django.middleware.security.SecurityMiddleware', - '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 = 'superlists.urls' - -TEMPLATES = [ - { - 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [], - 'APP_DIRS': True, - 'OPTIONS': { - 'context_processors': [ - 'django.template.context_processors.debug', - 'django.template.context_processors.request', - 'django.contrib.auth.context_processors.auth', - 'django.contrib.messages.context_processors.messages', - ], - }, - }, -] - -WSGI_APPLICATION = 'superlists.wsgi.application' - - -# Database -# https://docs.djangoproject.com/en/1.11/ref/settings/#databases - -DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), - } -} - - -# Password validation -# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators - -AUTH_PASSWORD_VALIDATORS = [ - { - 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', - }, -] - - -# Internationalization -# https://docs.djangoproject.com/en/1.11/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.11/howto/static-files/ - -STATIC_URL = '/static/' diff --git a/src/chap2/chap2_2/superlists/urls.py b/src/chap2/chap2_2/superlists/urls.py deleted file mode 100644 index 5218133..0000000 --- a/src/chap2/chap2_2/superlists/urls.py +++ /dev/null @@ -1,21 +0,0 @@ -"""superlists URL Configuration - -The `urlpatterns` list routes URLs to views. For more information please see: - https://docs.djangoproject.com/en/1.11/topics/http/urls/ -Examples: -Function views - 1. Add an import: from my_app import views - 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') -Class-based views - 1. Add an import: from other_app.views import Home - 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') -Including another URLconf - 1. Import the include() function: from django.conf.urls import url, include - 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) -""" -from django.conf.urls import url -from django.contrib import admin - -urlpatterns = [ - url(r'^admin/', admin.site.urls), -] diff --git a/src/chap2/chap2_2/superlists/wsgi.py b/src/chap2/chap2_2/superlists/wsgi.py deleted file mode 100644 index e2d9e59..0000000 --- a/src/chap2/chap2_2/superlists/wsgi.py +++ /dev/null @@ -1,16 +0,0 @@ -""" -WSGI config for superlists project. - -It exposes the WSGI callable as a module-level variable named ``application``. - -For more information on this file, see -https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/ -""" - -import os - -from django.core.wsgi import get_wsgi_application - -os.environ.setdefault("DJANGO_SETTINGS_MODULE", "superlists.settings") - -application = get_wsgi_application() diff --git a/src/chap3/chap3_1to3_3/lists/__init__.py b/src/chap3/chap3_1to3_3/lists/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/chap3/chap3_1to3_3/lists/admin.py b/src/chap3/chap3_1to3_3/lists/admin.py deleted file mode 100644 index 8c38f3f..0000000 --- a/src/chap3/chap3_1to3_3/lists/admin.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.contrib import admin - -# Register your models here. diff --git a/src/chap3/chap3_1to3_3/lists/apps.py b/src/chap3/chap3_1to3_3/lists/apps.py deleted file mode 100644 index efe43f0..0000000 --- a/src/chap3/chap3_1to3_3/lists/apps.py +++ /dev/null @@ -1,5 +0,0 @@ -from django.apps import AppConfig - - -class ListsConfig(AppConfig): - name = 'lists' diff --git a/src/chap3/chap3_1to3_3/lists/migrations/__init__.py b/src/chap3/chap3_1to3_3/lists/migrations/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/chap3/chap3_1to3_3/lists/models.py b/src/chap3/chap3_1to3_3/lists/models.py deleted file mode 100644 index 71a8362..0000000 --- a/src/chap3/chap3_1to3_3/lists/models.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.db import models - -# Create your models here. diff --git a/src/chap3/chap3_1to3_3/lists/tests.py b/src/chap3/chap3_1to3_3/lists/tests.py deleted file mode 100644 index 7408669..0000000 --- a/src/chap3/chap3_1to3_3/lists/tests.py +++ /dev/null @@ -1,8 +0,0 @@ -from django.test import TestCase - -# Create your tests here. - -class SmokeTest(TestCase): - - def test_bad_maths(self): - self.assertEqual(1+1,3) \ No newline at end of file diff --git a/src/chap3/chap3_1to3_3/lists/views.py b/src/chap3/chap3_1to3_3/lists/views.py deleted file mode 100644 index 91ea44a..0000000 --- a/src/chap3/chap3_1to3_3/lists/views.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.shortcuts import render - -# Create your views here. diff --git a/src/chap3/chap3_1to3_3/manage.py b/src/chap3/chap3_1to3_3/manage.py deleted file mode 100755 index 3e6d019..0000000 --- a/src/chap3/chap3_1to3_3/manage.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python -import os -import sys - -if __name__ == "__main__": - os.environ.setdefault("DJANGO_SETTINGS_MODULE", "superlists.settings") - try: - from django.core.management import execute_from_command_line - except ImportError: - # The above import may fail for some other reason. Ensure that the - # issue is really that Django is missing to avoid masking other - # exceptions on Python 2. - try: - import django - except ImportError: - raise ImportError( - "Couldn't import Django. Are you sure it's installed and " - "available on your PYTHONPATH environment variable? Did you " - "forget to activate a virtual environment?" - ) - raise - execute_from_command_line(sys.argv) diff --git a/src/chap3/chap3_1to3_3/superlists/__init__.py b/src/chap3/chap3_1to3_3/superlists/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/chap3/chap3_1to3_3/superlists/settings.py b/src/chap3/chap3_1to3_3/superlists/settings.py deleted file mode 100644 index a396f71..0000000 --- a/src/chap3/chap3_1to3_3/superlists/settings.py +++ /dev/null @@ -1,120 +0,0 @@ -""" -Django settings for superlists project. - -Generated by 'django-admin startproject' using Django 1.11.29. - -For more information on this file, see -https://docs.djangoproject.com/en/1.11/topics/settings/ - -For the full list of settings and their values, see -https://docs.djangoproject.com/en/1.11/ref/settings/ -""" - -import os - -# Build paths inside the project like this: os.path.join(BASE_DIR, ...) -BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) - - -# Quick-start development settings - unsuitable for production -# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/ - -# SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = '5ty+3qgs$cadiv2l4)a)#ikp1=bfd$41^d^@07#!q(t4_$6igh' - -# SECURITY WARNING: don't run with debug turned on in production! -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 = [ - 'django.middleware.security.SecurityMiddleware', - '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 = 'superlists.urls' - -TEMPLATES = [ - { - 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [], - 'APP_DIRS': True, - 'OPTIONS': { - 'context_processors': [ - 'django.template.context_processors.debug', - 'django.template.context_processors.request', - 'django.contrib.auth.context_processors.auth', - 'django.contrib.messages.context_processors.messages', - ], - }, - }, -] - -WSGI_APPLICATION = 'superlists.wsgi.application' - - -# Database -# https://docs.djangoproject.com/en/1.11/ref/settings/#databases - -DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), - } -} - - -# Password validation -# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators - -AUTH_PASSWORD_VALIDATORS = [ - { - 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', - }, -] - - -# Internationalization -# https://docs.djangoproject.com/en/1.11/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.11/howto/static-files/ - -STATIC_URL = '/static/' diff --git a/src/chap3/chap3_1to3_3/superlists/urls.py b/src/chap3/chap3_1to3_3/superlists/urls.py deleted file mode 100644 index 5218133..0000000 --- a/src/chap3/chap3_1to3_3/superlists/urls.py +++ /dev/null @@ -1,21 +0,0 @@ -"""superlists URL Configuration - -The `urlpatterns` list routes URLs to views. For more information please see: - https://docs.djangoproject.com/en/1.11/topics/http/urls/ -Examples: -Function views - 1. Add an import: from my_app import views - 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') -Class-based views - 1. Add an import: from other_app.views import Home - 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') -Including another URLconf - 1. Import the include() function: from django.conf.urls import url, include - 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) -""" -from django.conf.urls import url -from django.contrib import admin - -urlpatterns = [ - url(r'^admin/', admin.site.urls), -] diff --git a/src/chap3/chap3_1to3_3/superlists/wsgi.py b/src/chap3/chap3_1to3_3/superlists/wsgi.py deleted file mode 100644 index e2d9e59..0000000 --- a/src/chap3/chap3_1to3_3/superlists/wsgi.py +++ /dev/null @@ -1,16 +0,0 @@ -""" -WSGI config for superlists project. - -It exposes the WSGI callable as a module-level variable named ``application``. - -For more information on this file, see -https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/ -""" - -import os - -from django.core.wsgi import get_wsgi_application - -os.environ.setdefault("DJANGO_SETTINGS_MODULE", "superlists.settings") - -application = get_wsgi_application() diff --git a/src/chap3/chap3_4/lists/__init__.py b/src/chap3/chap3_4/lists/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/chap3/chap3_4/lists/admin.py b/src/chap3/chap3_4/lists/admin.py deleted file mode 100644 index 8c38f3f..0000000 --- a/src/chap3/chap3_4/lists/admin.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.contrib import admin - -# Register your models here. diff --git a/src/chap3/chap3_4/lists/apps.py b/src/chap3/chap3_4/lists/apps.py deleted file mode 100644 index efe43f0..0000000 --- a/src/chap3/chap3_4/lists/apps.py +++ /dev/null @@ -1,5 +0,0 @@ -from django.apps import AppConfig - - -class ListsConfig(AppConfig): - name = 'lists' diff --git a/src/chap3/chap3_4/lists/migrations/__init__.py b/src/chap3/chap3_4/lists/migrations/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/chap3/chap3_4/lists/models.py b/src/chap3/chap3_4/lists/models.py deleted file mode 100644 index 71a8362..0000000 --- a/src/chap3/chap3_4/lists/models.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.db import models - -# Create your models here. diff --git a/src/chap3/chap3_4/lists/tests.py b/src/chap3/chap3_4/lists/tests.py deleted file mode 100644 index 0b821f6..0000000 --- a/src/chap3/chap3_4/lists/tests.py +++ /dev/null @@ -1,9 +0,0 @@ -from django.urls import resolve -from django.test import TestCase -from lists.views import home_page - -class HomePageTest(TestCase): - - def test_root_url_resolves_to_home_page_view(self): - found = resolve('/') - self.assertEqual(found.func, home_page) \ No newline at end of file diff --git a/src/chap3/chap3_4/lists/views.py b/src/chap3/chap3_4/lists/views.py deleted file mode 100644 index 91ea44a..0000000 --- a/src/chap3/chap3_4/lists/views.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.shortcuts import render - -# Create your views here. diff --git a/src/chap3/chap3_4/manage.py b/src/chap3/chap3_4/manage.py deleted file mode 100755 index 3e6d019..0000000 --- a/src/chap3/chap3_4/manage.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python -import os -import sys - -if __name__ == "__main__": - os.environ.setdefault("DJANGO_SETTINGS_MODULE", "superlists.settings") - try: - from django.core.management import execute_from_command_line - except ImportError: - # The above import may fail for some other reason. Ensure that the - # issue is really that Django is missing to avoid masking other - # exceptions on Python 2. - try: - import django - except ImportError: - raise ImportError( - "Couldn't import Django. Are you sure it's installed and " - "available on your PYTHONPATH environment variable? Did you " - "forget to activate a virtual environment?" - ) - raise - execute_from_command_line(sys.argv) diff --git a/src/chap3/chap3_4/superlists/__init__.py b/src/chap3/chap3_4/superlists/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/chap3/chap3_4/superlists/settings.py b/src/chap3/chap3_4/superlists/settings.py deleted file mode 100644 index 54cbafa..0000000 --- a/src/chap3/chap3_4/superlists/settings.py +++ /dev/null @@ -1,120 +0,0 @@ -""" -Django settings for superlists project. - -Generated by 'django-admin startproject' using Django 1.11.29. - -For more information on this file, see -https://docs.djangoproject.com/en/1.11/topics/settings/ - -For the full list of settings and their values, see -https://docs.djangoproject.com/en/1.11/ref/settings/ -""" - -import os - -# Build paths inside the project like this: os.path.join(BASE_DIR, ...) -BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) - - -# Quick-start development settings - unsuitable for production -# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/ - -# SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = '#6+4!ag2iymg67a2y06_omvdag6x8^%f!&9qj_^1ael6wh9dtz' - -# SECURITY WARNING: don't run with debug turned on in production! -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 = [ - 'django.middleware.security.SecurityMiddleware', - '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 = 'superlists.urls' - -TEMPLATES = [ - { - 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [], - 'APP_DIRS': True, - 'OPTIONS': { - 'context_processors': [ - 'django.template.context_processors.debug', - 'django.template.context_processors.request', - 'django.contrib.auth.context_processors.auth', - 'django.contrib.messages.context_processors.messages', - ], - }, - }, -] - -WSGI_APPLICATION = 'superlists.wsgi.application' - - -# Database -# https://docs.djangoproject.com/en/1.11/ref/settings/#databases - -DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), - } -} - - -# Password validation -# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators - -AUTH_PASSWORD_VALIDATORS = [ - { - 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', - }, -] - - -# Internationalization -# https://docs.djangoproject.com/en/1.11/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.11/howto/static-files/ - -STATIC_URL = '/static/' diff --git a/src/chap3/chap3_4/superlists/urls.py b/src/chap3/chap3_4/superlists/urls.py deleted file mode 100644 index 5218133..0000000 --- a/src/chap3/chap3_4/superlists/urls.py +++ /dev/null @@ -1,21 +0,0 @@ -"""superlists URL Configuration - -The `urlpatterns` list routes URLs to views. For more information please see: - https://docs.djangoproject.com/en/1.11/topics/http/urls/ -Examples: -Function views - 1. Add an import: from my_app import views - 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') -Class-based views - 1. Add an import: from other_app.views import Home - 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') -Including another URLconf - 1. Import the include() function: from django.conf.urls import url, include - 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) -""" -from django.conf.urls import url -from django.contrib import admin - -urlpatterns = [ - url(r'^admin/', admin.site.urls), -] diff --git a/src/chap3/chap3_4/superlists/wsgi.py b/src/chap3/chap3_4/superlists/wsgi.py deleted file mode 100644 index e2d9e59..0000000 --- a/src/chap3/chap3_4/superlists/wsgi.py +++ /dev/null @@ -1,16 +0,0 @@ -""" -WSGI config for superlists project. - -It exposes the WSGI callable as a module-level variable named ``application``. - -For more information on this file, see -https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/ -""" - -import os - -from django.core.wsgi import get_wsgi_application - -os.environ.setdefault("DJANGO_SETTINGS_MODULE", "superlists.settings") - -application = get_wsgi_application() diff --git a/src/chap3/chap3_5/lists/__init__.py b/src/chap3/chap3_5/lists/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/chap3/chap3_5/lists/admin.py b/src/chap3/chap3_5/lists/admin.py deleted file mode 100644 index 8c38f3f..0000000 --- a/src/chap3/chap3_5/lists/admin.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.contrib import admin - -# Register your models here. diff --git a/src/chap3/chap3_5/lists/apps.py b/src/chap3/chap3_5/lists/apps.py deleted file mode 100644 index efe43f0..0000000 --- a/src/chap3/chap3_5/lists/apps.py +++ /dev/null @@ -1,5 +0,0 @@ -from django.apps import AppConfig - - -class ListsConfig(AppConfig): - name = 'lists' diff --git a/src/chap3/chap3_5/lists/migrations/__init__.py b/src/chap3/chap3_5/lists/migrations/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/chap3/chap3_5/lists/models.py b/src/chap3/chap3_5/lists/models.py deleted file mode 100644 index 71a8362..0000000 --- a/src/chap3/chap3_5/lists/models.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.db import models - -# Create your models here. diff --git a/src/chap3/chap3_5/lists/tests.py b/src/chap3/chap3_5/lists/tests.py deleted file mode 100644 index 0b821f6..0000000 --- a/src/chap3/chap3_5/lists/tests.py +++ /dev/null @@ -1,9 +0,0 @@ -from django.urls import resolve -from django.test import TestCase -from lists.views import home_page - -class HomePageTest(TestCase): - - def test_root_url_resolves_to_home_page_view(self): - found = resolve('/') - self.assertEqual(found.func, home_page) \ No newline at end of file diff --git a/src/chap3/chap3_5/lists/views.py b/src/chap3/chap3_5/lists/views.py deleted file mode 100644 index f5ed220..0000000 --- a/src/chap3/chap3_5/lists/views.py +++ /dev/null @@ -1,4 +0,0 @@ -from django.shortcuts import render - -# Create your views here. -home_page = None \ No newline at end of file diff --git a/src/chap3/chap3_5/manage.py b/src/chap3/chap3_5/manage.py deleted file mode 100755 index 3e6d019..0000000 --- a/src/chap3/chap3_5/manage.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python -import os -import sys - -if __name__ == "__main__": - os.environ.setdefault("DJANGO_SETTINGS_MODULE", "superlists.settings") - try: - from django.core.management import execute_from_command_line - except ImportError: - # The above import may fail for some other reason. Ensure that the - # issue is really that Django is missing to avoid masking other - # exceptions on Python 2. - try: - import django - except ImportError: - raise ImportError( - "Couldn't import Django. Are you sure it's installed and " - "available on your PYTHONPATH environment variable? Did you " - "forget to activate a virtual environment?" - ) - raise - execute_from_command_line(sys.argv) diff --git a/src/chap3/chap3_5/superlists/__init__.py b/src/chap3/chap3_5/superlists/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/chap3/chap3_5/superlists/settings.py b/src/chap3/chap3_5/superlists/settings.py deleted file mode 100644 index 58530b5..0000000 --- a/src/chap3/chap3_5/superlists/settings.py +++ /dev/null @@ -1,120 +0,0 @@ -""" -Django settings for superlists project. - -Generated by 'django-admin startproject' using Django 1.11.29. - -For more information on this file, see -https://docs.djangoproject.com/en/1.11/topics/settings/ - -For the full list of settings and their values, see -https://docs.djangoproject.com/en/1.11/ref/settings/ -""" - -import os - -# Build paths inside the project like this: os.path.join(BASE_DIR, ...) -BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) - - -# Quick-start development settings - unsuitable for production -# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/ - -# SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = '*2g@&(o7elmv%%3ar%))=v6d9*yr-c62-=x^rv#*#$)@pv$r*-' - -# SECURITY WARNING: don't run with debug turned on in production! -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 = [ - 'django.middleware.security.SecurityMiddleware', - '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 = 'superlists.urls' - -TEMPLATES = [ - { - 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [], - 'APP_DIRS': True, - 'OPTIONS': { - 'context_processors': [ - 'django.template.context_processors.debug', - 'django.template.context_processors.request', - 'django.contrib.auth.context_processors.auth', - 'django.contrib.messages.context_processors.messages', - ], - }, - }, -] - -WSGI_APPLICATION = 'superlists.wsgi.application' - - -# Database -# https://docs.djangoproject.com/en/1.11/ref/settings/#databases - -DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), - } -} - - -# Password validation -# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators - -AUTH_PASSWORD_VALIDATORS = [ - { - 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', - }, -] - - -# Internationalization -# https://docs.djangoproject.com/en/1.11/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.11/howto/static-files/ - -STATIC_URL = '/static/' diff --git a/src/chap3/chap3_5/superlists/urls.py b/src/chap3/chap3_5/superlists/urls.py deleted file mode 100644 index 5218133..0000000 --- a/src/chap3/chap3_5/superlists/urls.py +++ /dev/null @@ -1,21 +0,0 @@ -"""superlists URL Configuration - -The `urlpatterns` list routes URLs to views. For more information please see: - https://docs.djangoproject.com/en/1.11/topics/http/urls/ -Examples: -Function views - 1. Add an import: from my_app import views - 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') -Class-based views - 1. Add an import: from other_app.views import Home - 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') -Including another URLconf - 1. Import the include() function: from django.conf.urls import url, include - 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) -""" -from django.conf.urls import url -from django.contrib import admin - -urlpatterns = [ - url(r'^admin/', admin.site.urls), -] diff --git a/src/chap3/chap3_5/superlists/wsgi.py b/src/chap3/chap3_5/superlists/wsgi.py deleted file mode 100644 index e2d9e59..0000000 --- a/src/chap3/chap3_5/superlists/wsgi.py +++ /dev/null @@ -1,16 +0,0 @@ -""" -WSGI config for superlists project. - -It exposes the WSGI callable as a module-level variable named ``application``. - -For more information on this file, see -https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/ -""" - -import os - -from django.core.wsgi import get_wsgi_application - -os.environ.setdefault("DJANGO_SETTINGS_MODULE", "superlists.settings") - -application = get_wsgi_application() diff --git a/src/chap3/chap3_6/manage.py b/src/chap3/chap3_6/manage.py deleted file mode 100755 index 3e6d019..0000000 --- a/src/chap3/chap3_6/manage.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python -import os -import sys - -if __name__ == "__main__": - os.environ.setdefault("DJANGO_SETTINGS_MODULE", "superlists.settings") - try: - from django.core.management import execute_from_command_line - except ImportError: - # The above import may fail for some other reason. Ensure that the - # issue is really that Django is missing to avoid masking other - # exceptions on Python 2. - try: - import django - except ImportError: - raise ImportError( - "Couldn't import Django. Are you sure it's installed and " - "available on your PYTHONPATH environment variable? Did you " - "forget to activate a virtual environment?" - ) - raise - execute_from_command_line(sys.argv) diff --git a/src/chap3/chap3_6/superlists/__init__.py b/src/chap3/chap3_6/superlists/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/chap3/chap3_6/superlists/settings.py b/src/chap3/chap3_6/superlists/settings.py deleted file mode 100644 index 77a0a04..0000000 --- a/src/chap3/chap3_6/superlists/settings.py +++ /dev/null @@ -1,120 +0,0 @@ -""" -Django settings for superlists project. - -Generated by 'django-admin startproject' using Django 1.11.29. - -For more information on this file, see -https://docs.djangoproject.com/en/1.11/topics/settings/ - -For the full list of settings and their values, see -https://docs.djangoproject.com/en/1.11/ref/settings/ -""" - -import os - -# Build paths inside the project like this: os.path.join(BASE_DIR, ...) -BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) - - -# Quick-start development settings - unsuitable for production -# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/ - -# SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = 'u%&)mznxwwe=w9qf&2av0)iskzif&sncrq5un6@9e$r908&66)' - -# SECURITY WARNING: don't run with debug turned on in production! -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 = [ - 'django.middleware.security.SecurityMiddleware', - '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 = 'superlists.urls' - -TEMPLATES = [ - { - 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [], - 'APP_DIRS': True, - 'OPTIONS': { - 'context_processors': [ - 'django.template.context_processors.debug', - 'django.template.context_processors.request', - 'django.contrib.auth.context_processors.auth', - 'django.contrib.messages.context_processors.messages', - ], - }, - }, -] - -WSGI_APPLICATION = 'superlists.wsgi.application' - - -# Database -# https://docs.djangoproject.com/en/1.11/ref/settings/#databases - -DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), - } -} - - -# Password validation -# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators - -AUTH_PASSWORD_VALIDATORS = [ - { - 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', - }, -] - - -# Internationalization -# https://docs.djangoproject.com/en/1.11/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.11/howto/static-files/ - -STATIC_URL = '/static/' diff --git a/src/chap3/chap3_6/superlists/urls.py b/src/chap3/chap3_6/superlists/urls.py deleted file mode 100644 index 5218133..0000000 --- a/src/chap3/chap3_6/superlists/urls.py +++ /dev/null @@ -1,21 +0,0 @@ -"""superlists URL Configuration - -The `urlpatterns` list routes URLs to views. For more information please see: - https://docs.djangoproject.com/en/1.11/topics/http/urls/ -Examples: -Function views - 1. Add an import: from my_app import views - 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') -Class-based views - 1. Add an import: from other_app.views import Home - 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') -Including another URLconf - 1. Import the include() function: from django.conf.urls import url, include - 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) -""" -from django.conf.urls import url -from django.contrib import admin - -urlpatterns = [ - url(r'^admin/', admin.site.urls), -] diff --git a/src/chap3/chap3_6/superlists/wsgi.py b/src/chap3/chap3_6/superlists/wsgi.py deleted file mode 100644 index e2d9e59..0000000 --- a/src/chap3/chap3_6/superlists/wsgi.py +++ /dev/null @@ -1,16 +0,0 @@ -""" -WSGI config for superlists project. - -It exposes the WSGI callable as a module-level variable named ``application``. - -For more information on this file, see -https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/ -""" - -import os - -from django.core.wsgi import get_wsgi_application - -os.environ.setdefault("DJANGO_SETTINGS_MODULE", "superlists.settings") - -application = get_wsgi_application()