comparison apps/snippet/views.py @ 151:c7be7def8b57

Bundles! (basic functionality) Changes made in this commit: * Added new dependencies (see pip-requirements) * Added new dependency and setup information to README * Deleted the included mptt app (in apps/mptt) in favour of just adding the dependency to pip-requirements (makes it easier to update, etc) * Changed the import convention to use `from apps.bundle.models import Bundle` rather than `from agora.apps.bundle.models import Bundle` because Celery was having problems with the latter style. Everything should still work. * Moved the syntax-highlighting and related code for snippets into separate HTML files so that they can be used by the bundle app And, of course, the ability to upload bundles. But wait! There's more! Changes still to come, for only $19.95 a month: * Bundle versioning * Automatic license integration (i.e. adding headers to files) * The ability to download bundles (zip, tar, etc) * Rating bundles * And much, much more! Batteries not included.
author dellsystem <ilostwaldo@gmail.com>
date Mon, 15 Oct 2012 00:52:00 -0400
parents 77babc4afe34
children a4f88ac85837
comparison
equal deleted inserted replaced
150:3db897f5acdc 151:c7be7def8b57
11 from django.core.exceptions import ObjectDoesNotExist 11 from django.core.exceptions import ObjectDoesNotExist
12 from django.utils.translation import ugettext_lazy as _ 12 from django.utils.translation import ugettext_lazy as _
13 from django.core.urlresolvers import reverse 13 from django.core.urlresolvers import reverse
14 from django.utils import simplejson 14 from django.utils import simplejson
15 15
16 from agora.apps.snippet.forms import SnippetForm, UserSettingsForm 16 from apps.snippet.forms import SnippetForm, UserSettingsForm
17 from agora.apps.snippet.models import Snippet 17 from apps.snippet.models import Snippet
18 from agora.apps.snippet.highlight import pygmentize, guess_code_lexer, \ 18 from apps.snippet.highlight import pygmentize, guess_code_lexer, \
19 LEXER_LIST 19 LEXER_LIST
20 from agora.apps.pygments_style.models import PygmentsStyle 20 from apps.pygments_style.models import PygmentsStyle
21 21
22 22
23 def snippet_explore(request): 23 def explore(request):
24 context = { 24 context = {
25 'recent_snippets': Snippet.objects.public()[:20] 25 'recent_snippets': Snippet.objects.public()[:20]
26 } 26 }
27 27
28 return render(request, 'snippet/explore.html', context) 28 return render(request, 'snippet/explore.html', context)