Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Maxime Bombar
Note Kfet 2015 django
Commits
8d3d5f76
Commit
8d3d5f76
authored
Aug 20, 2017
by
Charlie Jacomme
Browse files
Stertchtisation de la note
parent
87710f05
Changes
16
Hide whitespace changes
Inline
Side-by-side
manage.py
View file @
8d3d5f76
...
...
@@ -2,19 +2,25 @@
# -*- encoding: utf-8 -*-
import
os
import
sys
# À partir de Django 1.7, on doit faire le setup si on veut pouvoir
# importer les modules avant d'avoir chargé toutes les apps
# Et on a besoin de connaître le nom du module settings pour cela
import
django
os
.
environ
[
"DJANGO_SETTINGS_MODULE"
]
=
"note.settings"
django
.
setup
()
if
__name__
==
"__main__"
:
os
.
environ
.
setdefault
(
"DJANGO_SETTINGS_MODULE"
,
"note.settings"
)
from
django.core.management
import
execute_from_command_line
try
:
from
django.core.management
import
execute_from_command_line
except
ImportError
:
# The above import may fail for some other reason. Ensure that the
# issue is really that Django is missing to avoid masking other
# exceptions on Python 2.
try
:
import
django
except
ImportError
:
raise
ImportError
(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
)
raise
execute_from_command_line
(
sys
.
argv
)
note/settings.py
View file @
8d3d5f76
...
...
@@ -24,8 +24,6 @@ else:
DEFAULT_CHARSET
=
"utf-8"
#: Mode de debug
DEBUG
=
not
PROD
#: Debug aussi quand on plante dans le rendering d'un template
TEMPLATE_DEBUG
=
DEBUG
#: Adresse mail à qui envoyer des problèmes durant l'exécution
...
...
@@ -129,11 +127,11 @@ MEDIA_URL = os.path.join(NOTE_ROOT_URL, 'media/')
#: URL prefix for static files.
#: Example: "http://media.lawrence.com/static/"
STATIC_URL
=
'/static/'
STATIC_URL
=
r
'/static/'
#: Additional locations of static files
STATICFILES_DIRS
=
(
ROOT_PATH
+
"
static/
"
,
os
.
path
.
join
(
PROJECT_PATH
,
'../
static/
'
)
,
# Put strings here, like "/home/html/static" or "C:/www/django/static".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
...
...
@@ -150,24 +148,20 @@ STATICFILES_FINDERS = (
from
secrets
import
SECRET_KEY
#: List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS
=
(
'django.template.loaders.filesystem.Loader'
,
'django.template.loaders.app_directories.Loader'
,
# 'django.template.loaders.eggs.Loader',
)
#: A tuple of callables that are used to populate the context in RequestContext.
#: These callables take a request object as their argument
#: and return a dictionary of items to be merged into the context.
TEMPLATE_CONTEXT_PROCESSORS
=
(
"django.contrib.auth.context_processors.auth"
,
"django.core.context_processors.debug"
,
"django.core.context_processors.i18n"
,
"django.core.context_processors.media"
,
"django.core.context_processors.static"
,
"django.core.context_processors.request"
,
"django.contrib.messages.context_processors.messages"
)
TEMPLATES
=
[{
'BACKEND'
:
'django.template.backends.django.DjangoTemplates'
,
'DIRS'
:
[
'templates'
],
'APP_DIRS'
:
True
,
'OPTIONS'
:
{
'context_processors'
:
[
'django.template.context_processors.debug'
,
'django.template.context_processors.request'
,
'django.contrib.auth.context_processors.auth'
,
'django.contrib.messages.context_processors.messages'
,
],
},
}]
#: A tuple of middleware classes to use. See `Middleware <https://docs.djangoproject.com/en/dev/topics/http/middleware/>`_.
MIDDLEWARE_CLASSES
=
(
...
...
@@ -190,15 +184,9 @@ MIDDLEWARE_CLASSES = (
ROOT_URLCONF
=
'urls'
#: Python dotted path to the WSGI application used by Django's runserver.
WSGI_APPLICATION
=
'..wsgi.application'
WSGI_APPLICATION
=
'note.wsgi.application'
#: List of locations of the template source files searched by django.template.loaders.filesystem.Loader, in search order.
TEMPLATE_DIRS
=
(
ROOT_PATH
+
"note/templates/"
,
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
)
#: A tuple of strings designating all applications that are enabled in this Django installation.
#: Each string should be a full Python path to a Python package that contains a Django application,
...
...
note/templates/handler_base.html
View file @
8d3d5f76
{% load note_templatetags %}
{% load i18n %}
{% load static %}
<!DOCTYPE html>
{% get_current_language as LANGUAGE_CODE %}
...
...
@@ -10,8 +11,8 @@
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
>
{% block stylesheets %}
<link
rel=
"stylesheet"
href=
"{
{ STATIC_URL }}
css/bootstrap.css"
/>
<link
rel=
"stylesheet"
href=
"{
{ STATIC_URL }}
css/custom/note-bootstrap.css"
/>
<link
rel=
"stylesheet"
href=
"{
% static '
css/bootstrap.css
' %}
"
/>
<link
rel=
"stylesheet"
href=
"{
% static '
css/custom/note-bootstrap.css
' %}
"
/>
<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
...
...
@@ -97,8 +98,8 @@
<!-- Le javascript
========================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script
src=
"{
{ STATIC_URL }}
js/jquery.js"
></script>
<script
src=
"{
{ STATIC_URL }}
js/bootstrap.js"
></script>
<script
src=
"{
% static '
js/jquery.js
' %}
"
></script>
<script
src=
"{
% static '
js/bootstrap.js
' %}
"
></script>
<script>
/* On peut avoir besoin de ces variables n'importe où dans le Javascript */
var
NOTE_ROOT_URL
=
{{
NOTE_ROOT_URL
}};
...
...
note/templates/note/base.html
View file @
8d3d5f76
{% load note_templatetags %}
{% load i18n %}
{% load static %}
<!DOCTYPE html>
{% get_current_language as LANGUAGE_CODE %}
<html
lang=
"{{ LANGUAGE_CODE }}"
>
...
...
@@ -10,8 +10,8 @@
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
>
{% block stylesheets %}
<link
rel=
"stylesheet"
href=
"{
{ STATIC_URL }}
css/bootstrap.css"
/>
<link
rel=
"stylesheet"
href=
"{
{ STATIC_URL }}
css/custom/note-bootstrap.css"
/>
<link
rel=
"stylesheet"
href=
"{
% static '
css/bootstrap.css
' %}
"
/>
<link
rel=
"stylesheet"
href=
"{
% static '
css/custom/note-bootstrap.css
' %}
"
/>
<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
...
...
@@ -102,12 +102,12 @@
========================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script
type=
"text/javascript"
src=
"{% url 'javascript_catalog' %}"
></script>
<script
src=
"{
{ STATIC_URL }}
js/jquery.js"
></script>
<script
src=
"{
{ STATIC_URL }}
js/bootstrap.js"
></script>
<script
src=
"{
% static '
js/jquery.js
' %}
"
></script>
<script
src=
"{
% static '
js/bootstrap.js
' %}
"
></script>
<script>
/* On peut avoir besoin de ces variables n'importe où dans le Javascript */
var
NOTE_ROOT_URL
=
{{
NOTE_ROOT_URL
}};
var
STATIC_URL
=
{{
STATIC_URL
}}
;
var
STATIC_URL
=
/static/
;
/* Responsiveness des onglets de la note*/
...
...
note/templates/note/boutons.html
View file @
8d3d5f76
{% extends "note/base.html" %}
{% load note_templatetags %}
{% load i18n %}
{% load static %}
{% block title %}{% trans "Gestion des boutons" %}{% endblock %}
{% block additional_javascript %}
<script
src=
"{
{ STATIC_URL }}
js/custom/getXMLHttpRequest.js"
></script>
<script
src=
"{
{ STATIC_URL }}
js/custom/boutons_dynamiques.js"
></script>
<script
src=
"{
% static '
js/custom/getXMLHttpRequest.js
' %}
"
></script>
<script
src=
"{
% static '
js/custom/boutons_dynamiques.js
' %}
"
></script>
{% endblock %}
{% block applets %}
<li
role=
"presentation"
,
class=
"active"
><a
href=
"{{ NOTE_ROOT_URL }}boutons/"
>
{% trans "Boutons" %}
</a></li>
...
...
note/templates/note/compte.html
View file @
8d3d5f76
{% extends "note/base.html" %}
{% load i18n %}
{% load static %}
{# Pour ne pas utiliser la taille par défaut de la page #}
...
...
note/templates/note/comptes.html
View file @
8d3d5f76
{% extends "note/base.html" %}
{% load i18n %}
{% load static %}
{% block title %}{% trans "Comptes" %}{% endblock %}
{% block additional_javascript %}
<script
src=
"{
{ STATIC_URL }}
js/custom/getXMLHttpRequest.js"
></script>
<script
src=
"{
{ STATIC_URL }}
js/custom/liste_dynamique_search.js"
></script>
<script
src=
"{
% static '
js/custom/getXMLHttpRequest.js
' %}
"
></script>
<script
src=
"{
% static '
js/custom/liste_dynamique_search.js
' %}
"
></script>
{% endblock %}
{% block applets %}
<li
role=
"presentation"
class=
"active"
><a
href=
"{{ NOTE_ROOT_URL }}comptes/"
>
{% trans "Recherche" %}
</a></li>
...
...
note/templates/note/consos.html
View file @
8d3d5f76
{% extends "note/base.html" %}
{% load note_templatetags %}
{% load i18n %}
{% load static %}
{% block title %}{% trans "Consos" %}{% endblock %}
{% block additional_javascript %}
<script
src=
"{
{ STATIC_URL }}
js/custom/getXMLHttpRequest.js"
></script>
<script
src=
"{
{ STATIC_URL }}
js/custom/liste_dynamique_quick.js"
></script>
<script
src=
"{
% static '
js/custom/getXMLHttpRequest.js
' %}
"
></script>
<script
src=
"{
% static '
js/custom/liste_dynamique_quick.js
' %}
"
></script>
<!--Attention, intervertir les deux lignes qui suivent provoque l'apocalypse-->
<script
src=
"{
{ STATIC_URL }}
js/custom/consos_double_stack.js"
></script>
<script
src=
"{
{ STATIC_URL }}
js/custom/consos_single_stack.js"
></script>
<script
src=
"{
{ STATIC_URL }}
js/custom/consos_base.js"
></script>
<script
src=
"{
{ STATIC_URL }}
js/custom/tabs.js"
></script>
<script
src=
"{
{ STATIC_URL }}
js/custom/toggle_transactions.js"
></script>
<script
src=
"{
% static '
js/custom/consos_double_stack.js
' %}
"
></script>
<script
src=
"{
% static '
js/custom/consos_single_stack.js
' %}
"
></script>
<script
src=
"{
% static '
js/custom/consos_base.js
' %}
"
></script>
<script
src=
"{
% static '
js/custom/tabs.js
' %}
"
></script>
<script
src=
"{
% static '
js/custom/toggle_transactions.js
' %}
"
></script>
{% endblock %}
{% block applets %}
...
...
note/templates/note/dons.html
View file @
8d3d5f76
{% extends "note/base.html" %}
{% load note_templatetags %}
{% load i18n %}
{% load static %}
{% block title %}{% trans "Virements" %}{% endblock %}
{% block additional_javascript %}
<script
src=
"{
{ STATIC_URL }}
js/custom/getXMLHttpRequest.js"
></script>
<script
src=
"{
{ STATIC_URL }}
js/custom/liste_dynamique_quick.js"
></script>
<script
src=
"{
{ STATIC_URL }}
js/custom/consos_single_stack.js"
></script>
<script
src=
"{
{ STATIC_URL }}
js/custom/consos_base.js"
></script>
<script
src=
"{
% static '
js/custom/getXMLHttpRequest.js
' %}
"
></script>
<script
src=
"{
% static '
js/custom/liste_dynamique_quick.js
' %}
"
></script>
<script
src=
"{
% static '
js/custom/consos_single_stack.js
' %}
"
></script>
<script
src=
"{
% static '
js/custom/consos_base.js
' %}
"
></script>
<script>
/* Sur la page de dons, il y a certaines données auxquelles on n'a pas accès (le solde, la photo) */
page_dons
=
true
;
...
...
note/templates/note/invitation.html
View file @
8d3d5f76
{% extends "note/base.html" %}
{% load note_templatetags %}
{% load i18n %}
{% load static %}
{% block title %}{% blocktrans with id=activite.id %}Invitation à l'activité n°{{ id }}{% endblocktrans %}{% endblock %}
{% if isadmin %}
{% block additional_javascript %}
<script
src=
"{
{ STATIC_URL }}
js/custom/getXMLHttpRequest.js"
></script>
<script
src=
"{
{ STATIC_URL }}
js/custom/liste_dynamique_quick.js"
></script>
<script
src=
"{
% static '
js/custom/getXMLHttpRequest.js
' %}
"
></script>
<script
src=
"{
% static '
js/custom/liste_dynamique_quick.js
' %}
"
></script>
<script>
/* fonction appelée à la fin du timer (déclenché sur un onkeyup sur le champ de recherche) */
...
...
note/templates/note/readhesions.html
View file @
8d3d5f76
{% extends "note/base.html" %}
{% load i18n %}
{% load static %}
{% block title %}Comptes{% endblock %}
{% block additional_javascript %}
<script
src=
"{
{ STATIC_URL }}
js/custom/getXMLHttpRequest.js"
></script>
<script
src=
"{
{ STATIC_URL }}
js/custom/liste_dynamique_search.js"
></script>
<script
src=
"{
% static '
js/custom/getXMLHttpRequest.js
' %}
"
></script>
<script
src=
"{
% static '
js/custom/liste_dynamique_search.js
' %}
"
></script>
<script>
var
readhesion
=
true
;
</script>
{% endblock %}
{% block applets %}
...
...
note/templates/note/un_compte_historique.html
View file @
8d3d5f76
{% extends "note/compte.html" %}
{% load i18n %}
{% load static %}
{% block title %}{% blocktrans with idbde=compte.idbde %}Historique des transactions du compte n°{{ idbde }}{% endblocktrans %}{% endblock %}
...
...
@@ -8,6 +9,6 @@
{% endblock %}
{% block additional_javascript %}
<script
src=
"{
{ STATIC_URL }}
js/custom/getXMLHttpRequest.js"
></script>
<script
src=
"{
{ STATIC_URL }}
js/custom/toggle_transactions.js"
></script>
<script
src=
"{
% static '
js/custom/getXMLHttpRequest.js
' %}
"
></script>
<script
src=
"{
% static '
js/custom/toggle_transactions.js
' %}
"
></script>
{% endblock %}
note/urls.py
View file @
8d3d5f76
...
...
@@ -5,93 +5,94 @@
est chargée de générer la page correspondante.
"""
from
django.conf.urls
import
patterns
,
include
,
url
from
django.conf.urls
import
include
,
url
# Import pour la traduction du javascript
from
django.views.i18n
import
javascript_catalog
import
note.views
import
note.ajaj
#: Liste des patterns d'url
urlpatterns
=
patterns
(
'note.views'
,
urlpatterns
=
[
# pages de base
url
(
ur
'^/*$'
,
'login_page'
),
url
(
ur
'^/index/*$'
,
'index'
),
url
(
ur
'^/logout/*$'
,
'logout'
),
url
(
ur
'^/*$'
,
note
.
views
.
login_page
,
name
=
'login_page'
),
url
(
ur
'^/index/*$'
,
note
.
views
.
index
,
name
=
'index'
),
url
(
ur
'^/logout/*$'
,
note
.
views
.
logout
,
name
=
'logout'
),
# Page pour changer la langue
url
(
ur
'^i18n/'
,
include
(
'django.conf.urls.i18n'
)),
# consos
url
(
ur
'^/consos(?P<double>-double)?/*$'
,
'consos'
),
url
(
ur
'^/consos(?P<double>-double)?/*$'
,
note
.
views
.
consos
,
name
=
'consos'
),
# dons
url
(
ur
'^/(?:virements|dons)/*'
,
'dons'
),
url
(
ur
'^/(?:virements|dons)/*'
,
note
.
views
.
dons
,
name
=
'dons'
),
# les activités et invitations
url
(
ur
'^/(?:activite|invitation)s?(?P<admin>/admin)?(?P<old>/old)?/*$'
,
'activites'
),
url
(
ur
'^/(?:activite|invitation)s?/(?P<idact>[^/]*)/gestion(?P<validation>/validate|/invalidate|/delete)?/*$'
,
'activite_gestion'
),
url
(
ur
'^/(?:activite|invitation)s?/(?P<idact>[^/]*)/gestion/modifier/*$'
,
'activite_gestion_modifier'
),
url
(
ur
'^/(?:activite|invitation)s?/(?P<idact>[^/]*)(?P<admin>/admin)?/*$'
,
'activite'
),
url
(
ur
'^/(?:activite|invitation)s?/(?P<idact>[^/]*)/del_invite/(?P<idinv>[^/]*)(?P<admin>/admin)?/*$'
,
'del_invite'
),
url
(
ur
'^/(?:activite|invitation)s?(?P<admin>/admin)?(?P<old>/old)?/*$'
,
note
.
views
.
activites
,
name
=
'activites'
),
url
(
ur
'^/(?:activite|invitation)s?/(?P<idact>[^/]*)/gestion(?P<validation>/validate|/invalidate|/delete)?/*$'
,
note
.
views
.
activite_gestion
,
name
=
'activite_gestion'
),
url
(
ur
'^/(?:activite|invitation)s?/(?P<idact>[^/]*)/gestion/modifier/*$'
,
note
.
views
.
activite_gestion_modifier
,
name
=
'activite_gestion_modifier'
),
url
(
ur
'^/(?:activite|invitation)s?/(?P<idact>[^/]*)(?P<admin>/admin)?/*$'
,
note
.
views
.
activite
,
name
=
'activite'
),
url
(
ur
'^/(?:activite|invitation)s?/(?P<idact>[^/]*)/del_invite/(?P<idinv>[^/]*)(?P<admin>/admin)?/*$'
,
note
.
views
.
del_invite
,
name
=
'del_invite'
),
# mes_activités = création d'activités
url
(
ur
'^/mes_activites(?:/(?P<idact>[^/]*))?(?P<delete>/delete)?/*$'
,
'mes_activites'
),
url
(
ur
'^/mes_activites(?:/(?P<idact>[^/]*))?(?P<delete>/delete)?/*$'
,
note
.
views
.
mes_activites
,
name
=
'mes_activites'
),
# la recherche et gestion des comptes
url
(
ur
'^/comptes_advanced/*$'
,
'comptes_advanced'
),
url
(
ur
'^/search_historique_pseudo/*$'
,
'search_historique_pseudo'
),
url
(
ur
'^/comptes/(?P<idbde>[^/]*)/*$'
,
'comptes'
),
url
(
ur
'^/comptes/(?P<idbde>[^/]*)/historique/(?P<num_page>\d+)/*$'
,
'historique_transactions'
),
url
(
ur
'^/comptes/(?P<idbde>[^/]*)/historique/*$'
,
'historique_transactions'
),
url
(
ur
'^/comptes/(?P<idbde>[^/]*)/modifier(/listedroits)?/*$'
,
'modifier_compte'
),
url
(
ur
'^/comptes/(?P<idbde>[^/]*)/supprimer/*$'
,
'supprimer_compte'
),
url
(
ur
'^/comptes/(?P<idbde>[^/]*)/modifier/password/*$'
,
'password'
),
url
(
ur
'^/comptes/(?P<idbde>[^/]*)/modifier/photo/*$'
,
'update_photo'
),
url
(
ur
'^/comptes/(?P<idbde>[^/]*)/aliases/*$'
,
'aliases'
),
url
(
ur
'^/comptes/(?P<idbde>[^/]*)/aliases/delete(?P<delall>_all)?/(?P<idalias>[^/]*)/*$'
,
'unalias'
),
url
(
ur
'^/comptes/(?P<idbde>[^/]*)/historique_pseudo/*$'
,
'historique_pseudo'
),
url
(
ur
'^/comptes_advanced/*$'
,
note
.
views
.
comptes_advanced
,
name
=
'comptes_advanced'
),
url
(
ur
'^/search_historique_pseudo/*$'
,
note
.
views
.
search_historique_pseudo
,
name
=
'search_historique_pseudo'
),
url
(
ur
'^/comptes/(?P<idbde>[^/]*)/*$'
,
note
.
views
.
comptes
,
name
=
'comptes'
),
url
(
ur
'^/comptes/(?P<idbde>[^/]*)/historique/(?P<num_page>\d+)/*$'
,
note
.
views
.
historique_transactions
,
name
=
'historique_transactions'
),
url
(
ur
'^/comptes/(?P<idbde>[^/]*)/historique/*$'
,
note
.
views
.
historique_transactions
,
name
=
'historique_transactions'
),
url
(
ur
'^/comptes/(?P<idbde>[^/]*)/modifier(/listedroits)?/*$'
,
note
.
views
.
modifier_compte
,
name
=
'modifier_compte'
),
url
(
ur
'^/comptes/(?P<idbde>[^/]*)/supprimer/*$'
,
note
.
views
.
supprimer_compte
,
name
=
'supprimer_compte'
),
url
(
ur
'^/comptes/(?P<idbde>[^/]*)/modifier/password/*$'
,
note
.
views
.
password
,
name
=
'password'
),
url
(
ur
'^/comptes/(?P<idbde>[^/]*)/modifier/photo/*$'
,
note
.
views
.
update_photo
,
name
=
'update_photo'
),
url
(
ur
'^/comptes/(?P<idbde>[^/]*)/aliases/*$'
,
note
.
views
.
aliases
,
name
=
'aliases'
),
url
(
ur
'^/comptes/(?P<idbde>[^/]*)/aliases/delete(?P<delall>_all)?/(?P<idalias>[^/]*)/*$'
,
note
.
views
.
unalias
,
name
=
'unalias'
),
url
(
ur
'^/comptes/(?P<idbde>[^/]*)/historique_pseudo/*$'
,
note
.
views
.
historique_pseudo
,
name
=
'historique_pseudo'
),
#les réadhésions
url
(
ur
'^/readhesions/(?P<idbde>[^/]*)/*$'
,
'readhesions'
),
url
(
ur
'^/readhesions/(?P<idbde>[^/]*)/*$'
,
note
.
views
.
readhesions
,
name
=
'readhesions'
),
# la gestion des boutons
url
(
ur
'^/boutons/*$'
,
'boutons'
),
url
(
ur
'^/boutons/(?P<idbouton>[^/]*)(?P<delete>/delete)?/*$'
,
'boutons'
),
url
(
ur
'^/boutons/*$'
,
note
.
views
.
boutons
,
name
=
'boutons'
),
url
(
ur
'^/boutons/(?P<idbouton>[^/]*)(?P<delete>/delete)?/*$'
,
note
.
views
.
boutons
,
name
=
'boutons'
),
# les préinscription
url
(
ur
'^/preinscriptions?/*$'
,
'preinscriptions'
),
url
(
ur
'^/preinscriptions?/*$'
,
note
.
views
.
preinscriptions
,
name
=
'preinscriptions'
),
# les inscriptions
url
(
ur
'^/inscriptions?(?:/(?P<preid>[^/]*))?(?P<delete>/delete)?/*$'
,
'inscriptions'
),
url
(
ur
'^/inscriptions?(?:/(?P<preid>[^/]*))?(?P<delete>/delete)?/*$'
,
note
.
views
.
inscriptions
,
name
=
'inscriptions'
),
# Application WEI
url
(
ur
'^/wei/*$'
,
'WEIaccueil'
),
url
(
ur
'^/wei/monInscription/*$'
,
'WEImonInscription'
),
url
(
ur
'^/wei/1a/*$'
,
'WEI1A'
),
url
(
ur
'^/wei/vieux/*$'
,
'WEIvieux'
),
url
(
ur
'^/wei/admin/*$'
,
'WEIAdmin'
),
url
(
ur
'^/wei/inscrits/*$'
,
'WEIinscrits'
),
url
(
ur
'^/wei/inscrits/readherer/(?P<idwei>\d+)/*'
,
'WEIreadherer'
),
url
(
ur
'^/wei/inscrits/(?P<idwei>\d+)/*$'
,
'WEIchangeInscription'
),
url
(
ur
'^/wei/inscrits1a/*$'
,
'WEIinscrits1A'
),
url
(
ur
'^/wei/inscrits1a/(?P<idwei>\d+)/*$'
,
'WEIchangeInscription1A'
),
url
(
ur
'^/wei/inscrits1a/adherer/(?P<idwei>\d+)/*$'
,
'WEIcreerCompte1A'
),
url
(
ur
'^/wei/*$'
,
note
.
views
.
WEIaccueil
,
name
=
'WEIaccueil'
),
url
(
ur
'^/wei/monInscription/*$'
,
note
.
views
.
WEImonInscription
,
name
=
'WEImonInscription'
),
url
(
ur
'^/wei/1a/*$'
,
note
.
views
.
WEI1A
,
name
=
'WEI1A'
),
url
(
ur
'^/wei/vieux/*$'
,
note
.
views
.
WEIvieux
,
name
=
'WEIvieux'
),
url
(
ur
'^/wei/admin/*$'
,
note
.
views
.
WEIAdmin
,
name
=
'WEIAdmin'
),
url
(
ur
'^/wei/inscrits/*$'
,
note
.
views
.
WEIinscrits
,
name
=
'WEIinscrits'
),
url
(
ur
'^/wei/inscrits/readherer/(?P<idwei>\d+)/*'
,
note
.
views
.
WEIreadherer
,
name
=
'WEIreadherer'
),
url
(
ur
'^/wei/inscrits/(?P<idwei>\d+)/*$'
,
note
.
views
.
WEIchangeInscription
,
name
=
'WEIchangeInscription'
),
url
(
ur
'^/wei/inscrits1a/*$'
,
note
.
views
.
WEIinscrits1A
,
name
=
'WEIinscrits1A'
),
url
(
ur
'^/wei/inscrits1a/(?P<idwei>\d+)/*$'
,
note
.
views
.
WEIchangeInscription1A
,
name
=
'WEIchangeInscription1A'
),
url
(
ur
'^/wei/inscrits1a/adherer/(?P<idwei>\d+)/*$'
,
note
.
views
.
WEIcreerCompte1A
,
name
=
'WEIcreerCompte1A'
),
# interface trésorerie
url
(
ur
'^/tresorerie/*$'
,
'TresorerieAccueil'
),
url
(
ur
'^/tresorerie/cheques/*$'
,
'TresorerieCheques'
),
url
(
ur
'^/tresorerie/remises/*$'
,
'TresorerieRemises'
),
url
(
ur
'^/tresorerie/(?P<idtransaction>[^/]*)/(?P<action>ajout|delete)/*$'
,
'TresorerieAjoutRemise'
),
url
(
ur
'^/tresorerie/remises/(?P<idremise>[^/]*)?(?P<clore>/clore)?/*$'
,
'TresorerieCloreRemise'
),
url
(
ur
'^/tresorerie/facturation/*$'
,
'TresorerieFacturation'
),
url
(
ur
'^/tresorerie/*$'
,
note
.
views
.
TresorerieAccueil
,
name
=
'TresorerieAccueil'
),
url
(
ur
'^/tresorerie/cheques/*$'
,
note
.
views
.
TresorerieCheques
,
name
=
'TresorerieCheques'
),
url
(
ur
'^/tresorerie/remises/*$'
,
note
.
views
.
TresorerieRemises
,
name
=
'TresorerieRemises'
),
url
(
ur
'^/tresorerie/(?P<idtransaction>[^/]*)/(?P<action>ajout|delete)/*$'
,
note
.
views
.
TresorerieAjoutRemise
,
name
=
'TresorerieAjoutRemise'
),
url
(
ur
'^/tresorerie/remises/(?P<idremise>[^/]*)?(?P<clore>/clore)?/*$'
,
note
.
views
.
TresorerieCloreRemise
,
name
=
'TresorerieCloreRemise'
),
url
(
ur
'^/tresorerie/facturation/*$'
,
note
.
views
.
TresorerieFacturation
,
name
=
'TresorerieFacturation'
),
# regeneration du password
url
(
ur
'^/regen_pw/(?P<token>[^/]*)/*$'
,
'regen_pw'
),
url
(
ur
'^/regen_pw/(?P<token>[^/]*)/*$'
,
note
.
views
.
regen_pw
,
name
=
'regen_pw'
),
# easter egg
url
(
ur
'^/(?:teapot|the|tea|coffee|cafe)/*$'
,
'teapot'
),
url
(
ur
'^/(?:teapot|the|tea|coffee|cafe)/*$'
,
note
.
views
.
teapot
,
name
=
'teapot'
),
# Page de liste des droits
url
(
ur
'^/listedroits/*$'
,
'liste_droits'
)
)
url
(
ur
'^/listedroits/*$'
,
note
.
views
.
liste_droits
,
name
=
'liste_droits'
)
]
urlpatterns
+=
patterns
(
'note.ajaj'
,
urlpatterns
+=
[
# les pages de requêtes AJAJ
url
(
ur
'^/quick_search_(?P<mode>basic|dons)/*$'
,
'quick_search'
),
url
(
ur
'^/search/*$'
,
'search'
),
url
(
ur
'^/search_readhesion/*$'
,
'search_readhesion'
),
url
(
ur
'^/get_boutons/(?P<flags>[^/]*)/*$'
,
'get_boutons'
),
url
(
ur
'^/get_display_info/*$'
,
'get_display_info'
),
url
(
ur
'^/get_photo/(?P<idbde>[^/]*)/*$'
,
'get_photo'
),
url
(
ur
'^/do_conso/*$'
,
'do_conso'
),
url
(
ur
'^/do_(?P<action>credit|retrait)/*$'
,
'do_credit_retrait'
),
url
(
ur
'^/do_transfert/*$'
,
'do_transfert'
),
url
(
ur
'^/consos/toggle_transaction/*$'
,
'toggle_transaction'
),
)
url
(
ur
'^/quick_search_(?P<mode>basic|dons)/*$'
,
note
.
ajaj
.
quick_search
,
name
=
'quick_search'
),
url
(
ur
'^/search/*$'
,
note
.
ajaj
.
search
,
name
=
'search'
),
url
(
ur
'^/search_readhesion/*$'
,
note
.
ajaj
.
search_readhesion
,
name
=
'search_readhesion'
),
url
(
ur
'^/get_boutons/(?P<flags>[^/]*)/*$'
,
note
.
ajaj
.
get_boutons
,
name
=
'get_boutons'
),
url
(
ur
'^/get_display_info/*$'
,
note
.
ajaj
.
get_display_info
,
name
=
'get_display_info'
),
url
(
ur
'^/get_photo/(?P<idbde>[^/]*)/*$'
,
note
.
ajaj
.
get_photo
,
name
=
'get_photo'
),
url
(
ur
'^/do_conso/*$'
,
note
.
ajaj
.
do_conso
,
name
=
'do_conso'
),
url
(
ur
'^/do_(?P<action>credit|retrait)/*$'
,
note
.
ajaj
.
do_credit_retrait
,
name
=
'do_credit_retrait'
),
url
(
ur
'^/do_transfert/*$'
,
note
.
ajaj
.
do_transfert
,
name
=
'do_transfert'
),
url
(
ur
'^/consos/toggle_transaction/*$'
,
note
.
ajaj
.
toggle_transaction
,
name
=
'toggle_transaction'
),
]
...
...
@@ -100,6 +101,6 @@ js_info_dict = {
}
# Pour la traduction du javascript
urlpatterns
+=
patterns
(
''
,
url
(
r
'^jsi18n/$'
,
javascript_catalog
,
js_info_dict
,
name
=
'javascript_catalog'
),
)
urlpatterns
+=
[
url
(
r
'^jsi18n/$'
,
javascript_catalog
,
js_info_dict
,
name
=
'javascript_catalog'
),
]
note/wsgi.py
0 → 100644
View file @
8d3d5f76
"""
WSGI config for plop project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/
"""
import
os
from
django.core.wsgi
import
get_wsgi_application
os
.
environ
.
setdefault
(
"DJANGO_SETTINGS_MODULE"
,
"note.settings"
)
application
=
get_wsgi_application
()
urls.py
View file @
8d3d5f76
...
...
@@ -9,8 +9,8 @@
est en mode DEBUG.
"""
from
django.conf.urls
import
patterns
,
include
,
url
from
django.conf.urls
import
include
,
url
from
django.conf.urls.static
import
static
from
note
import
settings
if
settings
.
DEBUG
:
...
...
@@ -26,18 +26,14 @@ handler500 = "note.views.server_error"
from
django.contrib
import
admin
admin
.
autodiscover
()
urlpatterns
=
patterns
(
''
,
import
note.urls
urlpatterns
=
[
url
(
r
'^'
+
settings
.
NOTE_ROOT_URL
.
strip
(
'/'
),
include
(
'note.urls'
)),
url
(
r
''
,
include
(
'note.urls'
)),
url
(
r
'^admin/'
,
include
(
admin
.
site
.
urls
)),
)
]
if
settings
.
DEBUG
:
# On n'utilise pas ça en prod
urlpatterns
+=
staticfiles_urlpatterns
()
urlpatterns
+=
patterns
(
''
,
(
r
'^%s/(?P<path>.*)$'
%
(
settings
.
MEDIA_URL
.
strip
(
'/'
)),
'django.views.static.serve'
,
{
'document_root'
:
settings
.
MEDIA_ROOT
}),
)
urlpatterns
+=
static
(
settings
.
MEDIA_URL
,
document_root
=
settings
.
MEDIA_ROOT
)
wsgi.py
View file @
8d3d5f76
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
WSGI config for
Django_Client
project.
WSGI config for
plop
project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` setting.
Usually you will have the standard Django WSGI application here, but it also
might make sense to replace the whole Django WSGI application with a custom one
that later delegates to the Django one. For example, you could introduce WSGI
middleware here, or combine a Django application with an application of another
framework.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/
"""
import
os
# ligne qui était là au départ, je l'ai virée parce que ça avait pas l'air
# d'importer ce qu'il fallait
#os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
from
django.core.wsgi
import
get_wsgi_application
# à la place, on va récupérer le path du dossier du fichier courant
here
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
)
)
import
sys
sys
.
path
.
append
(
here
)
# et a priori settings.py est dans le même dossier
os
.
environ
.
setdefault
(
"DJANGO_SETTINGS_MODULE"
,
"note.settings"
)
# Bon, il semblerait qu'on a aussi besoin du répertoire parent
uphere
=
"/"
.
join
(
here
.
split
(
"/"
)[:
-
1
])
sys
.
path
.
append
(
uphere
)
# This application object is used by any WSGI server configured to use this
# file. This includes Django's development server, if the WSGI_APPLICATION
# setting points here.
from
django.core.wsgi
import
get_wsgi_application
application
=
get_wsgi_application
()
# Apply WSGI middleware here.
#from helloworld.wsgi import HelloWorldApplication
#application = HelloWorldApplication(application)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment