Last active
August 13, 2018 01:44
-
-
Save maxtortime/0abbc5b76033db2a23f20df1a859754b to your computer and use it in GitHub Desktop.
navbar 만들기
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# context_processors.py | |
def menus(request): | |
return { | |
'menus': [ | |
{'path': reverse(path), 'name': name, | |
'active': 'active' if request.get_full_path() == reverse( | |
path) else ''} | |
for path, name in | |
( | |
('drug_sim', 'CONCEPT SETS'), ('biomarker', 'BIOMARKER'), | |
('cohorts', 'STUDY DESIGN'), | |
('characteristics', 'CHARACTERISTICS'), | |
('distribution', 'DISTRIBUTION'), ('adr', 'ADR PROFILE'), | |
('trial', 'TRIAL SIMULATION') | |
) | |
] | |
} | |
# settings.py | |
TEMPLATES = [ | |
{ | |
'BACKEND': 'django.template.backends.django.DjangoTemplates', | |
'DIRS': [os.path.join(BASE_DIR, 'templates')] | |
, | |
'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', | |
'AI_CTS.settings.context_processors.menus' | |
], | |
}, | |
}, | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment