Commit Graph

18 Commits

Author SHA1 Message Date
Christina Roberts
2497f0a0eb WIP: xblock pipeline work (#10176)
[PERF-303] Integer XBlocks/XModules into the static asset pipeline.

This PR, based on hackathon work from Christina/Andy, implements a way to discover all installed XBlocks and XModules and to enumerate their public assets, then pulling them in during the collectstatic phase and hashing them.  In turn, the methods for generating URLs to resources will then returned the hashed name for assets, allowing them to be served from nginx/CDNs, and cached heavily.
2016-04-29 10:52:42 -04:00
John Eskew
812aa6381e Upgrade to Django 1.8.11. Remove monkey patch required for v1.8.10. 2016-03-08 11:41:33 -05:00
John Eskew
ccb07f1c49 Monkey patch django.utils.http.is_safe_url for Django 1.8.10. 2016-03-03 16:53:42 -05:00
Bill DeRusha
bec6971ae2 Monkey patch django.db.models.options for faster cache expiry 2016-02-29 17:37:17 -05:00
Matjaz Gregoric
9b89bd3245 Make comprehensive theme work with django templates.
Comprehensive theming did not work with django templates (used by course wiki).

The reason it didn't work was that in order for the theme to work, theme template folder
has to be added to django template dirs setting *before* django startup.
After django startup, modifying `settings.DEFAULT_TEMPLATE_ENGINE['DIRS']` has no effect,
because at that point the template engine is already initialized with a copy of the
template dirs list.

Instead of running the theme startup code as an autostartup hook, we manually run it
*before* `django.setup()`. This is fine because theme startup code doesn't have to do
anything else besides modifying some settings and doesn't actually need django to be
initialized.
2016-01-25 08:45:52 +01:00
Usman Khalid
6cb62f2697 Rebase upgrade Django to v1.8.5
Please note that this is a squshed commit and the work of:
Symbolist, macdiesel, nedbat, doctoryes, muzaffaryousaf and muhammad-ammar
2015-11-10 15:00:19 -05:00
David Ormsbee
9b88bdb072 Changes to handler URL generation
* The LMS now also monkey-patches
  xmodule.x_module.descriptor_global_handler_url and
  xmodule.x_module.descriptor_global_local_resource_url so that we can
  get LMS XBlock URLs from the DescriptorSystem. That functionality is
  needed in the block transforms collect() phase for certain XModules
  like Video. For instance, say we want to generate the transcripts
  URLs. The collect phase is run asynchronously, without a user context.

* The URL handler monkey-patching is now done in the startup.py files
  for LMS and Studio. Studio used to do this in the import of
  cms/djangoapps/contentstore/views/item.py. This was mostly just
  because it seemed like a sane and consistent place to put it.

* LmsHandlerUrls was removed, its handler_url and local_resource_url
  methods were moved to be top level functions. The only reason that
  class existed seems to be to give a place to store course_id state,
  and that can now be derived from the block location.

* To avoid the Module -> Descriptor ProxyAttribute magic that we do
  (which explodes with an UndefinedContext error because there is no
  user involved), when examining the block's handler method in
  handler_url, I made a few changes:

** Check the .__class__ to see if the handler was defined, instead of the
   block itself.

** The above required me to relax the check for _is_xblock_handler on the
   function, since that will no longer be defined.

90% of this goes away when we kill XModules and do the refactoring we've
wanted to do for a while.
2015-10-28 09:42:59 -04:00
Ned Batchelder
a84735057d Move common/lib/*.py to openedx/core/lib
This makes these files importable, and puts them into the new best guess
as to where files should live.
2015-03-23 12:40:24 -04:00
Marco Re
d65902ed3c Add themes files to staticfiles_dir in Studio 2015-01-17 13:24:54 +01:00
Sarina Canelake
3c364193bb s/pylint: disable=W0104/pylint: disable=pointless-statement/ 2014-12-01 11:22:12 -05:00
Usman Khalid
32c6dad526 Moved imports to manage.py and wsgi.py. 2014-10-14 18:27:31 +05:00
Usman Khalid
fc895fe8bf Moved imports to startup.py. 2014-09-11 20:14:37 +05:00
stv
86633df3db Monkey patch 'django.utils.translation'
Modify Django's translation library, such that the gettext family of
functions return an empty string when attempting to translate a
falsey value. This overrides the default behavior [0]:
> It is convention with GNU gettext to include meta-data as the
> translation for the empty string.

This patch provides a holistic solution to replace the current piecemeal
approach [1][2].

Affected Methods:
    - gettext
    - ugettext

[0] https://docs.python.org/2.7/library/gettext.html#the-gnutranslations-class
[1] bad803e451
[2] https://github.com/edx/edx-platform/pull/4653
2014-08-27 15:27:34 -07:00
Alan Boudreault
031ac9852e Add mimetype additions in studio startup 2014-05-29 11:44:14 -04:00
Calen Pennington
f6c2780cf1 Remove obselete cms startup code 2014-01-24 16:42:38 -05:00
Ned Batchelder
39380f2d22 Very Minor tweaks to the LMS and CMS startup.
I was going to do something in the startup code, then changed my mind,
but didn't want to just discard these changes.
2014-01-02 14:27:52 -05:00
Calen Pennington
8201b1412e Use XBlock 0.3 2013-09-06 09:45:59 -04:00
Calen Pennington
407b02b358 Centralize startup code, and execute in all contexts
Inspired by: http://eldarion.com/blog/2013/02/14/entry-point-hook-django-projects/
Moves startup code to lms.startup and cms.startup, and calls the startup
methods in wsgi.py and manage.py for both projects.
2013-08-27 12:12:20 -04:00