32 Commits

Author SHA1 Message Date
Brett Smith
9e1fa2396f Remove beaker stuff from the code.
This is all obsoleted by It's Dangerous.
2013-03-24 15:10:08 -04:00
Elrond
626a093ccc Move workbench into tools directory. 2013-01-17 22:15:57 +01:00
Sebastian Spaeth
bc142abc55 RIP out mongo
Since sqlalchemy is providing our database abstraction and we have
moved away from Mongo as the underlying database, it is now time to
simplify things and rip out mongo. This provides the bulk of the
changes, and can stand on its own. There are some followup tasks
that can be done, such as removing now unneeded abstraction layers,
e.g. db.sql.fake.py
2012-12-25 20:06:03 +01:00
Sebastian Spaeth
826919c97c en_US is always available
We were using "en" as fallback only when no preferred language matched.
This is obviously bad. Always insert en_US as available locale, so we
can match it with the accept_languages.

Don't set available_locales as mg_global, per discussion with paroneaya,
make it a global var in translate.py

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-12-02 02:46:50 +01:00
Sebastian Spaeth
6ef75af50e Honor user's browser language (#558)
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>
2012-12-02 00:29:30 +01:00
Will Kahn-Greene
8545dd50f0 Flatpages first pass
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.
2012-07-16 09:26:28 -04:00
Christopher Allan Webber
9a422c1fd0 Add the theme domain to the application's staticdirector 2012-07-14 12:55:14 -05:00
Christopher Allan Webber
5377114c4d Update staticdirect stuff so it can handle "domains" of staticdirection 2012-07-14 12:55:14 -05:00
Christopher Allan Webber
00eda826cb Kill MultiRemoteStaticDirect... nobody was really using it anyway
Since we're adding the new "domain" staticdirect system we should
clean this up.
2012-07-14 12:55:13 -05:00
Christopher Allan Webber
e8d4e58214 Moving staticdirect to tools/ 2012-07-14 12:55:13 -05:00
Christopher Allan Webber
3b47da8eab Themes are now registered and can have their templates loaded properly 2012-07-14 12:55:13 -05:00
Elrond
b829595334 Create load_models().
So all models are ready when connecting to the db and so
our "db" object has all models listed on it, create a
function to load all models from the media_types, etc. Call
it in setup_database()

Problem: This gives celery warnings, because celery is
imported before being setup properly. No idea how to fix
this now. So media-type loading is excluded from
load_models for now.
2012-03-20 12:45:40 +01:00
Christopher Allan Webber
cf29e8a824 It's 2012 all up in here 2012-02-02 09:44:13 -06:00
Elrond
415077a743 Factor out check_db_migrations_current
When initializing the database connection the current mongo
based setup checked for new migrations and warned about
them. This was mongo specific so factor'd it out into a
more generic check_db_migrations_current function in the
mongo backend.

Also created a dummy one in the sql backend.
2012-01-01 18:36:42 +01:00
Elrond
faf74067da Move db/migrations.py -> db/mongo/migrations.py
And change references.
2011-12-20 20:33:33 +01:00
Nathan Yergler
285ffeddf3 has_key is deprecated, converting uses to use "in" operator. 2011-10-01 15:10:41 -07: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
Christopher Allan Webber
273227e399 Merge branch 'i507_beaker_cache' 2011-09-05 23:28:41 -05: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
Elrond
56fc718659 Storage config: Drop all Backward Compatibility
Chris Webber says not to care about backward compatibility
at this stage. So drop the last bits.
2011-08-09 13:18:22 +02:00
Elrond
f7d73aeb34 storage Config: Stop being backward compatible (beginning).
Chris Webber says "no backward compatibility for this".
So start removing the backward compat stuff.
2011-08-09 13:15:20 +02:00
Elrond
ed7970696e Storage Config: Use own section
Instead of configuring storage X by parameters in the main
section "X_class = backend" and "X_param = value", use a
new section in the config: "[storage:X]" and use "class =
backend" and "param = value" there.

This is the beginning, it includes a try at being backward
compatible. But that try isn't really fully useful anyway.
2011-08-09 13:13:04 +02:00
Christopher Allan Webber
482d53cd30 Let users know when their migrations are from the future :O 2011-07-30 12:33:57 -05: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
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
42ef819cbb Move get_jinja_loader to init submodule. 2011-07-02 20:50:31 +02:00
Elrond
1b579e18d8 Start mediagoblin.init 2011-07-02 20:25:09 +02:00