initial commit

This commit is contained in:
Qwann 2017-10-06 14:17:13 +02:00
commit a307fd259b
18 changed files with 252 additions and 0 deletions

5
.gitignore vendored Normal file
View file

@ -0,0 +1,5 @@
__pycache__
venv
.*.swp
*.pyc
*.sqlite3

0
WikiENS/__init__.py Normal file
View file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

153
WikiENS/settings.py Normal file
View file

@ -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 its 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

17
WikiENS/urls.py Normal file
View file

@ -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

16
WikiENS/wsgi.py Normal file
View file

@ -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()

22
manage.py Executable file
View file

@ -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)

14
requirement.txt Normal file
View file

@ -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

0
shared/__init__.py Normal file
View file

Binary file not shown.

5
shared/apps.py Normal file
View file

@ -0,0 +1,5 @@
from django.apps import AppConfig
class SharedConfig(AppConfig):
name = 'shared'

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View file

@ -0,0 +1,20 @@
{% extends "wiki/base_site.html" %}
{% load sekizai_tags %}
{% load staticfiles %}
{% block wiki_site_title %} - WikiENS{% endblock %}
{% block wiki_header_branding %}
<a id="navbar-title" class="navbar-brand" href="/">Wiki&nbsp;<img src="{% static 'img/logoENS-small.png' %}" style="display:inline-block; height:100%;"i />&nbsp;ENS</a>
{% endblock %}
{% block wiki_header_navlinks %}
<ul class="nav navbar-nav">
<li class="active"><a href="{% url 'wiki:root' %}">Accueil</a></li>
</ul>
{% endblock %}
{% block wiki_footer_logo %}
<a href="http://www.eleves.ens.fr" class="pull-right"><img height="100px" src="{% static 'img/logoEleves.png' %}" /></a>
<p>Wiki maintenu par les élèves de l'École normale supérieure. <br /> En cas de pépin contacter <tt>cof-geek [chez] ens [point] fr</tt></p>
{% endblock %}