We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Mélange de contexte entre les contenus, les tutos et les articles
Serveur : Bêta
Version : v18-RC3/ffa18f8
Système : Mac OS X El Capitain
Navigateur : Safari Version 9.0.3 (11601.4.4)

Attention, ce n'est pas simple à comprendre et la portée du bug est peut-être plus important que le scénario décrit dans cette issue mais j'ai tenté de bien cerner le bug.

Scénario :
- Rendez-vous dans le menu déroulant des tutoriels.
- Cliquez sur une catégorie ou un tag, constatez que vous êtes dans un contexte de tutoriel (cf. le fil d'ariane).
- Sur cette page de catégorie et/ou de tag, constatez que vous pouvez utiliser les liens du fil d'ariane, les boutons du menu et que vous pouvez cliqué sur une catégorie dans le menu "Catégories des tutoriels" dans la sidebar. D'ailleurs, si vous cliquez sur l'une des catégories dans la sidebar, vous restez dans le contexte des tutoriels.
- Maintenant retournez dans le menu déroulant des tutoriels et cliquez sur "Tous les tags", puis rendez-vous dans l'une des catégories listée.
- Constatez que vous êtes dans un contexte "Contenu" et non plus tutoriel. Puis vous ne pouvez 
  - Plus utiliser les liens dans le fil d'ariane.
  - Plus créer un contenu ni aider les auteurs.
  - Plus utiliser les flux.
  - Vous pouvez utilisé les catégories de la sidebar mais vous restez dans le contexte des menus. Vous gardez donc les mêmes bugs.

Note 1 : Tous ces bugs sont surement identiques avec les articles.
Note 2 : Vous pouvez aussi retrouver le bug en cliquant sur les catégories et les tags depuis un contenu publié.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `zds/tutorialv2/urls/urls_contents.py`
Content:
```
1 # coding: utf-8
2 
3 from django.conf.urls import url
4 
5 from zds.tutorialv2.views.views_contents import DisplayContent, CreateContent, EditContent, \
6     DeleteContent, CreateContainer, DisplayContainer, EditContainer, CreateExtract, EditExtract, \
7     DeleteContainerOrExtract, ManageBetaContent, DisplayHistory, DisplayDiff, ActivateJSFiddleInContent, MoveChild, \
8     DownloadContent, UpdateContentWithArchive, CreateContentFromArchive, ContentsWithHelps, AddAuthorToContent, \
9     RemoveAuthorFromContent, WarnTypo, DisplayBetaContent, DisplayBetaContainer, ContentOfAuthor
10 
11 from zds.tutorialv2.views.views_published import SendNoteFormView, UpdateNoteView, \
12     HideReaction, ShowReaction, SendNoteAlert, SolveNoteAlert, TagsListView, ListOnlineContents, FollowContent
13 
14 urlpatterns = [
15     url(r'^tutoriels/(?P<pk>\d+)/$',
16         ContentOfAuthor.as_view(type='TUTORIAL', context_object_name='tutorials'),
17         name="find-tutorial"),
18     url(r'^articles/(?P<pk>\d+)/$',
19         ContentOfAuthor.as_view(type='ARTICLE', context_object_name='articles'),
20         name="find-article"),
21 
22     url(r'^aides/$', ContentsWithHelps.as_view(), name='helps'),
23     url(r'^(?P<pk>\d+)/(?P<slug>.+)/(?P<parent_container_slug>.+)/(?P<container_slug>.+)/$',
24         DisplayContainer.as_view(public_is_prioritary=False),
25         name='view-container'),
26     url(r'^(?P<pk>\d+)/(?P<slug>.+)/(?P<container_slug>.+)/$',
27         DisplayContainer.as_view(public_is_prioritary=False),
28         name='view-container'),
29 
30     url(r'^(?P<pk>\d+)/(?P<slug>.+)/$', DisplayContent.as_view(public_is_prioritary=False),
31         name='view'),
32 
33     url(r'^telecharger/(?P<pk>\d+)/(?P<slug>.+)/$', DownloadContent.as_view(),
34         name='download-zip'),
35 
36     # beta:
37     url(r'^beta/(?P<pk>\d+)/(?P<slug>.+)/(?P<parent_container_slug>.+)/(?P<container_slug>.+)/$',
38         DisplayBetaContainer.as_view(public_is_prioritary=False),
39         name='beta-view-container'),
40     url(r'^beta/(?P<pk>\d+)/(?P<slug>.+)/(?P<container_slug>.+)/$',
41         DisplayBetaContainer.as_view(public_is_prioritary=False),
42         name='beta-view-container'),
43 
44     url(r'^beta/(?P<pk>\d+)/(?P<slug>.+)/$', DisplayBetaContent.as_view(), name='beta-view'),
45 
46     # reactions:
47     url(r'^reactions/ajouter/$', SendNoteFormView.as_view(redirection_is_needed=False), name="add-reaction"),
48     url(r'^reactions/editer/$', UpdateNoteView.as_view(redirection_is_needed=False), name="update-reaction"),
49     url(r'^reactions/cacher/(?P<pk>\d+)/$', HideReaction.as_view(), name="hide-reaction"),
50     url(r'^reactions/afficher/(?P<pk>\d+)/$', ShowReaction.as_view(), name="show-reaction"),
51     url(r'^reactions/alerter/(?P<pk>\d+)/$', SendNoteAlert.as_view(), name="alert-reaction"),
52     url(r'^reactions/resoudre/$', SolveNoteAlert.as_view(), name="resolve-reaction"),
53 
54     # follow:
55     url(r'^follow/(?P<pk>\d+)/$', FollowContent.as_view(), name="follow"),
56 
57     # typo:
58     url(r'^reactions/typo/$', WarnTypo.as_view(), name="warn-typo"),
59 
60     # create:
61     url(r'^nouveau-tutoriel/$',
62         CreateContent.as_view(created_content_type="TUTORIAL"), name='create-tutorial'),
63     url(r'^nouvel-article/$',
64         CreateContent.as_view(created_content_type="ARTICLE"), name='create-article'),
65     url(r'^nouveau-conteneur/(?P<pk>\d+)/(?P<slug>.+)/(?P<container_slug>.+)/$',
66         CreateContainer.as_view(),
67         name='create-container'),
68     url(r'^nouveau-conteneur/(?P<pk>\d+)/(?P<slug>.+)/$',
69         CreateContainer.as_view(),
70         name='create-container'),
71 
72 
73     url(r'^nouvelle-section/(?P<pk>\d+)/(?P<slug>.+)/(?P<parent_container_slug>.+)/(?P<container_slug>.+)/$',
74         CreateExtract.as_view(),
75         name='create-extract'),
76     url(r'^nouvelle-section/(?P<pk>\d+)/(?P<slug>.+)/(?P<container_slug>.+)/$',
77         CreateExtract.as_view(),
78         name='create-extract'),
79     url(r'^nouvelle-section/(?P<pk>\d+)/(?P<slug>.+)/$',
80         CreateExtract.as_view(),
81         name='create-extract'),
82 
83     # edit:
84     url(r'^editer-conteneur/(?P<pk>\d+)/(?P<slug>.+)/(?P<parent_container_slug>.+)/'
85         r'(?P<container_slug>.+)/$',
86         EditContainer.as_view(),
87         name='edit-container'),
88     url(r'^editer-conteneur/(?P<pk>\d+)/(?P<slug>.+)/(?P<container_slug>.+)/$',
89         EditContainer.as_view(),
90         name='edit-container'),
91 
92     url(r'^editer-section/(?P<pk>\d+)/(?P<slug>.+)/(?P<parent_container_slug>.+)/'
93         r'(?P<container_slug>.+)/(?P<extract_slug>.+)/$',
94         EditExtract.as_view(),
95         name='edit-extract'),
96     url(r'^editer-section/(?P<pk>\d+)/(?P<slug>.+)/(?P<container_slug>.+)/(?P<extract_slug>.+)/$',
97         EditExtract.as_view(),
98         name='edit-extract'),
99     url(r'^editer-section/(?P<pk>\d+)/(?P<slug>.+)/(?P<extract_slug>.+)/$',
100         EditExtract.as_view(),
101         name='edit-extract'),
102 
103     url(r'^editer/(?P<pk>\d+)/(?P<slug>.+)/$', EditContent.as_view(), name='edit'),
104     url(r'^deplacer/$', MoveChild.as_view(), name='move-element'),
105 
106     url(r'^historique/(?P<pk>\d+)/(?P<slug>.+)/$', DisplayHistory.as_view(), name="history"),
107     url(r'^comparaison/(?P<pk>\d+)/(?P<slug>.+)/$', DisplayDiff.as_view(), name="diff"),
108     url(r'^ajouter-auteur/(?P<pk>\d+)/$', AddAuthorToContent.as_view(), name="add-author"),
109     url(r'^enlever-auteur/(?P<pk>\d+)/$', RemoveAuthorFromContent.as_view(), name="remove-author"),
110     # beta:
111     url(r'^activer-beta/(?P<pk>\d+)/(?P<slug>.+)/$', ManageBetaContent.as_view(action='set'),
112         name="set-beta"),
113     url(r'^desactiver-beta/(?P<pk>\d+)/(?P<slug>.+)/$', ManageBetaContent.as_view(action='inactive'),
114         name="inactive-beta"),
115 
116     # jsfiddle support:
117     url(r'activer-js/', ActivateJSFiddleInContent.as_view(), name="activate-jsfiddle"),
118 
119     # delete:
120     url(r'^supprimer/(?P<pk>\d+)/(?P<slug>.+)/(?P<parent_container_slug>.+)/(?P<container_slug>.+)/'
121         r'(?P<object_slug>.+)/$',
122         DeleteContainerOrExtract.as_view(),
123         name='delete'),
124     url(r'^supprimer/(?P<pk>\d+)/(?P<slug>.+)/(?P<container_slug>.+)/(?P<object_slug>.+)/$',
125         DeleteContainerOrExtract.as_view(),
126         name='delete'),
127     url(r'^supprimer/(?P<pk>\d+)/(?P<slug>.+)/(?P<object_slug>.+)/$',
128         DeleteContainerOrExtract.as_view(),
129         name='delete'),
130 
131     url(r'^supprimer/(?P<pk>\d+)/(?P<slug>.+)/$', DeleteContent.as_view(), name='delete'),
132 
133     # markdown import
134     url(r'^importer/archive/nouveau/$', CreateContentFromArchive.as_view(), name="import-new"),
135     url(r'^importer/(?P<pk>\d+)/(?P<slug>.+)/$', UpdateContentWithArchive.as_view(), name="import"),
136 
137     # tags
138     url(r'^tags/$', TagsListView.as_view(), name='tags'),
139 
140     url(r'^$', ListOnlineContents.as_view(), name='list'),
141 ]
142
```

Path: `zds/tutorialv2/feeds.py`
Content:
```
1 # coding: utf-8
2 
3 from django.contrib.syndication.views import Feed
4 from django.conf import settings
5 
6 from django.utils.feedgenerator import Atom1Feed
7 
8 from zds.tutorialv2.models.models_database import PublishedContent
9 from zds.settings import ZDS_APP
10 
11 
12 class LastContentFeedRSS(Feed):
13     """
14     RSS feed for any type of content.
15     """
16     title = u"Contenu sur {}".format(settings.ZDS_APP['site']['litteral_name'])
17     description = u"Les derniers contenus parus sur {}.".format(settings.ZDS_APP['site']['litteral_name'])
18     link = ""
19     content_type = None
20 
21     def items(self):
22         """
23         :return: The last (typically 5) contents (sorted by publication date).
24         If `self.type` is not `None`, the contents will only be of this type.
25         """
26         contents = PublishedContent.objects\
27             .prefetch_related("content")\
28             .prefetch_related("content__authors")
29 
30         if self.content_type is not None:
31             contents = contents.filter(content_type=self.content_type)
32 
33         return contents.order_by('-publication_date')[:ZDS_APP['content']['feed_length']]
34 
35     def item_title(self, item):
36         return item.content.title
37 
38     def item_pubdate(self, item):
39         return item.publication_date
40 
41     def item_description(self, item):
42         return item.content.description
43 
44     def item_author_name(self, item):
45         authors_list = item.content.authors.all()
46         authors = []
47         for authors_obj in authors_list:
48             authors.append(authors_obj.username)
49         authors = ", ".join(authors)
50         return authors
51 
52     def item_link(self, item):
53         return item.get_absolute_url_online()
54 
55 
56 class LastTutorialsFeedRSS(LastContentFeedRSS):
57     """
58     Redefinition of `LastContentFeedRSS` for tutorials only
59     """
60     content_type = "TUTORIAL"
61     link = "/tutoriels/"
62     title = u"Tutoriels sur {}".format(settings.ZDS_APP['site']['litteral_name'])
63     description = u"Les derniers tutoriels parus sur {}.".format(settings.ZDS_APP['site']['litteral_name'])
64 
65 
66 class LastTutorialsFeedATOM(LastTutorialsFeedRSS):
67     feed_type = Atom1Feed
68     subtitle = LastTutorialsFeedRSS.description
69 
70 
71 class LastArticlesFeedRSS(LastContentFeedRSS):
72     """
73     Redefinition of `LastContentFeedRSS` for articles only
74     """
75     content_type = "ARTICLE"
76     link = "/articles/"
77     title = u"Articles sur {}".format(settings.ZDS_APP['site']['litteral_name'])
78     description = u"Les derniers articles parus sur {}.".format(settings.ZDS_APP['site']['litteral_name'])
79 
80 
81 class LastArticlesFeedATOM(LastArticlesFeedRSS):
82     feed_type = Atom1Feed
83     subtitle = LastArticlesFeedRSS.description
84
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/zds/tutorialv2/feeds.py b/zds/tutorialv2/feeds.py
--- a/zds/tutorialv2/feeds.py
+++ b/zds/tutorialv2/feeds.py
@@ -13,7 +13,7 @@
     """
     RSS feed for any type of content.
     """
-    title = u"Contenu sur {}".format(settings.ZDS_APP['site']['litteral_name'])
+    title = u"Contenus sur {}".format(settings.ZDS_APP['site']['litteral_name'])
     description = u"Les derniers contenus parus sur {}.".format(settings.ZDS_APP['site']['litteral_name'])
     link = ""
     content_type = None
@@ -53,6 +53,11 @@
         return item.get_absolute_url_online()
 
 
+class LastContentFeedATOM(LastContentFeedRSS):
+    feed_type = Atom1Feed
+    subtitle = LastContentFeedRSS.description
+
+
 class LastTutorialsFeedRSS(LastContentFeedRSS):
     """
     Redefinition of `LastContentFeedRSS` for tutorials only
diff --git a/zds/tutorialv2/urls/urls_contents.py b/zds/tutorialv2/urls/urls_contents.py
--- a/zds/tutorialv2/urls/urls_contents.py
+++ b/zds/tutorialv2/urls/urls_contents.py
@@ -11,7 +11,13 @@
 from zds.tutorialv2.views.views_published import SendNoteFormView, UpdateNoteView, \
     HideReaction, ShowReaction, SendNoteAlert, SolveNoteAlert, TagsListView, ListOnlineContents, FollowContent
 
+from zds.tutorialv2.feeds import LastContentFeedRSS, LastContentFeedATOM
+
 urlpatterns = [
+    # Flux
+    url(r'^flux/rss/$', LastContentFeedRSS(), name='feed-rss'),
+    url(r'^flux/atom/$', LastContentFeedATOM(), name='feed-atom'),
+
     url(r'^tutoriels/(?P<pk>\d+)/$',
         ContentOfAuthor.as_view(type='TUTORIAL', context_object_name='tutorials'),
         name="find-tutorial"),

{"golden_diff": "diff --git a/zds/tutorialv2/feeds.py b/zds/tutorialv2/feeds.py\n--- a/zds/tutorialv2/feeds.py\n+++ b/zds/tutorialv2/feeds.py\n@@ -13,7 +13,7 @@\n     \"\"\"\n     RSS feed for any type of content.\n     \"\"\"\n-    title = u\"Contenu sur {}\".format(settings.ZDS_APP['site']['litteral_name'])\n+    title = u\"Contenus sur {}\".format(settings.ZDS_APP['site']['litteral_name'])\n     description = u\"Les derniers contenus parus sur {}.\".format(settings.ZDS_APP['site']['litteral_name'])\n     link = \"\"\n     content_type = None\n@@ -53,6 +53,11 @@\n         return item.get_absolute_url_online()\n \n \n+class LastContentFeedATOM(LastContentFeedRSS):\n+    feed_type = Atom1Feed\n+    subtitle = LastContentFeedRSS.description\n+\n+\n class LastTutorialsFeedRSS(LastContentFeedRSS):\n     \"\"\"\n     Redefinition of `LastContentFeedRSS` for tutorials only\ndiff --git a/zds/tutorialv2/urls/urls_contents.py b/zds/tutorialv2/urls/urls_contents.py\n--- a/zds/tutorialv2/urls/urls_contents.py\n+++ b/zds/tutorialv2/urls/urls_contents.py\n@@ -11,7 +11,13 @@\n from zds.tutorialv2.views.views_published import SendNoteFormView, UpdateNoteView, \\\n     HideReaction, ShowReaction, SendNoteAlert, SolveNoteAlert, TagsListView, ListOnlineContents, FollowContent\n \n+from zds.tutorialv2.feeds import LastContentFeedRSS, LastContentFeedATOM\n+\n urlpatterns = [\n+    # Flux\n+    url(r'^flux/rss/$', LastContentFeedRSS(), name='feed-rss'),\n+    url(r'^flux/atom/$', LastContentFeedATOM(), name='feed-atom'),\n+\n     url(r'^tutoriels/(?P<pk>\\d+)/$',\n         ContentOfAuthor.as_view(type='TUTORIAL', context_object_name='tutorials'),\n         name=\"find-tutorial\"),\n", "issue": "M\u00e9lange de contexte entre les contenus, les tutos et les articles\nServeur : B\u00eata\nVersion : v18-RC3/ffa18f8\nSyst\u00e8me : Mac OS X El Capitain\nNavigateur : Safari Version 9.0.3 (11601.4.4)\n\nAttention, ce n'est pas simple \u00e0 comprendre et la port\u00e9e du bug est peut-\u00eatre plus important que le sc\u00e9nario d\u00e9crit dans cette issue mais j'ai tent\u00e9 de bien cerner le bug.\n\nSc\u00e9nario :\n- Rendez-vous dans le menu d\u00e9roulant des tutoriels.\n- Cliquez sur une cat\u00e9gorie ou un tag, constatez que vous \u00eates dans un contexte de tutoriel (cf. le fil d'ariane).\n- Sur cette page de cat\u00e9gorie et/ou de tag, constatez que vous pouvez utiliser les liens du fil d'ariane, les boutons du menu et que vous pouvez cliqu\u00e9 sur une cat\u00e9gorie dans le menu \"Cat\u00e9gories des tutoriels\" dans la sidebar. D'ailleurs, si vous cliquez sur l'une des cat\u00e9gories dans la sidebar, vous restez dans le contexte des tutoriels.\n- Maintenant retournez dans le menu d\u00e9roulant des tutoriels et cliquez sur \"Tous les tags\", puis rendez-vous dans l'une des cat\u00e9gories list\u00e9e.\n- Constatez que vous \u00eates dans un contexte \"Contenu\" et non plus tutoriel. Puis vous ne pouvez \n  - Plus utiliser les liens dans le fil d'ariane.\n  - Plus cr\u00e9er un contenu ni aider les auteurs.\n  - Plus utiliser les flux.\n  - Vous pouvez utilis\u00e9 les cat\u00e9gories de la sidebar mais vous restez dans le contexte des menus. Vous gardez donc les m\u00eames bugs.\n\nNote 1 : Tous ces bugs sont surement identiques avec les articles.\nNote 2 : Vous pouvez aussi retrouver le bug en cliquant sur les cat\u00e9gories et les tags depuis un contenu publi\u00e9.\n\n", "before_files": [{"content": "# coding: utf-8\n\nfrom django.conf.urls import url\n\nfrom zds.tutorialv2.views.views_contents import DisplayContent, CreateContent, EditContent, \\\n    DeleteContent, CreateContainer, DisplayContainer, EditContainer, CreateExtract, EditExtract, \\\n    DeleteContainerOrExtract, ManageBetaContent, DisplayHistory, DisplayDiff, ActivateJSFiddleInContent, MoveChild, \\\n    DownloadContent, UpdateContentWithArchive, CreateContentFromArchive, ContentsWithHelps, AddAuthorToContent, \\\n    RemoveAuthorFromContent, WarnTypo, DisplayBetaContent, DisplayBetaContainer, ContentOfAuthor\n\nfrom zds.tutorialv2.views.views_published import SendNoteFormView, UpdateNoteView, \\\n    HideReaction, ShowReaction, SendNoteAlert, SolveNoteAlert, TagsListView, ListOnlineContents, FollowContent\n\nurlpatterns = [\n    url(r'^tutoriels/(?P<pk>\\d+)/$',\n        ContentOfAuthor.as_view(type='TUTORIAL', context_object_name='tutorials'),\n        name=\"find-tutorial\"),\n    url(r'^articles/(?P<pk>\\d+)/$',\n        ContentOfAuthor.as_view(type='ARTICLE', context_object_name='articles'),\n        name=\"find-article\"),\n\n    url(r'^aides/$', ContentsWithHelps.as_view(), name='helps'),\n    url(r'^(?P<pk>\\d+)/(?P<slug>.+)/(?P<parent_container_slug>.+)/(?P<container_slug>.+)/$',\n        DisplayContainer.as_view(public_is_prioritary=False),\n        name='view-container'),\n    url(r'^(?P<pk>\\d+)/(?P<slug>.+)/(?P<container_slug>.+)/$',\n        DisplayContainer.as_view(public_is_prioritary=False),\n        name='view-container'),\n\n    url(r'^(?P<pk>\\d+)/(?P<slug>.+)/$', DisplayContent.as_view(public_is_prioritary=False),\n        name='view'),\n\n    url(r'^telecharger/(?P<pk>\\d+)/(?P<slug>.+)/$', DownloadContent.as_view(),\n        name='download-zip'),\n\n    # beta:\n    url(r'^beta/(?P<pk>\\d+)/(?P<slug>.+)/(?P<parent_container_slug>.+)/(?P<container_slug>.+)/$',\n        DisplayBetaContainer.as_view(public_is_prioritary=False),\n        name='beta-view-container'),\n    url(r'^beta/(?P<pk>\\d+)/(?P<slug>.+)/(?P<container_slug>.+)/$',\n        DisplayBetaContainer.as_view(public_is_prioritary=False),\n        name='beta-view-container'),\n\n    url(r'^beta/(?P<pk>\\d+)/(?P<slug>.+)/$', DisplayBetaContent.as_view(), name='beta-view'),\n\n    # reactions:\n    url(r'^reactions/ajouter/$', SendNoteFormView.as_view(redirection_is_needed=False), name=\"add-reaction\"),\n    url(r'^reactions/editer/$', UpdateNoteView.as_view(redirection_is_needed=False), name=\"update-reaction\"),\n    url(r'^reactions/cacher/(?P<pk>\\d+)/$', HideReaction.as_view(), name=\"hide-reaction\"),\n    url(r'^reactions/afficher/(?P<pk>\\d+)/$', ShowReaction.as_view(), name=\"show-reaction\"),\n    url(r'^reactions/alerter/(?P<pk>\\d+)/$', SendNoteAlert.as_view(), name=\"alert-reaction\"),\n    url(r'^reactions/resoudre/$', SolveNoteAlert.as_view(), name=\"resolve-reaction\"),\n\n    # follow:\n    url(r'^follow/(?P<pk>\\d+)/$', FollowContent.as_view(), name=\"follow\"),\n\n    # typo:\n    url(r'^reactions/typo/$', WarnTypo.as_view(), name=\"warn-typo\"),\n\n    # create:\n    url(r'^nouveau-tutoriel/$',\n        CreateContent.as_view(created_content_type=\"TUTORIAL\"), name='create-tutorial'),\n    url(r'^nouvel-article/$',\n        CreateContent.as_view(created_content_type=\"ARTICLE\"), name='create-article'),\n    url(r'^nouveau-conteneur/(?P<pk>\\d+)/(?P<slug>.+)/(?P<container_slug>.+)/$',\n        CreateContainer.as_view(),\n        name='create-container'),\n    url(r'^nouveau-conteneur/(?P<pk>\\d+)/(?P<slug>.+)/$',\n        CreateContainer.as_view(),\n        name='create-container'),\n\n\n    url(r'^nouvelle-section/(?P<pk>\\d+)/(?P<slug>.+)/(?P<parent_container_slug>.+)/(?P<container_slug>.+)/$',\n        CreateExtract.as_view(),\n        name='create-extract'),\n    url(r'^nouvelle-section/(?P<pk>\\d+)/(?P<slug>.+)/(?P<container_slug>.+)/$',\n        CreateExtract.as_view(),\n        name='create-extract'),\n    url(r'^nouvelle-section/(?P<pk>\\d+)/(?P<slug>.+)/$',\n        CreateExtract.as_view(),\n        name='create-extract'),\n\n    # edit:\n    url(r'^editer-conteneur/(?P<pk>\\d+)/(?P<slug>.+)/(?P<parent_container_slug>.+)/'\n        r'(?P<container_slug>.+)/$',\n        EditContainer.as_view(),\n        name='edit-container'),\n    url(r'^editer-conteneur/(?P<pk>\\d+)/(?P<slug>.+)/(?P<container_slug>.+)/$',\n        EditContainer.as_view(),\n        name='edit-container'),\n\n    url(r'^editer-section/(?P<pk>\\d+)/(?P<slug>.+)/(?P<parent_container_slug>.+)/'\n        r'(?P<container_slug>.+)/(?P<extract_slug>.+)/$',\n        EditExtract.as_view(),\n        name='edit-extract'),\n    url(r'^editer-section/(?P<pk>\\d+)/(?P<slug>.+)/(?P<container_slug>.+)/(?P<extract_slug>.+)/$',\n        EditExtract.as_view(),\n        name='edit-extract'),\n    url(r'^editer-section/(?P<pk>\\d+)/(?P<slug>.+)/(?P<extract_slug>.+)/$',\n        EditExtract.as_view(),\n        name='edit-extract'),\n\n    url(r'^editer/(?P<pk>\\d+)/(?P<slug>.+)/$', EditContent.as_view(), name='edit'),\n    url(r'^deplacer/$', MoveChild.as_view(), name='move-element'),\n\n    url(r'^historique/(?P<pk>\\d+)/(?P<slug>.+)/$', DisplayHistory.as_view(), name=\"history\"),\n    url(r'^comparaison/(?P<pk>\\d+)/(?P<slug>.+)/$', DisplayDiff.as_view(), name=\"diff\"),\n    url(r'^ajouter-auteur/(?P<pk>\\d+)/$', AddAuthorToContent.as_view(), name=\"add-author\"),\n    url(r'^enlever-auteur/(?P<pk>\\d+)/$', RemoveAuthorFromContent.as_view(), name=\"remove-author\"),\n    # beta:\n    url(r'^activer-beta/(?P<pk>\\d+)/(?P<slug>.+)/$', ManageBetaContent.as_view(action='set'),\n        name=\"set-beta\"),\n    url(r'^desactiver-beta/(?P<pk>\\d+)/(?P<slug>.+)/$', ManageBetaContent.as_view(action='inactive'),\n        name=\"inactive-beta\"),\n\n    # jsfiddle support:\n    url(r'activer-js/', ActivateJSFiddleInContent.as_view(), name=\"activate-jsfiddle\"),\n\n    # delete:\n    url(r'^supprimer/(?P<pk>\\d+)/(?P<slug>.+)/(?P<parent_container_slug>.+)/(?P<container_slug>.+)/'\n        r'(?P<object_slug>.+)/$',\n        DeleteContainerOrExtract.as_view(),\n        name='delete'),\n    url(r'^supprimer/(?P<pk>\\d+)/(?P<slug>.+)/(?P<container_slug>.+)/(?P<object_slug>.+)/$',\n        DeleteContainerOrExtract.as_view(),\n        name='delete'),\n    url(r'^supprimer/(?P<pk>\\d+)/(?P<slug>.+)/(?P<object_slug>.+)/$',\n        DeleteContainerOrExtract.as_view(),\n        name='delete'),\n\n    url(r'^supprimer/(?P<pk>\\d+)/(?P<slug>.+)/$', DeleteContent.as_view(), name='delete'),\n\n    # markdown import\n    url(r'^importer/archive/nouveau/$', CreateContentFromArchive.as_view(), name=\"import-new\"),\n    url(r'^importer/(?P<pk>\\d+)/(?P<slug>.+)/$', UpdateContentWithArchive.as_view(), name=\"import\"),\n\n    # tags\n    url(r'^tags/$', TagsListView.as_view(), name='tags'),\n\n    url(r'^$', ListOnlineContents.as_view(), name='list'),\n]\n", "path": "zds/tutorialv2/urls/urls_contents.py"}, {"content": "# coding: utf-8\n\nfrom django.contrib.syndication.views import Feed\nfrom django.conf import settings\n\nfrom django.utils.feedgenerator import Atom1Feed\n\nfrom zds.tutorialv2.models.models_database import PublishedContent\nfrom zds.settings import ZDS_APP\n\n\nclass LastContentFeedRSS(Feed):\n    \"\"\"\n    RSS feed for any type of content.\n    \"\"\"\n    title = u\"Contenu sur {}\".format(settings.ZDS_APP['site']['litteral_name'])\n    description = u\"Les derniers contenus parus sur {}.\".format(settings.ZDS_APP['site']['litteral_name'])\n    link = \"\"\n    content_type = None\n\n    def items(self):\n        \"\"\"\n        :return: The last (typically 5) contents (sorted by publication date).\n        If `self.type` is not `None`, the contents will only be of this type.\n        \"\"\"\n        contents = PublishedContent.objects\\\n            .prefetch_related(\"content\")\\\n            .prefetch_related(\"content__authors\")\n\n        if self.content_type is not None:\n            contents = contents.filter(content_type=self.content_type)\n\n        return contents.order_by('-publication_date')[:ZDS_APP['content']['feed_length']]\n\n    def item_title(self, item):\n        return item.content.title\n\n    def item_pubdate(self, item):\n        return item.publication_date\n\n    def item_description(self, item):\n        return item.content.description\n\n    def item_author_name(self, item):\n        authors_list = item.content.authors.all()\n        authors = []\n        for authors_obj in authors_list:\n            authors.append(authors_obj.username)\n        authors = \", \".join(authors)\n        return authors\n\n    def item_link(self, item):\n        return item.get_absolute_url_online()\n\n\nclass LastTutorialsFeedRSS(LastContentFeedRSS):\n    \"\"\"\n    Redefinition of `LastContentFeedRSS` for tutorials only\n    \"\"\"\n    content_type = \"TUTORIAL\"\n    link = \"/tutoriels/\"\n    title = u\"Tutoriels sur {}\".format(settings.ZDS_APP['site']['litteral_name'])\n    description = u\"Les derniers tutoriels parus sur {}.\".format(settings.ZDS_APP['site']['litteral_name'])\n\n\nclass LastTutorialsFeedATOM(LastTutorialsFeedRSS):\n    feed_type = Atom1Feed\n    subtitle = LastTutorialsFeedRSS.description\n\n\nclass LastArticlesFeedRSS(LastContentFeedRSS):\n    \"\"\"\n    Redefinition of `LastContentFeedRSS` for articles only\n    \"\"\"\n    content_type = \"ARTICLE\"\n    link = \"/articles/\"\n    title = u\"Articles sur {}\".format(settings.ZDS_APP['site']['litteral_name'])\n    description = u\"Les derniers articles parus sur {}.\".format(settings.ZDS_APP['site']['litteral_name'])\n\n\nclass LastArticlesFeedATOM(LastArticlesFeedRSS):\n    feed_type = Atom1Feed\n    subtitle = LastArticlesFeedRSS.description\n", "path": "zds/tutorialv2/feeds.py"}], "after_files": [{"content": "# coding: utf-8\n\nfrom django.conf.urls import url\n\nfrom zds.tutorialv2.views.views_contents import DisplayContent, CreateContent, EditContent, \\\n    DeleteContent, CreateContainer, DisplayContainer, EditContainer, CreateExtract, EditExtract, \\\n    DeleteContainerOrExtract, ManageBetaContent, DisplayHistory, DisplayDiff, ActivateJSFiddleInContent, MoveChild, \\\n    DownloadContent, UpdateContentWithArchive, CreateContentFromArchive, ContentsWithHelps, AddAuthorToContent, \\\n    RemoveAuthorFromContent, WarnTypo, DisplayBetaContent, DisplayBetaContainer, ContentOfAuthor\n\nfrom zds.tutorialv2.views.views_published import SendNoteFormView, UpdateNoteView, \\\n    HideReaction, ShowReaction, SendNoteAlert, SolveNoteAlert, TagsListView, ListOnlineContents, FollowContent\n\nfrom zds.tutorialv2.feeds import LastContentFeedRSS, LastContentFeedATOM\n\nurlpatterns = [\n    # Flux\n    url(r'^flux/rss/$', LastContentFeedRSS(), name='feed-rss'),\n    url(r'^flux/atom/$', LastContentFeedATOM(), name='feed-atom'),\n\n    url(r'^tutoriels/(?P<pk>\\d+)/$',\n        ContentOfAuthor.as_view(type='TUTORIAL', context_object_name='tutorials'),\n        name=\"find-tutorial\"),\n    url(r'^articles/(?P<pk>\\d+)/$',\n        ContentOfAuthor.as_view(type='ARTICLE', context_object_name='articles'),\n        name=\"find-article\"),\n\n    url(r'^aides/$', ContentsWithHelps.as_view(), name='helps'),\n    url(r'^(?P<pk>\\d+)/(?P<slug>.+)/(?P<parent_container_slug>.+)/(?P<container_slug>.+)/$',\n        DisplayContainer.as_view(public_is_prioritary=False),\n        name='view-container'),\n    url(r'^(?P<pk>\\d+)/(?P<slug>.+)/(?P<container_slug>.+)/$',\n        DisplayContainer.as_view(public_is_prioritary=False),\n        name='view-container'),\n\n    url(r'^(?P<pk>\\d+)/(?P<slug>.+)/$', DisplayContent.as_view(public_is_prioritary=False),\n        name='view'),\n\n    url(r'^telecharger/(?P<pk>\\d+)/(?P<slug>.+)/$', DownloadContent.as_view(),\n        name='download-zip'),\n\n    # beta:\n    url(r'^beta/(?P<pk>\\d+)/(?P<slug>.+)/(?P<parent_container_slug>.+)/(?P<container_slug>.+)/$',\n        DisplayBetaContainer.as_view(public_is_prioritary=False),\n        name='beta-view-container'),\n    url(r'^beta/(?P<pk>\\d+)/(?P<slug>.+)/(?P<container_slug>.+)/$',\n        DisplayBetaContainer.as_view(public_is_prioritary=False),\n        name='beta-view-container'),\n\n    url(r'^beta/(?P<pk>\\d+)/(?P<slug>.+)/$', DisplayBetaContent.as_view(), name='beta-view'),\n\n    # reactions:\n    url(r'^reactions/ajouter/$', SendNoteFormView.as_view(redirection_is_needed=False), name=\"add-reaction\"),\n    url(r'^reactions/editer/$', UpdateNoteView.as_view(redirection_is_needed=False), name=\"update-reaction\"),\n    url(r'^reactions/cacher/(?P<pk>\\d+)/$', HideReaction.as_view(), name=\"hide-reaction\"),\n    url(r'^reactions/afficher/(?P<pk>\\d+)/$', ShowReaction.as_view(), name=\"show-reaction\"),\n    url(r'^reactions/alerter/(?P<pk>\\d+)/$', SendNoteAlert.as_view(), name=\"alert-reaction\"),\n    url(r'^reactions/resoudre/$', SolveNoteAlert.as_view(), name=\"resolve-reaction\"),\n\n    # follow:\n    url(r'^follow/(?P<pk>\\d+)/$', FollowContent.as_view(), name=\"follow\"),\n\n    # typo:\n    url(r'^reactions/typo/$', WarnTypo.as_view(), name=\"warn-typo\"),\n\n    # create:\n    url(r'^nouveau-tutoriel/$',\n        CreateContent.as_view(created_content_type=\"TUTORIAL\"), name='create-tutorial'),\n    url(r'^nouvel-article/$',\n        CreateContent.as_view(created_content_type=\"ARTICLE\"), name='create-article'),\n    url(r'^nouveau-conteneur/(?P<pk>\\d+)/(?P<slug>.+)/(?P<container_slug>.+)/$',\n        CreateContainer.as_view(),\n        name='create-container'),\n    url(r'^nouveau-conteneur/(?P<pk>\\d+)/(?P<slug>.+)/$',\n        CreateContainer.as_view(),\n        name='create-container'),\n\n\n    url(r'^nouvelle-section/(?P<pk>\\d+)/(?P<slug>.+)/(?P<parent_container_slug>.+)/(?P<container_slug>.+)/$',\n        CreateExtract.as_view(),\n        name='create-extract'),\n    url(r'^nouvelle-section/(?P<pk>\\d+)/(?P<slug>.+)/(?P<container_slug>.+)/$',\n        CreateExtract.as_view(),\n        name='create-extract'),\n    url(r'^nouvelle-section/(?P<pk>\\d+)/(?P<slug>.+)/$',\n        CreateExtract.as_view(),\n        name='create-extract'),\n\n    # edit:\n    url(r'^editer-conteneur/(?P<pk>\\d+)/(?P<slug>.+)/(?P<parent_container_slug>.+)/'\n        r'(?P<container_slug>.+)/$',\n        EditContainer.as_view(),\n        name='edit-container'),\n    url(r'^editer-conteneur/(?P<pk>\\d+)/(?P<slug>.+)/(?P<container_slug>.+)/$',\n        EditContainer.as_view(),\n        name='edit-container'),\n\n    url(r'^editer-section/(?P<pk>\\d+)/(?P<slug>.+)/(?P<parent_container_slug>.+)/'\n        r'(?P<container_slug>.+)/(?P<extract_slug>.+)/$',\n        EditExtract.as_view(),\n        name='edit-extract'),\n    url(r'^editer-section/(?P<pk>\\d+)/(?P<slug>.+)/(?P<container_slug>.+)/(?P<extract_slug>.+)/$',\n        EditExtract.as_view(),\n        name='edit-extract'),\n    url(r'^editer-section/(?P<pk>\\d+)/(?P<slug>.+)/(?P<extract_slug>.+)/$',\n        EditExtract.as_view(),\n        name='edit-extract'),\n\n    url(r'^editer/(?P<pk>\\d+)/(?P<slug>.+)/$', EditContent.as_view(), name='edit'),\n    url(r'^deplacer/$', MoveChild.as_view(), name='move-element'),\n\n    url(r'^historique/(?P<pk>\\d+)/(?P<slug>.+)/$', DisplayHistory.as_view(), name=\"history\"),\n    url(r'^comparaison/(?P<pk>\\d+)/(?P<slug>.+)/$', DisplayDiff.as_view(), name=\"diff\"),\n    url(r'^ajouter-auteur/(?P<pk>\\d+)/$', AddAuthorToContent.as_view(), name=\"add-author\"),\n    url(r'^enlever-auteur/(?P<pk>\\d+)/$', RemoveAuthorFromContent.as_view(), name=\"remove-author\"),\n    # beta:\n    url(r'^activer-beta/(?P<pk>\\d+)/(?P<slug>.+)/$', ManageBetaContent.as_view(action='set'),\n        name=\"set-beta\"),\n    url(r'^desactiver-beta/(?P<pk>\\d+)/(?P<slug>.+)/$', ManageBetaContent.as_view(action='inactive'),\n        name=\"inactive-beta\"),\n\n    # jsfiddle support:\n    url(r'activer-js/', ActivateJSFiddleInContent.as_view(), name=\"activate-jsfiddle\"),\n\n    # delete:\n    url(r'^supprimer/(?P<pk>\\d+)/(?P<slug>.+)/(?P<parent_container_slug>.+)/(?P<container_slug>.+)/'\n        r'(?P<object_slug>.+)/$',\n        DeleteContainerOrExtract.as_view(),\n        name='delete'),\n    url(r'^supprimer/(?P<pk>\\d+)/(?P<slug>.+)/(?P<container_slug>.+)/(?P<object_slug>.+)/$',\n        DeleteContainerOrExtract.as_view(),\n        name='delete'),\n    url(r'^supprimer/(?P<pk>\\d+)/(?P<slug>.+)/(?P<object_slug>.+)/$',\n        DeleteContainerOrExtract.as_view(),\n        name='delete'),\n\n    url(r'^supprimer/(?P<pk>\\d+)/(?P<slug>.+)/$', DeleteContent.as_view(), name='delete'),\n\n    # markdown import\n    url(r'^importer/archive/nouveau/$', CreateContentFromArchive.as_view(), name=\"import-new\"),\n    url(r'^importer/(?P<pk>\\d+)/(?P<slug>.+)/$', UpdateContentWithArchive.as_view(), name=\"import\"),\n\n    # tags\n    url(r'^tags/$', TagsListView.as_view(), name='tags'),\n\n    url(r'^$', ListOnlineContents.as_view(), name='list'),\n]\n", "path": "zds/tutorialv2/urls/urls_contents.py"}, {"content": "# coding: utf-8\n\nfrom django.contrib.syndication.views import Feed\nfrom django.conf import settings\n\nfrom django.utils.feedgenerator import Atom1Feed\n\nfrom zds.tutorialv2.models.models_database import PublishedContent\nfrom zds.settings import ZDS_APP\n\n\nclass LastContentFeedRSS(Feed):\n    \"\"\"\n    RSS feed for any type of content.\n    \"\"\"\n    title = u\"Contenus sur {}\".format(settings.ZDS_APP['site']['litteral_name'])\n    description = u\"Les derniers contenus parus sur {}.\".format(settings.ZDS_APP['site']['litteral_name'])\n    link = \"\"\n    content_type = None\n\n    def items(self):\n        \"\"\"\n        :return: The last (typically 5) contents (sorted by publication date).\n        If `self.type` is not `None`, the contents will only be of this type.\n        \"\"\"\n        contents = PublishedContent.objects\\\n            .prefetch_related(\"content\")\\\n            .prefetch_related(\"content__authors\")\n\n        if self.content_type is not None:\n            contents = contents.filter(content_type=self.content_type)\n\n        return contents.order_by('-publication_date')[:ZDS_APP['content']['feed_length']]\n\n    def item_title(self, item):\n        return item.content.title\n\n    def item_pubdate(self, item):\n        return item.publication_date\n\n    def item_description(self, item):\n        return item.content.description\n\n    def item_author_name(self, item):\n        authors_list = item.content.authors.all()\n        authors = []\n        for authors_obj in authors_list:\n            authors.append(authors_obj.username)\n        authors = \", \".join(authors)\n        return authors\n\n    def item_link(self, item):\n        return item.get_absolute_url_online()\n\n\nclass LastContentFeedATOM(LastContentFeedRSS):\n    feed_type = Atom1Feed\n    subtitle = LastContentFeedRSS.description\n\n\nclass LastTutorialsFeedRSS(LastContentFeedRSS):\n    \"\"\"\n    Redefinition of `LastContentFeedRSS` for tutorials only\n    \"\"\"\n    content_type = \"TUTORIAL\"\n    link = \"/tutoriels/\"\n    title = u\"Tutoriels sur {}\".format(settings.ZDS_APP['site']['litteral_name'])\n    description = u\"Les derniers tutoriels parus sur {}.\".format(settings.ZDS_APP['site']['litteral_name'])\n\n\nclass LastTutorialsFeedATOM(LastTutorialsFeedRSS):\n    feed_type = Atom1Feed\n    subtitle = LastTutorialsFeedRSS.description\n\n\nclass LastArticlesFeedRSS(LastContentFeedRSS):\n    \"\"\"\n    Redefinition of `LastContentFeedRSS` for articles only\n    \"\"\"\n    content_type = \"ARTICLE\"\n    link = \"/articles/\"\n    title = u\"Articles sur {}\".format(settings.ZDS_APP['site']['litteral_name'])\n    description = u\"Les derniers articles parus sur {}.\".format(settings.ZDS_APP['site']['litteral_name'])\n\n\nclass LastArticlesFeedATOM(LastArticlesFeedRSS):\n    feed_type = Atom1Feed\n    subtitle = LastArticlesFeedRSS.description\n", "path": "zds/tutorialv2/feeds.py"}]}