commit a307fd259bb6dc77bf530b0a6c73905266d4552a Author: Qwann Date: Fri Oct 6 14:17:13 2017 +0200 initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..516a35b --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +__pycache__ +venv +.*.swp +*.pyc +*.sqlite3 diff --git a/WikiENS/__init__.py b/WikiENS/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/WikiENS/__pycache__/__init__.cpython-36.pyc b/WikiENS/__pycache__/__init__.cpython-36.pyc new file mode 100644 index 0000000..599d89d Binary files /dev/null and b/WikiENS/__pycache__/__init__.cpython-36.pyc differ diff --git a/WikiENS/__pycache__/settings.cpython-36.pyc b/WikiENS/__pycache__/settings.cpython-36.pyc new file mode 100644 index 0000000..9d90b52 Binary files /dev/null and b/WikiENS/__pycache__/settings.cpython-36.pyc differ diff --git a/WikiENS/__pycache__/urls.cpython-36.pyc b/WikiENS/__pycache__/urls.cpython-36.pyc new file mode 100644 index 0000000..210fa85 Binary files /dev/null and b/WikiENS/__pycache__/urls.cpython-36.pyc differ diff --git a/WikiENS/__pycache__/wsgi.cpython-36.pyc b/WikiENS/__pycache__/wsgi.cpython-36.pyc new file mode 100644 index 0000000..4eddf32 Binary files /dev/null and b/WikiENS/__pycache__/wsgi.cpython-36.pyc differ diff --git a/WikiENS/settings.py b/WikiENS/settings.py new file mode 100644 index 0000000..aa03b7b --- /dev/null +++ b/WikiENS/settings.py @@ -0,0 +1,153 @@ +""" +Django settings for WikiENS project. + +Generated by 'django-admin startproject' using Django 1.11.1. + +For more information on this file, see +https://docs.djangoproject.com/en/1.11/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/1.11/ref/settings/ +""" + +import os + +from django.core.urlresolvers import reverse_lazy + +# Build paths inside the project like this: os.path.join(BASE_DIR, ...) +BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = '_u5q4-^1qgkqg=i5o5ha*xkd@82#l$e+%m)$v+4y#t-5!g-%g2' + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +ALLOWED_HOSTS = [] + + +# Application definition + +INSTALLED_APPS = [ + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', + 'django.contrib.sites', + 'django.contrib.humanize', + 'django_nyt', + 'mptt', + 'sekizai', + 'sorl.thumbnail', + 'shared', # Do not move, so templates in `shared` can override + # thoses in `wiki` + 'wiki', + 'wiki.plugins.attachments', + 'wiki.plugins.notifications', + 'wiki.plugins.images', + 'wiki.plugins.macros', +] + +MIDDLEWARE = [ + 'django.middleware.security.SecurityMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', +] + +ROOT_URLCONF = 'WikiENS.urls' + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [], + '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', + "sekizai.context_processors.sekizai", + ], + }, + }, +] + +WSGI_APPLICATION = 'WikiENS.wsgi.application' + +SITE_ID = 1 + + +# Database +# https://docs.djangoproject.com/en/1.11/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), + } +} + + +# Password validation +# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators + +AUTH_PASSWORD_VALIDATORS = [ + { + 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', + }, +] + + +# Internationalization +# https://docs.djangoproject.com/en/1.11/topics/i18n/ + +LANGUAGE_CODE = 'fr-fr' + +TIME_ZONE = 'Europe/Paris' + +USE_I18N = True + +USE_L10N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/1.11/howto/static-files/ + +STATIC_URL = '/static/' + +LOGIN_REDIRECT_URL = reverse_lazy('wiki:get', kwargs={'path': ''}) + +# WIKI SETTINGS + +# Sign up, login and logout views should be accessible +WIKI_ACCOUNT_HANDLING = True + +# Signup allowed? If it’s not allowed, logged in superusers +# can still access the signup page to create new users. +WIKI_ACCOUNT_SIGNUP_ALLOWED = True + +# Globally enable write access for anonymous users, if true anonymous users +# will be treated as the others_write boolean field on models.Article. +WIKI_ANONYMOUS_WRITE = False diff --git a/WikiENS/urls.py b/WikiENS/urls.py new file mode 100644 index 0000000..17a08d3 --- /dev/null +++ b/WikiENS/urls.py @@ -0,0 +1,17 @@ +from django.conf.urls import url, include +from django.contrib import admin +from django.views.generic import RedirectView +from django.urls import reverse_lazy + +from wiki.urls import get_pattern as get_wiki_pattern +from django_nyt.urls import get_pattern as get_nyt_pattern + +redirect_home_view = RedirectView.as_view(url=reverse_lazy('home')) + +urlpatterns = [ + url(r'^admin/', admin.site.urls), + url(r'^notifications/', get_nyt_pattern()), + url(r'', get_wiki_pattern()), +] + +# TODO add MEDIA_ROOT diff --git a/WikiENS/wsgi.py b/WikiENS/wsgi.py new file mode 100644 index 0000000..1549535 --- /dev/null +++ b/WikiENS/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for WikiENS 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.11/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "WikiENS.settings") + +application = get_wsgi_application() diff --git a/manage.py b/manage.py new file mode 100755 index 0000000..1ae7a2c --- /dev/null +++ b/manage.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python +import os +import sys + +if __name__ == "__main__": + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "WikiENS.settings") + 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) diff --git a/requirement.txt b/requirement.txt new file mode 100644 index 0000000..c5f6efc --- /dev/null +++ b/requirement.txt @@ -0,0 +1,14 @@ +bleach==1.5.0 +Django==1.10.7 +django-classy-tags==0.8.0 +django-mptt==0.8.7 +django-nyt==1.0b5 +django-sekizai==0.10.0 +html5lib==0.9999999 +Markdown==2.6.8 +olefile==0.44 +Pillow==4.2.1 +six==1.10.0 +sorl-thumbnail==12.3 +wiki==0.2.4 +django-allauth-ens==0.0.1.dev0 diff --git a/shared/__init__.py b/shared/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/shared/__pycache__/__init__.cpython-36.pyc b/shared/__pycache__/__init__.cpython-36.pyc new file mode 100644 index 0000000..289ca4b Binary files /dev/null and b/shared/__pycache__/__init__.cpython-36.pyc differ diff --git a/shared/apps.py b/shared/apps.py new file mode 100644 index 0000000..46de263 --- /dev/null +++ b/shared/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class SharedConfig(AppConfig): + name = 'shared' diff --git a/shared/static/img/logoENS-small.png b/shared/static/img/logoENS-small.png new file mode 100644 index 0000000..e85fd37 Binary files /dev/null and b/shared/static/img/logoENS-small.png differ diff --git a/shared/static/img/logoENS.png b/shared/static/img/logoENS.png new file mode 100644 index 0000000..fea2aa8 Binary files /dev/null and b/shared/static/img/logoENS.png differ diff --git a/shared/static/img/logoEleves.png b/shared/static/img/logoEleves.png new file mode 100644 index 0000000..7c82306 Binary files /dev/null and b/shared/static/img/logoEleves.png differ diff --git a/shared/templates/wiki/base.html b/shared/templates/wiki/base.html new file mode 100644 index 0000000..3bbddaa --- /dev/null +++ b/shared/templates/wiki/base.html @@ -0,0 +1,20 @@ +{% extends "wiki/base_site.html" %} +{% load sekizai_tags %} +{% load staticfiles %} + +{% block wiki_site_title %} - WikiENS{% endblock %} + +{% block wiki_header_branding %} +Wiki  ENS +{% endblock %} + +{% block wiki_header_navlinks %} + +{% endblock %} + +{% block wiki_footer_logo %} + +

Wiki maintenu par les élèves de l'École normale supérieure.
En cas de pépin contacter cof-geek [chez] ens [point] fr

+{% endblock %}