Skip to content

Commit 98f0e9e

Browse files
committed
folders
1 parent 9e268a4 commit 98f0e9e

File tree

8 files changed

+164
-0
lines changed

8 files changed

+164
-0
lines changed

news/__init__.py

Whitespace-only changes.

news/__init__.pyc

135 Bytes
Binary file not shown.

news/settings.py

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
"""
2+
Django settings for news project.
3+
4+
Generated by 'django-admin startproject' using Django 1.9.2.
5+
6+
For more information on this file, see
7+
https://docs.djangoproject.com/en/1.9/topics/settings/
8+
9+
For the full list of settings and their values, see
10+
https://docs.djangoproject.com/en/1.9/ref/settings/
11+
"""
12+
13+
import os
14+
15+
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
16+
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
17+
18+
19+
# Quick-start development settings - unsuitable for production
20+
# See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/
21+
22+
# SECURITY WARNING: keep the secret key used in production secret!
23+
SECRET_KEY = ')-zdrzj*^(e#zy%u43$2kkdz9s7a@s0_v_f)=pg4hq^ypu^fty'
24+
25+
# SECURITY WARNING: don't run with debug turned on in production!
26+
DEBUG = True
27+
28+
ALLOWED_HOSTS = []
29+
30+
31+
# Application definition
32+
33+
INSTALLED_APPS = [
34+
'posts',
35+
'django.contrib.admin',
36+
'django.contrib.auth',
37+
'django.contrib.contenttypes',
38+
'django.contrib.sessions',
39+
'django.contrib.messages',
40+
'django.contrib.staticfiles',
41+
]
42+
43+
MIDDLEWARE_CLASSES = [
44+
'django.middleware.security.SecurityMiddleware',
45+
'django.contrib.sessions.middleware.SessionMiddleware',
46+
'django.middleware.common.CommonMiddleware',
47+
'django.middleware.csrf.CsrfViewMiddleware',
48+
'django.contrib.auth.middleware.AuthenticationMiddleware',
49+
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
50+
'django.contrib.messages.middleware.MessageMiddleware',
51+
'django.middleware.clickjacking.XFrameOptionsMiddleware',
52+
]
53+
54+
ROOT_URLCONF = 'news.urls'
55+
56+
TEMPLATES = [
57+
{
58+
'BACKEND': 'django.template.backends.django.DjangoTemplates',
59+
'DIRS': [os.path.join(BASE_DIR, 'templates')]
60+
,
61+
'APP_DIRS': True,
62+
'OPTIONS': {
63+
'context_processors': [
64+
'django.template.context_processors.debug',
65+
'django.template.context_processors.request',
66+
'django.contrib.auth.context_processors.auth',
67+
'django.contrib.messages.context_processors.messages',
68+
],
69+
},
70+
},
71+
]
72+
73+
WSGI_APPLICATION = 'news.wsgi.application'
74+
75+
76+
# Database
77+
# https://docs.djangoproject.com/en/1.9/ref/settings/#databases
78+
79+
DATABASES = {
80+
'default': {
81+
'ENGINE': 'django.db.backends.mysql',
82+
'NAME': 'news',
83+
'USER':'root',
84+
'PASSWORD':'root',
85+
'HOST':'localhost',
86+
'PORT':'3306'
87+
}
88+
}
89+
90+
91+
# Password validation
92+
# https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators
93+
94+
AUTH_PASSWORD_VALIDATORS = [
95+
{
96+
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
97+
},
98+
{
99+
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
100+
},
101+
{
102+
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
103+
},
104+
{
105+
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
106+
},
107+
]
108+
109+
110+
# Internationalization
111+
# https://docs.djangoproject.com/en/1.9/topics/i18n/
112+
113+
LANGUAGE_CODE = 'en-us'
114+
115+
TIME_ZONE = 'UTC'
116+
117+
USE_I18N = True
118+
119+
USE_L10N = True
120+
121+
USE_TZ = True
122+
123+
124+
# Static files (CSS, JavaScript, Images)
125+
# https://docs.djangoproject.com/en/1.9/howto/static-files/
126+
127+
STATIC_URL = '/static/'

news/settings.pyc

2.7 KB
Binary file not shown.

news/urls.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
"""news URL Configuration
2+
3+
The `urlpatterns` list routes URLs to views. For more information please see:
4+
https://docs.djangoproject.com/en/1.9/topics/http/urls/
5+
Examples:
6+
Function views
7+
1. Add an import: from my_app import views
8+
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
9+
Class-based views
10+
1. Add an import: from other_app.views import Home
11+
2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home')
12+
Including another URLconf
13+
1. Import the include() function: from django.conf.urls import url, include
14+
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
15+
"""
16+
from django.conf.urls import url
17+
from django.contrib import admin
18+
19+
urlpatterns = [
20+
url(r'^admin/', admin.site.urls),
21+
]

news/urls.pyc

975 Bytes
Binary file not shown.

news/wsgi.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
WSGI config for news project.
3+
4+
It exposes the WSGI callable as a module-level variable named ``application``.
5+
6+
For more information on this file, see
7+
https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/
8+
"""
9+
10+
import os
11+
12+
from django.core.wsgi import get_wsgi_application
13+
14+
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "news.settings")
15+
16+
application = get_wsgi_application()

news/wsgi.pyc

586 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)