Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passage à Django 1.8 #3331

Merged
merged 34 commits into from
Feb 24, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
9ce0d1b
Model._meta.module_name --> Model._meta.model_name
SpaceFox Apr 14, 2015
c732cc4
Suppression du module inutilisé "django.contrib.sites"
SpaceFox Apr 14, 2015
2478e52
Django 1.8: Déclarer le dossier de fixtures par défaut lance une erreur
SpaceFox Apr 14, 2015
d4fb78b
Suppression d'une relation erronée
SpaceFox Apr 14, 2015
1eb0c56
Utilisation d'une API privée qui a changée de package
SpaceFox Apr 14, 2015
2b14c6a
Passage à Django 1.8 minimal (il reste plein de warnings mais ça marche)
SpaceFox Apr 14, 2015
59b088b
Une relation N..M nullable n'a pas de sens
SpaceFox Apr 14, 2015
1e4deaf
RedirectView.permanent va changer de valeur --> on la fixe
SpaceFox Apr 14, 2015
bd1166d
django.utils.tzinfo est obsolète, remplacé par django.utils.timezone
SpaceFox Apr 14, 2015
39b67bc
refactor(url): Utilisation nouvelle syntaxe dans les URLs.
gustavi Dec 7, 2015
b726b9b
refactor(1.8): Changement de l'import csrf.
gustavi Dec 7, 2015
08e930d
Correction d'un import
gustavi Dec 8, 2015
d390a62
refactor(settings): Change la gestion des templates.
gustavi Dec 7, 2015
9a0e6af
corrige les erreurs de tutorialv2 et munin
artragis Dec 11, 2015
842b178
règle la migration et les avertissements de template du forum
artragis Dec 16, 2015
4919d30
refactor(form): Retire les warnings sur les forms.
artragis Dec 16, 2015
46187ee
refactor(migration): Supprime les migrations des vieux modules.
artragis Nov 11, 2015
3341ebd
chore(dep): Mise a jour de django-debug-toolbar de 1.3.0 a 1.4.
gustavi Dec 2, 2015
123c2e5
chore(dep): Mise a jour de django-rest-swagger de 0.2.9 a 0.3..0.
GerardPaligot Feb 18, 2016
c49224e
chore(dep): Mise a jour de django_model_utils de 2.4 a 2.4.
GerardPaligot Feb 18, 2016
0330427
chore(dep): Mise a jour de django-oauth-toolkit de 0.9.0 a 0.10.0.
gustavi Dec 7, 2015
abdba4f
chore(dep): Mise a jour de django-munin de 0.2.0 a 0.2.1.
gustavi Jan 7, 2016
2392ecf
chore(dep): Mise a jour de django-crispy-forms de 1.5.2 a 1.6.0.
artragis Nov 11, 2015
3951bb8
chore(dep): Mise a jour de django-filter de 0.9.2 a 0.12.
GerardPaligot Feb 18, 2016
821e366
chore(dep): Mise a jour de pillow de 2.9 a 3.1.1.
GerardPaligot Feb 17, 2016
addf026
chore(dep): Mise a jour de DRF de 3.3.1 a 3.3.2.
GerardPaligot Feb 18, 2016
6f78d62
Regle le soucis pour Travis et MySQL (merci @DevHugo)
gustavi Jan 8, 2016
bea004d
Ajout des informations pour la mise en prod de la v17
gustavi Jan 16, 2016
2cadc74
chore(dep): Mise a jour de django de 1.7.10 a 1.8.9.
artragis Nov 12, 2015
451e322
chore(dep): Mise a jour de coverage de 4.0.1 a 4.0.3.
GerardPaligot Feb 19, 2016
89ac99a
chore(dep): Mise a jour de cairosvg de 1.0.13 a 1.0.19.
GerardPaligot Feb 19, 2016
377f5ed
chore(dep): Mise a jour de beautifulsoup4 de 4.3.2 a 4.4.1.
GerardPaligot Feb 19, 2016
d9c1c85
chore(dep): Mise a jour de djangorestframework-xml de 1.0.1 a 1.3.0.
GerardPaligot Feb 19, 2016
32741f3
chore(dep): Mise a jour de factory-boy de 2.4.1 a 2.6.1.
GerardPaligot Feb 19, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Tous les détails sur le workflow se trouvent [sur la page dédiée](http://zds-
| Nouvelle Fonctionnalité ? | [oui|non]
| Tickets (_issues_) concernés | [Liste de tickets séparés par des virgules]
```
* Ajoutez des notes de QA (Quality Assurance). Ces notes doivent permettent à un testeur de comprendre ce que vous avez modifié, ce qu'il faut tester en priorité et les pièges auxquels il doit s'attendre et donc sur lesquels porter une attention particulière. Précisez tout particulièrement s'il est nécessaire d'effectuer une action de gestion préalable, comme `python manage.py migrate`, `python manage.py loaddata fixture/*.yaml` ou `npm run gulp -- build`.
* Ajoutez des notes de QA (Quality Assurance). Ces notes doivent permettent à un testeur de comprendre ce que vous avez modifié, ce qu'il faut tester en priorité et les pièges auxquels il doit s'attendre et donc sur lesquels porter une attention particulière. Précisez tout particulièrement s'il est nécessaire d'effectuer une action de gestion préalable, comme `python manage.py migrate --fake-initial`, `python manage.py loaddata fixture/*.yaml` ou `npm run gulp -- build`.

## Les commits
* Pour les commits, nous suivons le même ordre d'idée des standards Git, à savoir :
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Après avoir mis à jour votre dépôt, vous devez exécuter les commandes suiva

```console
pip install --upgrade -r requirements.txt -r requirements-dev.txt
python manage.py migrate
python manage.py migrate --fake-initial
```


Expand Down
2 changes: 1 addition & 1 deletion doc/source/back-end-code/arborescence-back.rst
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ Cela permettra aux autres développeurs de répercuter les modifications en util

.. sourcecode:: bash

python manage.py migrate
python manage.py migrate --fake-initial


API
Expand Down
2 changes: 1 addition & 1 deletion doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Documentation de Zeste De Savoir
================================

Zeste de Savoir est un site internet communautaire codé à l'aide du framework Django 1.7 et de Python 2.7
Zeste de Savoir est un site internet communautaire codé à l'aide du framework Django 1.8 et de Python 2.7

`Voir l'instance en ligne <https://zestedesavoir.com>`_

Expand Down
2 changes: 1 addition & 1 deletion doc/source/utils/git-pre-hook.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ restera propre et lisible au cours du temps !

#!/bin/sh

flake8 --exclude=migrations,urls.py,settings.py --max-line-length=120 zds
flake8 --exclude=migrations,settings.py --max-line-length=120 zds

# Store tests result
RESULT=$?
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "zds-site",
"version": "0.2.0",
"description": "Site internet communautaire codé à l'aide du Framework Django 1.7",
"description": "Site internet communautaire codé à l'aide du Framework Django 1.8",
"directories": {
"doc": "doc"
},
Expand Down
7 changes: 4 additions & 3 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
coverage==4.0.3
PyYAML==3.11
django-debug-toolbar==1.3.0
django-debug-toolbar==1.4
flake8==2.4.0
autopep8==1.1.1
sphinx==1.3.1
sphinx_rtd_theme==0.1.8
sphinx==1.2.3
sphinx_rtd_theme==0.1.6
fake-factory==0.5.0
mock
31 changes: 15 additions & 16 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,31 @@ pygments==2.0.2
python-social-auth==0.2.9

# Explicit dependencies (references in code)
django==1.7.10
coverage==4.0.1
django-crispy-forms==1.4.0
Django==1.8.9
django-crispy-forms==1.6.0
django-haystack==2.4.1
django-model-utils==2.2
django-munin==0.2.0
django-model-utils==2.4
django-munin==0.2.1
python-memcached==1.54
lxml==3.4.4
factory-boy==2.4.1
factory-boy==2.6.1
pygeoip==0.3.2
pillow==2.9.0
pillow==3.1.1
gitpython==1.0.1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

version 1.0.2 (il semble même que c'est un de nos commit qui est en jeu sur cette dep)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

attention à la version 1.0.2 de gitpython, j'ai vu passer des regression sur leur dépot. Je regarderai ça de plus près pour voir en quoi c'est impactant

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On va éviter pour le moment alors.

https://github.com/zestedesavoir/Python-ZMarkdown/archive/2.6.0-zds.7.zip
easy-thumbnails==2.2
CairoSVG==1.0.13
beautifulsoup4==4.3.2
CairoSVG==1.0.19
beautifulsoup4==4.4.1
django-recaptcha==1.0.4
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bs4 est à passer en version 4.4.1
cairosvg en 1.0.19

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.


# Api dependencies
djangorestframework==3.1.1
djangorestframework-xml==1.0.1
django-filter==0.9.2
django-oauth-toolkit==0.9.0
drf-extensions==0.2.7
django-rest-swagger==0.2.9
django-cors-headers==1.0.0
djangorestframework==3.3.2
djangorestframework-xml==1.3.0
django-filter==0.12
django-oauth-toolkit==0.10.0
drf-extensions==0.2.8
django-rest-swagger==0.3.4
django-cors-middleware==1.2.0
dry-rest-permissions==0.1.6

# Zep 12 dependency
Expand Down
2 changes: 1 addition & 1 deletion scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ cd /opt/zdsenv/ZesteDeSavoir/
# Maintenance mode
sudo rm /etc/nginx/sites-enabled/zestedesavoir
sudo ln -s /etc/nginx/sites-available/zds-maintenance /etc/nginx/sites-enabled/zds-maintenance
sudo systemctl reload nginx.service
sudo service nginx reload
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Euh, pourquoi ?

Même si techniquement, ça marche, puisque systemd ship avec une couche de compat SysVinit, je comprend pas cette modif, sachant qu'il a jamais été question d'être compatible avec tous les systèmes, dont ceux qui sont pas sous systemd.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je ne sais pas le pourquoi, mais cette modif n'a pas lieu d'être. À supprimer.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


# Delete old branch if exists
git checkout prod
Expand Down
32 changes: 16 additions & 16 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
<link rel="alternate" type="application/rss+xml" title="Nouveaux articles (RSS)" href="{% url "article:feed-rss" %}">
<link rel="alternate" type="application/atom+xml" title="Nouveaux articles (ATOM)" href="{% url "article:feed-atom" %}">
{# OpenSearch plugin autodiscovery #}
<link rel="search" type="application/opensearchdescription+xml" title="{{ app.site.litteral_name }}" href="{% url "zds.search.views.opensearch" %}">
<link rel="search" type="application/opensearchdescription+xml" title="{{ app.site.litteral_name }}" href="{% url "search-opensearch" %}">
</head>

{% if not user.is_authenticated or user.profile.allow_temp_visual_changes %}
Expand Down Expand Up @@ -162,7 +162,7 @@

{# Logo #}
<div class="header-logo">
<a href="{% url "zds.pages.views.home" %}"
<a href="{% url "homepage" %}"
class="header-logo-link"
data-title="{{ mobiletitle }}"
>
Expand Down Expand Up @@ -294,7 +294,7 @@
{% for topic in unread_topics %}
{% with last_answer=topic.get_last_answer %}
<li>
{% if last_answer = None %}
{% if last_answer == None %}
{% set topic.last_read_post as last_answer %}
{% endif %}
<a href="{{ topic.last_read_post.get_absolute_url }}">
Expand All @@ -309,7 +309,7 @@
{% endwith %}
{% endfor %}

{% if total_topics = 0 %}
{% if total_topics == 0 %}
<li class="dropdown-empty-message">
{% trans "Aucun nouveau message" %}
</li>
Expand All @@ -327,7 +327,7 @@
{# NOTIFICATIONS #}
<div>
{% with unread_posts=user|interventions_topics %}
<a href="{% url "zds.forum.views.followed_topics" %}" class="ico-link">
<a href="{% url "forum-followed-topics" %}" class="ico-link">
{% if unread_posts|length > 0 %}
<span class="notif-count">{{ unread_posts|length }}</span>
{% endif %}
Expand Down Expand Up @@ -357,7 +357,7 @@
</li>
{% endif %}
</ul>
<a href="{% url "zds.forum.views.followed_topics" %}" class="dropdown-link-all">
<a href="{% url "forum-followed-topics" %}" class="dropdown-link-all">
{% trans "Toutes les notifications" %}
</a>
</div>
Expand All @@ -368,7 +368,7 @@
{% if perms.forum.change_post %}
{% with alerts_list=user|alerts_list %}
<div>
<a href="{% url "zds.pages.views.alerts" %}" class="ico-link">
<a href="{% url "pages-alerts" %}" class="ico-link">
<span class="notif-text ico ico-alerts">{% trans "Alertes" %}</span>
{% if alerts_list.nb_alerts > 0 %}
<span class="notif-count">{{ alerts_list.nb_alerts }}</span>
Expand All @@ -392,7 +392,7 @@
</li>
{% endfor %}
</ul>
<a href="{% url "zds.pages.views.alerts" %}" class="dropdown-link-all">
<a href="{% url "pages-alerts" %}" class="dropdown-link-all">
{% trans "Toutes les alertes" %}
</a>
</div>
Expand Down Expand Up @@ -463,7 +463,7 @@
<li>
<form
method="post"
action="{% url "zds.member.views.logout_view" %}"
action="{% url "member-logout" %}"
>
{% csrf_token %}
<button type="submit">{% trans "Déconnexion" %}</button>
Expand All @@ -475,7 +475,7 @@
</div>

{% else %} {# Not logged #}
<a href="{% url "zds.member.views.login_view" %}?next={{ request.path }}">{% trans "Connexion" %}</a>
<a href="{% url "member-login" %}?next={{ request.path }}">{% trans "Connexion" %}</a>
<a href="{% url "register-member" %}">{% trans "Inscription" %}</a>
{% endif %}
</div>
Expand All @@ -487,7 +487,7 @@
<div class="breadcrumb" itemprop="breadcrumb">
<ol>
<li>
<a href="{% url "zds.pages.views.home" %}" rel="home" itemprop="url">
<a href="{% url "homepage" %}" rel="home" itemprop="url">
<span itemprop="title">{% trans "Accueil" %}</span>
</a>
</li>
Expand Down Expand Up @@ -573,15 +573,15 @@ <h2 class="subtitle" {% if schema %}itemprop="description"{% endif %}>{{ headlin

<ul class="links">
<li><a href="{% url "django.swagger.base.view" %}">{% trans "API" %}</a></li>
<li><a href="{% url "zds.pages.views.eula" %}">{% trans "CGU" %}</a></li>
<li><a href="{% url "zds.pages.views.about" %}">{% trans "À propos" %}</a></li>
<li><a href="{% url "pages-eula" %}">{% trans "CGU" %}</a></li>
<li><a href="{% url "pages-about" %}">{% trans "À propos" %}</a></li>
{% if app.site.association %}
<li><a href="{% url "zds.pages.views.association" %}">{% trans "L'association" %}</a></li>
<li><a href="{% url "pages-association" %}">{% trans "L'association" %}</a></li>
{% if user.is_authenticated %}
<li><a href="{% url "zds.pages.views.assoc_subscribe" %}">{% trans "Adhérer" %}</a></li>
<li><a href="{% url "pages-assoc-subscribe" %}">{% trans "Adhérer" %}</a></li>
{% endif %}
{% endif %}
<li><a href="{% url "zds.pages.views.contact" %}">{% trans "Contact" %}</a></li>
<li><a href="{% url "pages-contact" %}">{% trans "Contact" %}</a></li>
</ul>
</div>
</footer>
Expand Down
9 changes: 9 additions & 0 deletions templates/bootstrap/layout/buttonholder.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{% comment %}
THIS IS A TEMP FIX FOR DJANGO-CRISPY-FORM, please remove it when
https://github.com/maraujop/django-crispy-forms/pull/551 will be merged and include in a release
{% endcomment %}

<div {% if buttonholder.css_id %}id="{{ buttonholder.css_id }}"{% endif %}
class="buttonHolder{% if buttonholder.css_class %} {{ buttonholder.css_class }}{% endif %}">
{{ fields_output|safe }}
</div>
2 changes: 1 addition & 1 deletion templates/forum/post/new.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
{% endcaptureas %}

{% captureas alert_solve_link %}
{% url "zds.forum.views.solve_alert" %}
{% url "forum-solve-alert" %}
{% endcaptureas %}

{% include "misc/message.part.html" with perms_change=perms.forum.change_topic %}
Expand Down
4 changes: 2 additions & 2 deletions templates/forum/topic/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
{% endcaptureas %}

{% captureas alert_solve_link %}
{% url "zds.forum.views.solve_alert" %}
{% url "forum-solve-alert" %}
{% endcaptureas %}

{% captureas unread_link %}
Expand All @@ -106,7 +106,7 @@
{% set False as is_repeated_message %}
{% endif %}

{% if forloop.first and page_obj.number = 1 %}
{% if forloop.first and page_obj.number == 1 %}
{% set False as answer_schema %}
{% else %}
{% set True as answer_schema %}
Expand Down
2 changes: 1 addition & 1 deletion templates/forum/topic/new.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@


{% block content %}
<div data-solved-topics-url="{% url "zds.forum.views.complete_topic" %}">
<div data-solved-topics-url="{% url "forum-complete-topic" %}">
{% crispy form %}
</div>

Expand Down
2 changes: 1 addition & 1 deletion templates/gallery/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ <h3>{% trans "Actions" %}</h3>
<a href="#delete-galleries" class="open-modal ico-after cross red">
{% trans "Supprimer la galerie" %}
</a>
<form action="{% url "zds.gallery.views.modify_gallery" %}" method="post" id="delete-galleries" class="modal modal-flex">
<form action="{% url "gallery-modify" %}" method="post" id="delete-galleries" class="modal modal-flex">
<label for="items" class="checkbox">
<input
name="items"
Expand Down
4 changes: 2 additions & 2 deletions templates/gallery/gallery/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
{% endfor %}
</div>

{% if galleries|length = 0 %}
{% if galleries|length == 0 %}
<p>
{% trans "Vous n'avez pas encore de galerie" %}. <br>
<a href="{% url "gallery-new" %}">{% trans "Créer une galerie" %}</a>.
Expand All @@ -92,7 +92,7 @@ <h3>{% trans "Actions" %}</h3>
{% trans "Supprimer les galeries sélectionnées" %}
</a>

<form action="{% url "zds.gallery.views.modify_gallery" %}" method="post" id="delete-galleries" class="modal modal-flex">
<form action="{% url "gallery-modify" %}" method="post" id="delete-galleries" class="modal modal-flex">
<p>
{% trans "Attention, vous vous appretez à supprimer toutes les galeries sélectionnées" %}.
</p>
Expand Down
2 changes: 1 addition & 1 deletion templates/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
{% url 'article:list' as url_articles %}
{% url 'cats-forums-list' as url_forums %}

{% url 'zds.pages.views.association' as url_association %}
{% url 'pages-association' as url_association %}

<section class="home-header">
<div class="home-wrapper">
Expand Down
2 changes: 1 addition & 1 deletion templates/member/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<h2>{% trans "Connexion classique" %}</h2>
{% crispy form %}
<p>
<a href="{% url "zds.member.views.forgot_password" %}">
<a href="{% url "member-forgot-password" %}">
{% trans "Mot de passe oublié ?" %}
</a>
</p>
Expand Down
2 changes: 1 addition & 1 deletion templates/member/new_password/failed.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
{% trans "Votre mot de passe n'a pas pu être modifié. A partir du moment où vous soumettez votre requête pour réinitialiser votre mot de passe, vous n'avez qu'une heure pour la confirmer" %}.
</p>
<p>
<a href="{% url "zds.member.views.forgot_password" %}">{% trans "Re-soumettre votre demande de réinitialisation" %}</a>.
<a href="{% url "member-forgot-password" %}">{% trans "Re-soumettre votre demande de réinitialisation" %}</a>.
</p>
{% endblock %}
2 changes: 1 addition & 1 deletion templates/member/new_password/success.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@

{% block content %}
<p>
{% trans "Votre mot de passe a bien été modifié, vous pouvez dès maintenant" %} <a href="{% url "zds.member.views.login_view" %}">{% trans "vous connecter" %}</a>.
{% trans "Votre mot de passe a bien été modifié, vous pouvez dès maintenant" %} <a href="{% url "member-login" %}">{% trans "vous connecter" %}</a>.
</p>
{% endblock %}
Loading