Python JavaScript CSS Shell
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.settings
base
chat
competitions
main
media
storage
templates
workshop
.gitignore
.project
.pydevproject
INSTALL
README
TODO
__init__.py
context.py
deploy
deps.py
django.wsgi
import_tba.py
manage.py
monitor_apache.py
preparse_context.py
preparser.py
redowaveforms.py
send_newsletter.py
settings.py
syncdaw.py
syncmedia.py
urls.py

README

 * JavaScript Templating System:

    http://github.com/andrewrk/jst-parser

 * Preparsed Django templates (useful for JavaScript Templates):

    1. Put these into your settings.py

        import os

        def absolute(relative_path):
            """
            make a relative path absolute
            """
            return os.path.join(os.path.dirname(__file__), relative_path)

        # where processed java script files will be output to. folder structure
        # will be mirrored.
        PREPARSE_OUTPUT = os.path.join(MEDIA_ROOT, 'js', 'pre')

        # these will be processed with django's templating system and moved
        # to the PREPARSE_OUTPUT folder, mirroring folder structure.
        PREPARSE_DIR = os.path.join('templates', 'preparsed')

        # the dictionary that will be available to your preparsed code.
        PREPARSE_CONTEXT = {
            'name': 'John',
            'something': 'yarrr',
        }

    2. python preparser.py parse
        
        It sucks to have to remember this every time you modify a file that
        needs to be preparsed, so you can use 

        python preparser.py monitor

        to make sure your preparsed files are continually updated.

 * Deploying

    1. Upload code to website 
    2. Create a blank file in same folder as settings.py named RELEASE
    3. make sure database is synchronized
    4. python preparser.py parse

 * Developing

    1. Install the dependencies from the INSTALL file.
    2. Create a web server to serve media. I recommend lighttpd or apache.
       Configure the server to honor softlinks and softlink media/ to
       some place in your web server so that MEDIA_URL in settings.py
       resolves correctly.
    3. Go through settings.py and make sure the variables in there
       will work for you. If not, don't change settings.py but instead
       create settings_user.py and override the variables there.

       This step may involve setting up a sql database if you decide not
       to use sqlite3. sqlite3 is probably A-OK for just doing design work.
    4. ./manage.py runserver should work and you can visit the url that
       it prints to the screen to test it out. If you don't see images or
       css then your media serving isn't configured correctly.