aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/app.py
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove webob from render_to_responseSebastian Spaeth2012-12-211-1/+2
| | | | | | | | | | We were still using webob's Response objects for template rendering. Transition to werkzeug's Response object. One caveat was that it seemed to have used the default mimetype "text/plain" for all pages, so we override the default Response class, setting the default mime type to "text/html". Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* Honor user's browser language (#558)Sebastian Spaeth2012-12-021-1/+4
| | | | | | | | | | | | | Previously we would attempt to satisfy the user's first language preference, immediately falling back to english if that was not possible. Now, we will get the best match of the user's preferred languages. This requires storing the available locales on app startup, so we have mg_globals.available_locales ready to compare them against the list of preferred user languages. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* Fix i18n in our browserSebastian Spaeth2012-12-011-1/+0
| | | | | | | | | | | | | | | | | | We only ever served english pages since the switch to werkzeug's requests. Fix this by actually checking the accepted languages that our web browser sends and using that or falling back to english. This is not optimal, imaging our browser sends "klingon, de" as accepted languages and we happen to not have a klingon translation ready (a deficiency that should be corrected immediately anyway!!). We would then fall back to english rather than sending the sensible and pleasant German language which the user would understand. This will require more backend work though. Removing the gettext.find() in mg_globals.py. It looked in the wrong directory anyway (mediagoblin/translations) and as that does not exist, had always returned None without anyone noticing. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* Fixed OAuth access_token duplicate routeJoar Wandborg2012-10-151-0/+1
| | | | Changed route name to "[...]list_connections"
* Fixed 404 page under werkzeug.routingJoar Wandborg2012-10-141-17/+18
| | | | | - Removed ?lang=<langcode> feature due to incompatibility with werkzeug routes in the current state of the architecture.
* Switched most stuff over from RoutesJoar Wandborg2012-10-141-32/+41
| | | | | | | | | | Removed the Routes routing functionality and replaced it with werkzeug.routes. Most views are functional. Known issues: - Translation integration with the request object is not yet figured out. This breaks 404 pages.
* Replaced all request.POST with request.form, ...Joar Wandborg2012-09-291-1/+0
| | | | | - Fixed error handling in OAuth plugin - Changed request.POST file fields to request.files
* Switch from webob.Request to werkzeug.wrappers.RequestJoar Wandborg2012-09-291-3/+10
|
* Rework plugin infrastructure to nix side-effectsWill Kahn-Greene2012-07-171-3/+3
| | | | | | | | | | | | | This reworks the plugin infrastructure so as to remove module-loading side-effects which were making things a pain in the ass to test. With the new system, there's no auto-registering meta class. Instead plugins do whatever they want and then specify a hooks dict that maps hook names to callables for the things they're tying into. The most common one (and the only one we've implemented so far) is "setup". This also simplifies the sampleplugin a little by moving the code to __init__.py.
* Finish flatpagesplugin; add plugin docsWill Kahn-Greene2012-07-161-1/+1
|
* Flatpages first passWill Kahn-Greene2012-07-161-1/+4
| | | | | | | | | | This fixes the template loader so that it can load plugin templates. This adds code for registering template paths so that plugins can add their own templates. This adds the base code for the flatpagesfile plugin. It doesn't serve pages, yet, but it's pretty close.
* Making the register_themes() tool also return the current themeChristopher Allan Webber2012-07-141-7/+1
| | | | | This will reduce the amount of work reproducing this behavior when pulling together the theme registry elsewhere.
* Themes are now registered and can have their templates loaded properlyChristopher Allan Webber2012-07-141-1/+8
|
* Early version of theme registry codeChristopher Allan Webber2012-07-141-0/+4
|
* 401. Plugin infrastructureWill Kahn-Greene2012-05-131-0/+6
| | | | | | | | * implements installing, loading and setup for plugins * codifies configuration * has a sample plugin * docs * tests
* log.debug the used config file.Elrond2012-04-091-0/+1
| | | | Might be useful at some point.
* CELERY_ALWAYS_EAGER environment variable only recognized if 'true' nowChristopher Allan Webber2012-04-081-1/+1
|
* Allow users to pass callables in as controllers, not just import pathsChristopher Allan Webber2012-04-081-1/+7
|
* Cleanup sql session after request. ALWAYS!Elrond2012-04-071-8/+11
| | | | | | | | | | | | The cleanup could be missed if the request handling code in app.py:__call__ exits early (due to exception, or due to one of those early "return"s). So to make sure the sql session is cleaned up for real, wrap the whole thing in a try: finally:. Also wrote a short tool to test if the session is actually empty. The tool is currently disabled, but ready to be used.
* Cleanup Session after each request.Elrond2012-02-281-0/+8
| | | | | | | | | | | It's good practice to cleanup the SQL session after each request so that the next request gets a fresh one. It's an application decision whether one wants a just-in-case ROLLBACK or COMMIT. There are two ideas behind it, really. I have decided for ROLLBACK. The idea is "if you forget to commit your changes yourself, there's something broken. Maybe you got an exception?".
* Let Main Server emit startup notice including versionElrond2012-02-261-1/+6
| | | | | | | There was no place in the software telling the user the version in use. So start by having the main server emit a startup notice including the version string. Uses python logging, so should be easy to reconfigure, etc.
* It's 2012 all up in hereChristopher Allan Webber2012-02-021-1/+1
|
* Note reported bug in workaroundElrond2011-12-211-0/+1
| | | | | So that the workaround can eventually be removed, note the URL for the relevant bug in a comment.
* Workaround for Routes/urlgen bug.Elrond2011-12-211-0/+4
| | | | | | | | | | | | This is relevant for fcgi: Some servers (cherokee for example) put "HTTP":"off" in the environ. And the following code in urlgen breaks on this: if environ.get('HTTPS') or environ.get('wsgi.url_scheme') == 'https' \ or environ.get('HTTP_X_FORWARDED_PROTO') == 'https': hostinfo['protocol'] = 'https' workaround is to remove HTTPS:off from the environ.
* We should use the variable local_templates instead of user_template_pathChristopher Allan Webber2011-12-021-1/+1
|
* Issue 680: Dispatch meddleware request processing post-routingNathan Yergler2011-11-261-6/+7
|
* Rename MediaGoblin middleware to meddleware to avoid confusion w/ wsgi ↵Christopher Allan Webber2011-11-251-8/+8
| | | | | | middleware hehehehehe, "meddleware"
* Merge remote-tracking branch 'remotes/nyergler/pep8-ification'Christopher Allan Webber2011-11-131-2/+1
|\ | | | | | | | | | | | | | | Conflicts: mediagoblin/db/migrations.py mediagoblin/db/models.py mediagoblin/user_pages/views.py mediagoblin/util.py
| * Whitespace and formatting cleanup.Nathan Yergler2011-10-011-2/+1
| | | | | | | | | | | | | | * Removed trailing whitespace * Line length < 80 where possible * Honor conventions on number of blank lines * Honor conventions about spaces around :, =
* | [620] Allow for multiple mediagoblin configs to be set in config.ini, use firstChristopher Allan Webber2011-10-291-1/+11
| | | | | | | | | | This way we can copy paste.ini into paste_local.ini but not have to update it to find mediagoblin_local.ini.
* | Merge remote branch 'remotes/elrond/misc/i592_use_full_path'Christopher Allan Webber2011-10-151-0/+11
|\ \
| * | i592: Use full path in various placesElrond2011-10-031-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When running mediagoblin in a sub path on a web server, most things inside mediagoblin need the "inside path", but when generating URLs for the webbrowser, full paths are needed. urlgen and routes already do that. Some (mostly pagination and login) need the URL of the current page. They used request.path_info. But this is the "inside" path, not the full. So now there is request.full_path and its used in various places.
* | | Fixing 404s, related to recent util refactoring.Christopher Allan Webber2011-10-051-2/+3
|/ /
* | Finished splitting util.py into separate files.Aaron Williamson2011-10-011-6/+7
| |
* | Moved common, translation, template, and url code out of util.py and into ↵Aaron Williamson2011-10-011-2/+3
|/ | | | tools/[file].py
* Merge branch 'i507_beaker_cache'Christopher Allan Webber2011-09-051-1/+4
|\
| * Basic beaker caching functionality added to the application.Christopher Allan Webber2011-08-231-1/+4
| |
* | Issue 569: Initial framework for application middleware.Nathan Yergler2011-09-041-5/+23
| |
* | 508. Updates copyright/license informationWill Kahn-Greene2011-09-011-1/+1
|/
* Tacking on an empty matchdict when 404'ing just in case a template expects itChristopher Allan Webber2011-08-201-0/+1
|
* Adding and making use of the new 404 error page :)Christopher Allan Webber2011-08-201-1/+1
|
* Change the ordering of the app's __call__ method (attach things to request ↵Christopher Allan Webber2011-08-201-17/+17
| | | | | | | first) This will make it easier for us to call something like a 404 page rendering method before the matching check is done.
* Tweaks import lines switching \ for ( ).Will Kahn-Greene2011-07-301-3/+3
|
* Move setting up of storage into init/__init__.pyElrond2011-07-181-10/+5
| | | | | | | Factoring out this one should be the last one needed to rewrite the celery setup. The idea is to not setup the whole app, but just call a bunch of individual setup_* functions and be done.
* Move application level setup of database to init/Elrond2011-07-171-20/+2
| | | | | | Setting up the database now involves checking the migrations status and setting up the globals. Moved all of that into init/__init__.py:setup_database().
* app.py and migrate.py must import migrations in order to load said migrations...Christopher Allan Webber2011-07-141-0/+3
|
* Merge branch 'master' into f411_new_migrationsChristopher Allan Webber2011-07-131-40/+10
|\ | | | | | | | | Conflicts: mediagoblin/db/open.py
| * removed email variables from globals moduleDeb2011-07-121-6/+0
| |
| * Added a note about workbench only currently being used by celeryChristopher Allan Webber2011-07-091-0/+3
| |
| * Factor setup_workbench into init submodule.Elrond2011-07-071-4/+3
| |