March 2020
Intermediate to advanced
608 pages
17h 17m
English
Modify your path-related settings accordingly, instead of hardcoding the paths to your local directories, as follows:
# settings/_base.pyimport osBASE_DIR = os.path.dirname( os.path.dirname(os.path.dirname(os.path.abspath(__file__))))# ...TEMPLATES = [{ # ... DIRS: [ os.path.join(BASE_DIR, 'myproject', 'templates'), ], # ...}]# ...LOCALE_PATHS = [ os.path.join(BASE_DIR, 'locale'),]# ...STATICFILES_DIRS = [ os.path.join(BASE_DIR, 'myproject', 'site_static'),]STATIC_ROOT = os.path.join(BASE_DIR, 'static')MEDIA_ROOT = os.path.join(BASE_DIR, 'media')