File tree 3 files changed +18
-8
lines changed
3 files changed +18
-8
lines changed Original file line number Diff line number Diff line change 1
1
from django .contrib import admin
2
+ from .models import Article
2
3
3
- # Register your models here.
4
+ admin . site . register ( Article )
Original file line number Diff line number Diff line change 14
14
import dj_database_url
15
15
16
16
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
17
- BASE_DIR = os .path .dirname (os .path .dirname (os .path .abspath (__file__ )))
18
-
17
+ BASE_DIR = os .path .dirname (os .path .abspath (__file__ ))
19
18
20
19
# Quick-start development settings - unsuitable for production
21
20
# See https://docs.djangoproject.com/en/2.0/howto/deployment/checklist/
24
23
SECRET_KEY = '=z!)ljo#)g8$am1z4s(!s!+2fj_xz$wys-6vqlk!b!hd6avr@4'
25
24
26
25
# SECURITY WARNING: don't run with debug turned on in production!
27
- DEBUG = False
26
+ DEBUG = True
28
27
29
28
ALLOWED_HOSTS = ['*' ]
30
29
77
76
# https://docs.djangoproject.com/en/2.0/ref/settings/#databases
78
77
79
78
DATABASES = {
80
- 'default' : dj_database_url .config (
81
- default = 'sqlite:////{0}' .format (os .path .join (BASE_DIR , 'db.sqlite3' ))
79
+ 'default' : dj_database_url .config (
80
+ default = 'sqlite:////{0}' .format (os .path .join (BASE_DIR , 'db.sqlite3' ))
82
81
)
83
82
}
84
83
115
114
116
115
USE_TZ = True
117
116
118
-
119
117
# Static files (CSS, JavaScript, Images)
120
118
# https://docs.djangoproject.com/en/2.0/howto/static-files/
119
+ STATIC_ROOT = os .path .join (BASE_DIR , '.staticfiles' )
121
120
121
+ # URL that handles the static files served from STATIC_ROOT.
122
+ # Example: 'http://example.com/static/', 'http://static.example.com/'
123
+ # See: https://docs.djangoproject.com/en/dev/ref/settings/#static-url
122
124
STATIC_URL = '/static/'
125
+
126
+ # A list of locations of additional static files
127
+ STATICFILES_DIRS = [
128
+ os .path .join (BASE_DIR , "static" ),
129
+ ]
Original file line number Diff line number Diff line change 17
17
from django .urls import path , include
18
18
from .routers import router
19
19
from django .views .generic import TemplateView
20
+ from django .conf .urls .static import static
21
+ from django .conf import settings
20
22
21
23
22
24
urlpatterns = [
25
27
path ('article' , TemplateView .as_view (template_name = 'index.html' )),
26
28
path ('' , TemplateView .as_view (template_name = 'index.html' )),
27
29
28
- ]
30
+ ] + static ( settings . STATIC_URL , document_root = settings . STATIC_ROOT )
You can’t perform that action at this time.
0 commit comments