Commit Graph

36 Commits

Author SHA1 Message Date
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
Ayub khan
65efedc912 INCR-347 python3 compatibility 2019-07-19 13:52:49 +05:00
Michael Youngstrom
26b4e30833 Remove django 1.8 shim 2018-06-06 10:34:56 -04:00
bmedx
d3bbb86fe3 Shims to fix test collection errors 2017-11-13 15:45:34 -05:00
John Eskew
0279181624 Remove everything from CMS/LMS startup.py except single monkey-patch.
Move mimetype addition to common initialization.
2017-11-08 11:26:07 -05:00
Jeremy Bowman
c24a919856 PLAT-1774 Move x_module monkey-patching 2017-11-06 11:32:55 -05:00
Troy Sankey
c19eaef075 Move settings validation out of startup.py
This also creates a new app common_initialization in order to provide a
place to run initialization code common to both the LMS and CMS.
2017-11-03 12:23:54 -04:00
Jeremy Bowman
d549194ba3 PLAT-1775 Move help tokens configuration from startup to settings 2017-10-31 17:04:54 -04:00
John Eskew
b866f35620 Remove support for COMPREHENSIVE_THEME_DIR -
all dirs must now go into COMPREHENSIVE_THEME_DIRS.
Move comprehensive theming setup section out of startup.py and into
  settings files using new 'derived' functionality.
Add 'derive_settings' at the end of all top-level Django settings files.
Move validation of comprehensive theming settings into new apps.py
  theming file.
Split theming code into code safe to run before settings are initialized
  -and- after settings are initialized.
2017-10-30 14:36:06 -04:00
John Eskew
54441488dc Add comments to docstring forbidding additional code. 2017-10-20 07:59:32 -04:00
Andy Armstrong
ebb04ca396 Reorder Studio imports using isort 2017-05-30 17:00:50 -04:00
Ned Batchelder
2f1936ce73 Replace context processor with new help-tokens app
This makes it possible to refer to multiple book from a single app.

This also means that Open edX branches will be able to pass bok-choy
tests (at least if the books have already been built.)
2017-04-27 10:34:09 -04:00
Clinton Blackburn
4cc7628696 Upgraded to Python Social Auth 0.2.21 to resolve migration issue 2017-03-10 23:06:02 -05:00
John Eskew
fab11b90d7 Move monkey_patch to openedx.core.djangoapps. 2016-10-06 10:16:14 -04:00
wajeeha-khalid
986dcff626 MA-2536: get 'course_about' url in enrollment 2016-07-29 14:58:54 +05:00
Saleem Latif
6277bd27e6 Remove all usages of USE_CUSTOM_THEME and THEME_NAME from python files 2016-07-27 14:53:02 +05: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
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