File tree Expand file tree Collapse file tree 4 files changed +11
-6
lines changed Expand file tree Collapse file tree 4 files changed +11
-6
lines changed Original file line number Diff line number Diff line change 3
3
import sys
4
4
5
5
if __name__ == "__main__" :
6
- os .environ .setdefault ("DJANGO_SETTINGS_MODULE" , "config.settings" )
6
+ os .environ .setdefault ("DJANGO_SETTINGS_MODULE" , "weblog. config.settings" )
7
7
8
8
from django .core .management import execute_from_command_line
9
9
Original file line number Diff line number Diff line change 4
4
5
5
def sidebar (request ):
6
6
category_list = Category .objects .filter (article__status = 'p' ).annotate (num_articles = Count ('article' )).filter (
7
- num_articles__gt = 0 )
7
+ num_articles__gt = 0 )
8
8
recent_articles = Article .objects .filter (status = 'p' )[:5 ]
9
9
dates = Article .objects .datetimes ('created_time' , 'month' , order = 'DESC' )
10
10
tag_list = Tag .objects .filter (article__status = 'p' ).annotate (num_articles = Count ('article' )).filter (
11
- num_articles__gt = 0 )
11
+ num_articles__gt = 0 )
12
12
return {
13
13
'category_list' : category_list ,
14
14
'recent_articles' : recent_articles ,
15
15
'dates' : dates ,
16
16
'tag_list' : tag_list
17
17
}
18
+
Original file line number Diff line number Diff line change 11
11
"""
12
12
13
13
import os
14
+ import sys
14
15
15
16
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
16
17
BASE_DIR = os .path .dirname (os .path .dirname (os .path .abspath (__file__ )))
18
+ sys .path .append (os .path .join (BASE_DIR , '../weblog/apps' ))
19
+ sys .path .append (os .path .join (BASE_DIR , '../weblog/config' ))
17
20
18
21
# Quick-start development settings - unsuitable for production
19
22
# See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/
28
31
29
32
# Application definition
30
33
34
+
31
35
INSTALLED_APPS = [
32
36
'django.contrib.admin' ,
33
37
'registration' , # should be immediately above 'django.contrib.auth'
63
67
'django.middleware.clickjacking.XFrameOptionsMiddleware' ,
64
68
]
65
69
66
- ROOT_URLCONF = 'config.urls'
70
+ ROOT_URLCONF = 'weblog. config.urls'
67
71
68
72
TEMPLATES = [
69
73
{
84
88
},
85
89
]
86
90
87
- WSGI_APPLICATION = 'config.wsgi.application'
91
+ WSGI_APPLICATION = 'weblog. config.wsgi.application'
88
92
89
93
# Database
90
94
# https://docs.djangoproject.com/en/1.9/ref/settings/#databases
Original file line number Diff line number Diff line change 11
11
12
12
from django .core .wsgi import get_wsgi_application
13
13
14
- os .environ .setdefault ("DJANGO_SETTINGS_MODULE" , "config.settings" )
14
+ os .environ .setdefault ("DJANGO_SETTINGS_MODULE" , "weblog. config.settings" )
15
15
16
16
application = get_wsgi_application ()
You can’t perform that action at this time.
0 commit comments