76 Commits

Author SHA1 Message Date
Elrond
d23d4b23da Note reported bug in workaround
So that the workaround can eventually be removed, note the
URL for the relevant bug in a comment.
2011-12-21 00:34:02 +01:00
Elrond
871fc591dd Workaround for Routes/urlgen bug.
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.
2011-12-21 00:06:38 +01:00
Christopher Allan Webber
1e9d1acc03 We should use the variable local_templates instead of user_template_path 2011-12-02 16:13:14 -06:00
Nathan Yergler
91cf67385a Issue 680: Dispatch meddleware request processing post-routing 2011-11-26 14:34:36 -08:00
Christopher Allan Webber
ce5ae8da19 Rename MediaGoblin middleware to meddleware to avoid confusion w/ wsgi middleware
hehehehehe, "meddleware"
2011-11-25 12:13:56 -06:00
Christopher Allan Webber
ee91c2b88d Merge remote-tracking branch 'remotes/nyergler/pep8-ification'
Conflicts:
	mediagoblin/db/migrations.py
	mediagoblin/db/models.py
	mediagoblin/user_pages/views.py
	mediagoblin/util.py
2011-11-13 20:23:26 -06:00
Christopher Allan Webber
91903aa601 [620] Allow for multiple mediagoblin configs to be set in config.ini, use first
This way we can copy paste.ini into paste_local.ini but not have to
update it to find mediagoblin_local.ini.
2011-10-29 17:04:19 -05:00
Christopher Allan Webber
f693f9af88 Merge remote branch 'remotes/elrond/misc/i592_use_full_path' 2011-10-15 11:07:13 -05:00
Christopher Allan Webber
c0022ecc88 Fixing 404s, related to recent util refactoring. 2011-10-05 20:57:02 -05:00
Elrond
05788ef450 i592: Use full path in various places
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.
2011-10-03 14:01:13 +02:00
Nathan Yergler
243c3843bd Whitespace and formatting cleanup.
* Removed trailing whitespace
* Line length < 80 where possible
* Honor conventions on number of blank lines
* Honor conventions about spaces around :, =
2011-10-01 15:10:02 -07:00
Aaron Williamson
152a3bfaa3 Finished splitting util.py into separate files. 2011-10-01 18:05:44 -04:00
Aaron Williamson
ae3bc7fabf Moved common, translation, template, and url code out of util.py and into tools/[file].py 2011-10-01 09:31:42 -04:00
Christopher Allan Webber
273227e399 Merge branch 'i507_beaker_cache' 2011-09-05 23:28:41 -05:00
Nathan Yergler
0c8a30e61d Issue 569: Initial framework for application middleware. 2011-09-04 18:15:32 -07:00
Will Kahn-Greene
12a100e4d8 508. Updates copyright/license information 2011-09-01 20:50:19 -04:00
Christopher Allan Webber
0533f117a9 Basic beaker caching functionality added to the application. 2011-08-23 23:22:17 -05:00
Christopher Allan Webber
3807e8e29c Tacking on an empty matchdict when 404'ing just in case a template expects it 2011-08-20 15:55:34 -05:00
Christopher Allan Webber
bae8f3d8c2 Adding and making use of the new 404 error page :) 2011-08-20 15:55:08 -05:00
Christopher Allan Webber
3d0557bf25 Change the ordering of the app's __call__ method (attach things to request first)
This will make it easier for us to call something like a 404 page rendering method
before the matching check is done.
2011-08-20 15:00:25 -05:00
Will Kahn-Greene
50854db05d Tweaks import lines switching \ for ( ). 2011-07-30 08:40:06 -04:00
Elrond
dccef26263 Move setting up of storage into init/__init__.py
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.
2011-07-18 14:20:58 +02:00
Elrond
3f4b5e4a4e Move application level setup of database to init/
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().
2011-07-17 17:45:50 +02:00
Christopher Allan Webber
90e342f90f app.py and migrate.py must import migrations in order to load said migrations... 2011-07-14 00:32:01 -05:00
Christopher Allan Webber
c47c37ed95 Merge branch 'master' into f411_new_migrations
Conflicts:
	mediagoblin/db/open.py
