Index: django/template/defaulttags.py
===================================================================
--- django/template/defaulttags.py	(revision 6094)
+++ django/template/defaulttags.py	(working copy)
@@ -30,6 +30,7 @@
     def render(self, context):
         self.counter += 1
         value = self.cyclevars[self.counter % self.cyclevars_len]
+        value = resolve_variable(value, context)
         if self.variable_name:
             context[self.variable_name] = value
         return value
@@ -403,7 +404,7 @@
     the loop::
 
         {% for o in some_list %}
-            <tr class="{% cycle row1,row2 %}">
+            <tr class="{% cycle 'row1' 'row2' %}">
                 ...
             </tr>
         {% endfor %}
@@ -411,16 +412,15 @@
     Outside of a loop, give the values a unique name the first time you call
     it, then use that name each sucessive time through::
 
-            <tr class="{% cycle row1,row2,row3 as rowcolors %}">...</tr>
+            <tr class="{% cycle 'row1' 'row2' 'row3' as rowcolors %}">...</tr>
             <tr class="{% cycle rowcolors %}">...</tr>
             <tr class="{% cycle rowcolors %}">...</tr>
 
-    You can use any number of values, seperated by commas. Make sure not to
-    put spaces between the values -- only commas.
+    You can use any number of values, seperated by spaces.
     """
 
     # Note: This returns the exact same node on each {% cycle name %} call; that
-    # is, the node object returned from {% cycle a,b,c as name %} and the one
+    # is, the node object returned from {% cycle a b c as name %} and the one
     # returned from {% cycle name %} are the exact same object.  This shouldn't
     # cause problems (heh), but if it does, now you know.
     #
@@ -429,40 +429,34 @@
     # a global variable, which would make cycle names have to be unique across
     # *all* templates.
 
-    args = token.contents.split()
+    args = token.split_contents()
+
     if len(args) < 2:
-        raise TemplateSyntaxError("'Cycle' statement requires at least two arguments")
+       raise TemplateSyntaxError("'cycle' tag requires at least two arguments")
 
-    elif len(args) == 2 and "," in args[1]:
-        # {% cycle a,b,c %}
-        cyclevars = [v for v in args[1].split(",") if v]    # split and kill blanks
-        return CycleNode(cyclevars)
-        # {% cycle name %}
+    if ',' in args[1]:
+        # Backwards compatibility: {% cycle a,b %} or {% cycle a,b as foo %}
+        # case.
+        args[1:2] = ['"%s"' % arg for arg in args[1].split(",")]
 
-    elif len(args) == 2:
+    if len(args) == 2:
+        # {% cycle foo %} case
         name = args[1]
         if not hasattr(parser, '_namedCycleNodes'):
             raise TemplateSyntaxError("No named cycles in template: '%s' is not defined" % name)
-        if name not in parser._namedCycleNodes:
+        if not name in parser._namedCycleNodes:
             raise TemplateSyntaxError("Named cycle '%s' does not exist" % name)
         return parser._namedCycleNodes[name]
 
-    elif len(args) == 4:
-        # {% cycle a,b,c as name %}
-        if args[2] != 'as':
-            raise TemplateSyntaxError("Second 'cycle' argument must be 'as'")
-        cyclevars = [v for v in args[1].split(",") if v]    # split and kill blanks
-        name = args[3]
-        node = CycleNode(cyclevars, name)
-
+    if len(args) > 4 and args[-2] == 'as':
+        name = args[-1]
+        node = CycleNode(args[1:-2], name)
         if not hasattr(parser, '_namedCycleNodes'):
             parser._namedCycleNodes = {}
-
         parser._namedCycleNodes[name] = node
-        return node
-
     else:
-        raise TemplateSyntaxError("Invalid arguments to 'cycle': %s" % args)
+        node = CycleNode(args[1:])
+    return node
 cycle = register.tag(cycle)
 
 def debug(parser, token):
Index: docs/templates.txt
===================================================================
--- docs/templates.txt	(revision 6094)
+++ docs/templates.txt	(working copy)
@@ -366,26 +366,31 @@
 cycle
 ~~~~~
 
-Cycle among the given strings each time this tag is encountered.
+Cycle among the given strings or variables each time this tag is encountered.
 
-Within a loop, cycles among the given strings each time through the loop::
+Within a loop, cycles among the given strings/variables each time through the
+loop::
 
     {% for o in some_list %}
-        <tr class="{% cycle row1,row2 %}">
+        <tr class="{% cycle 'row1' 'row2' rowvar %}">
             ...
         </tr>
     {% endfor %}
-
+ 
 Outside of a loop, give the values a unique name the first time you call it,
 then use that name each successive time through::
 
-        <tr class="{% cycle row1,row2,row3 as rowcolors %}">...</tr>
+        <tr class="{% cycle 'row1' 'row2' rowvar as rowcolors %}">...</tr>
         <tr class="{% cycle rowcolors %}">...</tr>
         <tr class="{% cycle rowcolors %}">...</tr>
 
-You can use any number of values, separated by commas. Make sure not to put
-spaces between the values -- only commas.
+You can use any number of values, separated by spaces. Values enclosed in 
+single (') or double quotes (") are treated as string literals, while values 
+without quotes are assumed to refer to context variables. 
 
+The depreciated comma-separated syntax (`{% cycle row1,row2 %}`) is still
+supported.
+
 debug
 ~~~~~
 
Index: tests/regressiontests/templates/tests.py
===================================================================
--- tests/regressiontests/templates/tests.py	(revision 6094)
+++ tests/regressiontests/templates/tests.py	(working copy)
@@ -306,6 +306,14 @@
             'cycle06': ('{% cycle a %}', {}, template.TemplateSyntaxError),
             'cycle07': ('{% cycle a,b,c as foo %}{% cycle bar %}', {}, template.TemplateSyntaxError),
             'cycle08': ('{% cycle a,b,c as foo %}{% cycle foo %}{{ foo }}{{ foo }}{% cycle foo %}{{ foo }}', {}, 'abbbcc'),
+            'cycle09': ("{% for i in test %}{% cycle a,b %}{{ i }},{% endfor %}", {'test': range(5)}, 'a0,b1,a2,b3,a4,'),
+            # New format:
+            'cycle10': ("{% cycle 'a' 'b' 'c' as abc %}{% cycle abc %}", {}, 'ab'),
+            'cycle11': ("{% cycle 'a' 'b' 'c' as abc %}{% cycle abc %}{% cycle abc %}", {}, 'abc'),
+            'cycle12': ("{% cycle 'a' 'b' 'c' as abc %}{% cycle abc %}{% cycle abc %}{% cycle abc %}", {}, 'abca'),
+            'cycle13': ("{% for i in test %}{% cycle 'a' 'b' %}{{ i }},{% endfor %}", {'test': range(5)}, 'a0,b1,a2,b3,a4,'),
+            'cycle14': ("{% cycle one two as foo %}{% cycle foo %}", {'one': '1','two': '2'}, '12'),
+            'cycle13': ("{% for i in test %}{% cycle aye bee %}{{ i }},{% endfor %}", {'test': range(5), 'aye': 'a', 'bee': 'b'}, 'a0,b1,a2,b3,a4,'),
 
             ### EXCEPTIONS ############################################################
 
