| | 89 | def get_base_context(request): |
| | 90 | """ |
| | 91 | Build a base context. |
| | 92 | Used in BaseInstall and PyLucidCommonMiddleware. |
| | 93 | """ |
| | 94 | media_url = posixpath.join( |
| | 95 | settings.MEDIA_URL, settings.PYLUCID_MEDIA_DIR, "" |
| | 96 | ) # With appended slash, for backward compatible |
| | 97 | context = { |
| | 98 | "output": "", |
| | 99 | "request": request, |
| | 100 | "PyLucid_media_url": media_url, |
| | 101 | "version": PYLUCID_VERSION_STRING, |
| | 102 | "current_working_dir": os.getcwd(), |
| | 103 | } |
| | 104 | return context |
| | 105 | |
| | 106 | |
| | 107 | |
| 110 | | media_url = posixpath.join( |
| 111 | | settings.MEDIA_URL, settings.PYLUCID_MEDIA_DIR, "" |
| 112 | | ) # With appended slash, for backward compatible |
| 113 | | self.context = { |
| 114 | | "output": "", |
| 115 | | "request": request, |
| 116 | | "PyLucid_media_url": media_url, |
| 117 | | "version": PYLUCID_VERSION_STRING, |
| 118 | | "current_working_dir": os.getcwd(), |
| 119 | | } |
| | 129 | self.context = get_base_context(request) |
| | 130 | |