- Poprawienie README.rst i dodanie localsettings.sample.
+Platforma Redakcyjna
+====================
+
+Opis projektu
+*************
+Platforma to serwis służący do grupowej edycji książek na potrzeby serwisu WolneLektury.pl.
+
+Wymagania
+*********
+* `Django 1.1 <http://djangoproject.com/>`_
+* `django-piston 0.2.3rc1 <http://bitbucket.org/jespern/django-piston/>`_
+* `librarian 1.2 <http://redmine.nowoczesnapolska.org.pl/projects/show/librarian>`_
+* `lxml 2.2.2 <http://codespeak.net/lxml/>`_
+* `Mercurial 1.3.1 <http://www.selenic.com/mercurial/>`_
+* `PIL 1.1.6 <http://www.pythonware.com/products/pil/>`_ (wymagane przez skrypt imgconv.py)
+* `pngnq <http://pngnq.sourceforge.net/>`_ (wymagane przez skrypt imgconv.py)
+
Instalacja
-==========
+**********
1. Ściągnij i zainstaluj `pip <http://pypi.python.org/pypi/pip>`_
-2. Zainstaluj wymagane biblioteki komendą::
+2. Przejdź do katalogu serwisu w konsoli
+3. Zainstaluj wymagane biblioteki (patrz sekcja wymagania_) komendą::
pip install -f http://redmine.nowoczesnapolska.org.pl/projects/librarian/files -r requirements.txt
-Zależności
-==========
+4. Wypełnij bazę danych (Django poprosi o utworzenie pierwszego użytkownika)::
+
+ ./manage.py syncdb
+
+5. Skopiuj zawartość pliku `project/localsettings.sample` do `project/localsettings.py` i zmień go zgodnie ze swoimi potrzebami.
+
+6. Uruchom serwer deweloperski::
+
+ ./manage.py runserver
+
+7. Zalecane jest serwowanie aplikacji przez `modwsgi <http://code.google.com/p/modwsgi/>`_ na serwerze `Apache2 <http://httpd.apache.org/>`_ przy pomocy załączonego skryptu `dispatch.fcgi`. Inne strategie wdrożeniowe opisane są w `Dokumentacji Django <http://docs.djangoproject.com/en/dev/howto/deployment/#howto-deployment-index>`_.
- * `Django 1.1 <http://djangoproject.com/>`_
- * `Mercurial 1.3.1 <http://www.selenic.com/mercurial/>`_
- * `librarian 1.2 <http://redmine.nowoczesnapolska.org.pl/projects/show/librarian>`_
- * `PIL 1.1.6 <http://www.pythonware.com/products/pil/>`_ (wymagane przez skrypt imgconv.py)
- * `pngnq <http://pngnq.sourceforge.net/>`_ (wymagane przez skrypt imgconv.py)
--- /dev/null
+#
+# localsettings template for Platforma
+#
+# Duplicate this file as localsettings.py and change it to your liking.
+# Settings defined in localsettings.py will override settings from
+# settings.py file. localsettings.py should never be commited
+# to a version control system. Please make changes to settings.py
+# or localsettings.sample instead.
+#
+
+# Path to repository with managed documents
+REPOSITORY_PATH = '/home/user/repository'
+
+# Subdirectory of STATIC_ROOT containing images
+IMAGE_DIR = 'images'
+
+# Authentication via Central Authentication Server
+INSTALLED_APPS = (
+ 'django.contrib.auth',
+ 'django.contrib.contenttypes',
+ 'django.contrib.sessions',
+ 'django.contrib.sites',
+ 'django.contrib.admin',
+ 'django.contrib.admindocs',
+
+ 'cas_consumer',
+ 'explorer',
+ 'toolbar',
+ 'api',
+ 'wysiwyg',
+)
+
+AUTHENTICATION_BACKENDS = (
+ 'cas_consumer.backends.CASBackend',
+)
+
+CAS_BASE = 'http://localhost:7000/'
+CAS_SERVICE = 'http://localhost:8000/accounts/login/'
+
ROOT_URLCONF = 'urls'
TEMPLATE_DIRS = (
- PROJECT_ROOT + '/templates',
+ PROJECT_ROOT + '/templates',
)
# CSS and JS files to compress
'django.contrib.admin',
'django.contrib.admindocs',
- 'cas_provider',
- 'cas_consumer',
'explorer',
'toolbar',
'api',
],
}
-# django-cas-provider
-LOGIN_URL = '/cas/login/'
-LOGOUT_URL = '/cas/logout/'
-
# Python logging settings
import logging
+++ /dev/null
-{% extends "base.html" %}
-
-{% block title %}
-Login
-{% endblock %}
-
-{% block maincontent %}
- <form action='.' method='post'>
- <fieldset>
- <legend>Log in to your account</legend>
- {% if errors %}
- <ul>
- {% for error in errors %}
- <li>{{ error|escape }}</li>
- {% endfor %}
- </ul>
- {% endif %}
- <table style="border: none;">
- {{ form.as_table }}
- </table>
- <p><input type="submit" value="Login"/></p>
- </fieldset>
- </form>
-{% endblock %}
+++ /dev/null
-{% extends "base.html" %}
-
-{% block title %}
-Logged out
-{% endblock %}
-
-{% block maincontent %}
- <h3>Logged out</h3>
-
- <p>You have successfully logged out. To ensure that you are logged out of all services, please close your browser.</p>
- {% if url %}<p><a href="{{ url }}">Click here</a> to return to {{ url }}</p>{% endif %}
-{% endblock %}
{% if user.is_authenticated %}
<span class="user_name">{{ user.username }}</span> |
-<a href='{% url django.contrib.auth.views.logout %}?next={{request.get_full_path}}'>Wyloguj</a>
+<a href='{% url logout %}?next={{request.get_full_path}}'>Wyloguj</a>
{% else %}
-{% url django.contrib.auth.views.login as login_url %}
+{% url login as login_url %}
{% ifnotequal login_url request.path %}
- <a href='{% url django.contrib.auth.views.login %}?next={{request.get_full_path}}'>Logowanie</a>
+ <a href='{{ login_url }}?next={{request.get_full_path}}'>Logowanie</a>
{% endifnotequal %}
{% endif %}
url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
url(r'^admin/(.*)', admin.site.root),
- # Authorization
- url(r'^accounts/login/$', 'django.contrib.auth.views.login', {'redirect_field_name': 'next'}),
- url(r'^accounts/logout/$', 'django.contrib.auth.views.logout', {'next_page': '/'}),
-
# Prototypes
url(r'^wysiwyg-proto/', include('wysiwyg.urls')),
# Our über-restful api
url(r'^api/', include('api.urls') ),
- # django-cas-provider
- url(r'^cas/', include('cas_provider.urls')),
)
+if 'cas_consumer' in settings.INSTALLED_APPS:
+ urlpatterns += patterns('',
+ # django-cas-consumer
+ url(r'^accounts/login/$', 'cas_consumer.views.login', name='login'),
+ url(r'^accounts/logout/$', 'cas_consumer.views.logout', name='logout'),
+ )
+else:
+ urlpatterns += patterns('',
+ # Django auth
+ url(r'^accounts/login/$', 'django.contrib.auth.views.login', {'redirect_field_name': 'next'}, name='login'),
+ url(r'^accounts/logout/$', 'django.contrib.auth.views.logout', {'next_page': '/'}, name='logout'),
+ )
# Static files
if settings.DEBUG and not hasattr(settings, 'DONT_SERVE_STATIC'):
url(r'^%s(?P<path>.+)$' % settings.STATIC_URL[1:], 'django.views.static.serve',
{'document_root': settings.STATIC_ROOT, 'show_indexes': True}),
)
+#
\ No newline at end of file
librarian==1.2.2
lxml==2.2.2
mercurial==1.3.1
--e git://github.com/zuber/django-cas-consumer.git@master#egg=django-cas-consumer
--e git://github.com/zuber/django-cas-provider.git@master#egg=django-cas-provider