2011-07-13 23:14:42 -05:00
Deb
6ae8b541f9 removed email variables from globals module 2011-07-12 21:21:35 -04:00
Christopher Allan Webber
ff94114c5d Setup the application to record the database version if missing on launch 2011-07-10 22:50:03 -05:00
Christopher Allan Webber
1fd97db348 Added a note about workbench only currently being used by celery 2011-07-09 17:11:23 -05:00
Elrond
7664b4db81 Factor setup_workbench into init submodule. 2011-07-07 22:08:20 +02:00
Elrond
cca5d55d40 Let setup_global_and_app_config call setup_globals
Let setup_global_and_app_config set the global and app
config in the mg_globals already. This way, the config is
available to everyone very early.
2011-07-05 00:02:04 +02:00
Elrond
fe289be4c8 Create setup_global_and_app_config
Moving the config reading and error reporting from app.py
to init/__init__.py. Straight forward.

This also fixes the duplicated exceptions.
2011-07-04 23:57:45 +02:00
Elrond
c85c9dc712 Move setting up of staticdirector to init submodule
This duplicates some exceptions, which will be fixed very
soon.
2011-07-04 23:47:13 +02:00
Elrond
421129b6bb Move config.py to init/
Some simple changes needed to do that.

The interesting question left:
Should config_spec.ini also be moved?
2011-07-02 22:40:19 +02:00
Elrond
42ef819cbb Move get_jinja_loader to init submodule. 2011-07-02 20:50:31 +02:00
Elrond
073b61fe53 Move mediagoblin.celery_setup -> mediagoblin.init.celery
As the first target of the new .init. submodule move
celery_setup there. Quite straight forward, just a lot of
places to change.
2011-07-02 20:50:23 +02:00
Christopher Allan Webber
3c7d11ff28 renaming storage_system_from_paste_config()->storage_system_from_config()
As Elrond points out, this name doesn't make sense anymore since this
isn't based on the paste config.  Thanks Elrond!
2011-06-19 11:36:52 -05:00
Christopher Allan Webber
becb77ee8c It's a good idea for us to pass the application itself into mg_globals :) 2011-06-18 19:00:01 -05:00
Christopher Allan Webber
3f5cf663c0 Move entire app structure over to using the new config system.
This is a huge change!  This means several things.

 - From the python point of view, launching the application is a heck
   of a lot cleaner.  You just need to pass in the config file path to
   MediaGoblinApp's __init__() and whether or not this funtion should
   setup celery and you're good.
 - There are now two separate config files, separating the server
   setup from the application setup.
   - server.ini: the paste deploy config file, which configures the
     applications and server setup but *NOT* the mediagoblin application
     itself.
   - mediagoblin.ini: where you configure mediagoblin (and possibly celery)
 - Launching the application is now different.  Instead of:
     ./bin/paster serve mediagoblin.ini --reload
   We launch like:
     ./bin/paster serve server.ini --reload
2011-06-18 17:59:38 -05:00
Christopher Allan Webber
6e7ce8d1af mediagoblin.globals->mediagoblin.mg_globals 2011-06-12 17:27:37 -05:00
Christopher Allan Webber
a32acafa0b Moving workbench out of process_media 2011-06-11 20:33:41 -05:00
Christopher Allan Webber
7ecc58cc5c Have the application set up instances of the WorkbenchManager. 2011-06-11 19:47:02 -05:00
Christopher Allan Webber
c5678c1ab3 Proper webtest infrastructure... seems to be about right anyway :) 2011-06-04 13:20:48 -05:00
Christopher Allan Webber
571198c938 Now you can set CELERY_ALWAYS_EAGER environment variable so that you
don't have to run celeryd at the same time.

This should make Elrond happy ;)
2011-05-20 18:49:04 -05:00
Elrond
a67fec8177 Factor out most of the database connection into db/open.py
I needed to split the db connection/opening into open.py,
due to an import loop:
- util.py needs db/util.py:ObjectId
- db/util.py would need db/models.py
- db/models.py needs util.py:slugify
2011-05-19 01:35:02 +02:00
Elrond
86f9b47387 Clean unused imports (found by pyflakes). 2011-05-18 22:03:52 +02:00
Christopher Allan Webber
3262ad1dbb Renaming connect_database to connect_database_from_config and using in from_celery 2011-05-18 08:44:57 -05:00
Elrond
a4bae8700e Move "connect to database" into db/util.py 2011-05-18 01:03:40 +02:00
Elrond
0f18ed8f5e Move models into new db/ directory
The database is a central point of interest/discussion.
Represent that by its own directory.

This will surely become more interesting when we have
migrations for example.
2011-05-18 00:44:10 +02:00
Christopher Allan Webber
0e0e3d9aad Separation between setting up the template env and the template loader
for a glorious future where we have gettext in template context
2011-05-12 15:17:07 -05:00
Christopher Allan Webber
cd847fd346 Asbool the email debug mode option 2011-05-08 10:07:39 -05:00