Commit Graph

22 Commits

Author SHA1 Message Date
Awais Qureshi
f1f1933ab4 BOM-2374
Run Pyupgrade on edxmako.
2021-03-05 18:17:41 +05:00
usamasadiq
515458b9dc Applied pylint-amnesty 2021-02-02 17:59:20 +05:00
Feanil Patel
6e3fe00fff Fix all E303 pep8 errors. 2019-12-30 12:25:38 -05:00
Feanil Patel
9cf2f9f298 Run 2to3 -f future . -w
This will remove imports from __future__ that are no longer needed.

https://docs.python.org/3.5/library/2to3.html#2to3fixer-future
2019-12-30 10:35:30 -05:00
Feanil Patel
d1556fc86d md5 needs bytes in python 3 but a sting is fine in python2. 2019-07-19 09:48:10 -04:00
Jeremy Bowman
237d264a50 DEPR-12 Remove microsites references from edxmako (#20796) 2019-06-11 15:27:10 -04:00
Amit
328bcbe047 INCR-135: Run python-modernize on common/djangoapps/edxmako (#20483) 2019-05-09 10:08:57 -04:00
Nimisha Asthagiri
700a902b68 Cleanup and remove deprecated RequestCache Django app
ARCH-223
2018-09-12 14:39:11 -04:00
Qubad786
64555c60c0 Move request_cache to openedx.core.djangoapps 2018-01-26 15:09:25 +05:00
Chandrakant Gopalan
f6f29ca49e Allow theme template block overrides.
This allows an overridding template from a theme to inherit from the
same corresponding standard template.

This is useful when you only want to override one or more named blocks,
but otherwise make no modifications to the standard template.
2017-12-22 09:41:35 +01:00
Eric Fischer
2e3f871c12 Memoize common lookups during request
Prevents repeated memcached lookups on functions whose values should
remain static for the lifetime of a request.

EDUCATOR-1731
2017-12-04 11:54:50 -05:00
Jesse Zoldak
9c49c10b27 Revert "Allow theme template block override" 2017-11-30 17:09:13 -05:00
Chandrakant Gopalan
96e704e47c Allow theme template block override 2017-09-11 21:42:25 -04:00
Andy Armstrong
93235d118d Reorder imports using isort (except lms and cms) 2017-05-30 16:04:54 -04:00
Matt Drayer
68312bdd2d Revert "Revert "saleem-latif/WL-328: Multi-Site Comprehensive Theming""
2. Update COMPREHNSIVE_THEME_DIR to COMPREHENSIVE_THEME_DIRS
3. Update paver commands to support multi theme dirs
4. Updating template loaders
5. Add ENABLE_COMPREHENSIVE_THEMING flag to enable or disable theming via settings
6. Update tests
7. Add backward compatibility for COMPREHEHNSIVE_THEME_DIR
2016-06-30 15:19:51 +05:00
Felipe Montoya
4742e661f4 Creating a settings object that is aware of the microsite settings.
Adding the declaration of the settings object to openedx.conf to be able to import it from a nicer location

Resolving quality violations

Merging dicts with the settings definition when they exist in the microsite configuration

Using a cache to improve the perfomance of quering any dictionary in the microsite definition

Ignoring the invalid-name pylint warning since the names must be kept thsi way to stay the same as the ones in django.
Removing the default dict argument as per https://docs.python.org/2/tutorial/controlflow.html#default-argument-values

Extracting the implementation of the microsite to a selectable backend.

Leaving the function startup.enable_microsites for backwards compatibilityy

Adding a database backend

Using a cache to improve the perfomance of quering any dictionary in the microsite definition.
Changed the database backend so that it extends the settings file backend and removed all the unnecessary methods.

Using the backend provider for the get_dict function

some tweeks and some initial unit tests

Using getattr as a function insteal of calling the underlying __getattr__ directly

Adding an ModelAdmin object for the microsite model in the django-admin panel

refactor enable_microsites()

consolidate/refactor some shared code

add config to aws.py and add migration files

fix tests

Changes to get the backends to run after the refactor

add archiving capabilities to microsites. Also make a few notes about performance improvements to make

fix tests

Making the query to find if microsites exist in the database faster

add ORG to microsite mapping tables and some performance improvements

allow for Mako templates to be pulled from the database

fix tests

For the database template backend the uri of the template does not use the filesystem relative path

Fixing pylint violations

Added caching of the templates stored in the database

Fixing pylint errors

fix pylint

Clearing the cache on model save

Fixing pylint errors

rebased and added test coverage

rebased cdodge/microsite-improvements branch with master and added test
coverage

added missing migration

fix quality violations

add more test coverage

mattdrayer: Add microsite_configuration to cms.INSTALLED_APPS

added microsite settings to cms/envs/test.py

run session cookie tests only in LMS

fixed broken tests

putting middleware changes back

Preventing the template_backend to be called on requests which have no microsite

changes to address feedback from mjfrey

changed BaseMicrositeBackend to AbstractBaseMicrositeBackend

changes after feedback from mattdrayer

fixed broken tests and quality violations

Allowing the backend to handle the enable_pre_startup routine

Typos and docstrings

Adressing feedback

Fixing python tests

add comment to explain why we need enable_microsites_pre_startup()
2016-01-15 14:52:36 +05:00
David Baumgold
6ebf2515f4 Comprehensive theming
This is a squash of 38 commits ending with
5b080f979d692804452400ac5bed9b17c50b001e
2015-09-17 15:39:03 -04:00
Ned Batchelder
5d39b0ce29 Make edxmako cache properly with changing lookup paths 2015-06-17 11:32:59 -04:00
stv
cf9308144d Fix PEP8: E302 expected 2 blank lines, found 1 2014-11-10 11:00:11 -08:00
Calen Pennington
c54972e855 Fix bad interaction between pluggable InputTypes and Microsites
Pluggable InputTypes use edxmako.paths.add_lookup to inject new
mako template directories. Those were getting clobbered by microsites
(and by theming), which were completely rebuilding the mako template
lookup list from scratch.

This commit switches those two features to use the same add_lookup
function as pluggable InputTypes.

[LMS-2489]
2014-04-01 16:49:15 -04:00
Bertrand Marron
efa8bd6755 Add method to clear mako template lookups
Quick and dirty fix (edxapp.startup.run is called twice, once before
loading the configuration, so the paths defined in lms.startup are
basically ignored).
2014-03-06 17:09:40 +01:00
Chris Rossi
0a1ed11daa Make mako template lookups pluggable.
This code adds the ability to add Mako template lookup directories on
the fly, allowing third party add-ons to contribute their own Mako templates.
A new API function for registering Mako templates is introduced::

    from edxmako import add_lookup

    add_lookup('main', '/path/to/templates')

    # Or, specify a package to lookup using pkg_resources.  This will
    # add the 'templates' directory inside the current package:
    add_lookup('main', 'templates', package=__name__)
2014-01-31 13:55:36 -05:00