ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Django-EE - Editing Expression Engine templates, snippets and variables locally

August 08, 2010 6:56pm

Subscribe [3]
  • #1 / Aug 08, 2010 6:56pm

    nyxtom

    4 posts

    I recently wrote a django app that will help with managing and editing Expression Engine sites. I leveraged django for this because it was the easiest database api and it was able to generate the models from the EE database.

    Check it out at http://github.com/nyxtom/django-ee

    You will need to have django and this app in your python path.

    Once you have that, copy over the two python management utilities (syncee.py and watchee.py).

    syncee.py
    This will generate your folder structure from an existing ee database. Run:
    python syncee.py -f -v

    -f forces overrides, -v displays things in verbose.

    You can also run a full commit by running:
    python syncee.py -f -v -c

    -f forces overrides, -v displays things in verbose, -c commits everything from local. This method is not really necessary though since there is also:

    watchee.py
    Watchee will watch for changes in a directory including the snippets, global_variables and templates folder. Simply run the syncee to generate the structure and watchee.py to watch for local changes.
    python watchee.py

    Enjoy 😊

    Also note that templates are generated as .ee.html files when they are webpages, .css when they are stylesheets, .js when they are javascript and .php when they allow php. I’m working on a .vim plugin for ee when I get the chance so it should be based on the .ee.html extension.

    Let me know what you think 😊

    [Mod Edit: Moved to the Community News forum]

  • #2 / Aug 08, 2010 9:03pm

    nyxtom

    4 posts

    There is, however some issues I’m having with the cached versions of templates. I need to extend it so it either a) authenticates and submits revisions or b) find a way to blow away the cache on save.

    I’m not entirely sure how EE pulls the data, despite whether or not I update it in the database. Thoughts?

  • #3 / Aug 08, 2010 9:06pm

    Lisa Wess

    20502 posts

    Hi, nyxtom - since this was more of an announcement I did move it up to Community News. If you need some support- please go ahead and make a specific thread in the Development & Programming forum.

    You might also make sure you’re testing with the latest build which should help alleviate some of the database caching issues. =)

  • #4 / Aug 08, 2010 9:12pm

    nyxtom

    4 posts

    Thanks, I’ll post my caching related questions there. 😊

  • #5 / Aug 09, 2010 4:22am

    Bjørn Børresen

    629 posts

    cool stuff nyxtom 😊

    As for your caching question EE has database caching on by default in the first release of 2.1, it’s now turned off by default (in the aug 05 release). So that might be the cause of your problems. When changing snippets etc. it is however good practice to delete the cache like this:

    $this->EE->db->clear_cache('all');

    Just check what clear_cache() does and do the same in your python script, that should be fine.

  • #6 / Aug 09, 2010 10:18am

    nyxtom

    4 posts

    Perfect, that fixes everything 😊

    Once I turned off database query caching all updates were instantly visible. Thanks!

  • #7 / Aug 09, 2010 5:42pm

    Greg Aker

    6022 posts

    Interesting idea nyxtom,

    My main concern is, there are some tables in there that vary widely from install to install.  I realize you aren’t currently using them, but be aware classes like ExpChannelData, ExpSites, and ExpMemberData, among others will vary between different websites, and how you setup the sites structure.  😊

    -greg

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases