localsettings.py
dev.sqlite
-fabfile_local.py
*.db
*.db-journal
*~
+++ /dev/null
-# -*- coding: utf-8 -*-
-from fnpdeploy import *
-
-try:
- from fabfile_local import *
-except ImportError:
- pass
-
-
-env.project_name = 'wolnelektury'
-
-
-class ManageTask(Task):
- def __init__(self, name, params='', **kwargs):
- super(ManageTask, self).__init__(**kwargs)
- self.name = name
- self.params = params
-
- def run(self):
- require('app_path', 'project_name')
- with cd(get_django_root_path('current')):
- run('source %(ve)s/bin/activate && python manage.py %(task)s %(params)s' % {
- 've': env.ve,
- 'task': self.name,
- 'params': self.params,
- }, pty=True)
-
-
-class Memcached(Service):
- def run(self):
- print '>>> memcached: restart'
- sudo('/etc/init.d/memcached restart', shell=False)
-
-
-@task
-def production():
- env.hosts = ['giewont.icm.edu.pl']
- env.user = 'lektury'
- env.app_path = '/srv/wolnelektury.pl'
- env.django_root_path = 'src'
- env.requirements_file = 'requirements/requirements.txt'
- env.pre_collectstatic = [
- ManageTask('update_counters'),
- ]
- env.services = [
- Supervisord('wolnelektury'),
- Supervisord('wolnelektury.celery'),
- Memcached(),
- ]
-
-
-@task
-def beta():
- env.hosts = ['giewont.icm.edu.pl']
- env.user = 'lektury'
- env.app_path = '/srv/wolnelektury.pl/beta'
- env.ve = '/srv/wolnelektury.pl/ve'
- env.django_root_path = 'src'
- env.requirements_file = 'requirements/requirements.txt'
- env.pre_collectstatic = [
- ManageTask('update_counters'),
- ]
- env.services = [
- Supervisord('beta'),
- ]
-
-
-@task
-def staging():
- env.hosts = ['san.nowoczesnapolska.org.pl:2223']
- env.user = 'staging'
- env.app_path = '/home/staging/wolnelektury.pl'
- env.services = [
- DebianGunicorn('wolnelektury'),
- ]
paypalrestsdk
-django-haystack<2.8.0
-django-migdal==0.8.5
-
python-slugify
firebase-admin
from rest_framework import serializers
from .fields import UserPremiumField, AbsoluteURLField, ThumbnailField
from .models import BookUserData
-from migdal.models import Entry, Photo
class PlainSerializer(serializers.ModelSerializer):
class Meta:
model = BookUserData
fields = ['state']
-
-
-class BlogGalleryUrlSerializer(PlainSerializer):
- class Meta:
- model = Photo
- fields = ['image']
-
-
-class BlogSerializer(serializers.ModelSerializer):
- url = AbsoluteURLField()
- image_url = serializers.FileField(source='image')
- image_thumb = ThumbnailField('193x193', source='image')
- key = serializers.DateTimeField(source='first_published_at')
- gallery_urls = BlogGalleryUrlSerializer(many=True, source='photo_set')
- body = serializers.CharField()
- lead = serializers.CharField()
-
- class Meta:
- model = Entry
- fields = ['title', 'lead', 'body', 'place', 'time', 'image_url', 'image_thumb',
- 'gallery_urls', 'type', 'key', 'url']
from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework.generics import ListAPIView, RetrieveAPIView, get_object_or_404
-from migdal.models import Entry
from catalogue.models import Book
from .models import BookUserData
from . import serializers
return Response(serializer.data)
-class BlogView(ListAPIView):
- serializer_class = serializers.BlogSerializer
-
- def get_queryset(self):
- after = self.request.query_params.get('after')
- count = int(self.request.query_params.get('count', 20))
- entries = Entry.published_objects.filter(in_stream=True).order_by('-first_published_at')
- if after:
- entries = entries.filter(first_published_at__lt=after)
- if count:
- entries = entries[:count]
- return entries
+class BlogView(APIView):
+ def get(self, request):
+ return Response([])
'raven.contrib.django.raven_compat',
'club.apps.ClubConfig',
- 'migdal',
'django_comments',
'django_comments_xtd',
'django_gravatar',
# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
-from fnpdjango.utils.text.textilepl import textile_pl
-from migdal import EntryType
from django.utils.translation import ugettext_lazy as _
HONEYPOT_FIELD_NAME = 'miut'
'client_secret': '',
}
-MARKUP_FIELD_TYPES = (
- ('textile_pl', textile_pl),
-)
-
-MIGDAL_TYPES = (
- EntryType('news', _('news'), commentable=False, on_main=True, promotable=True),
- EntryType('publications', _('publications'), commentable=False),
- EntryType('info', _('info'), commentable=False),
- EntryType('event', _('events'), commentable=False),
-)
-
-MIGDAL_OPTIONAL_LANGUAGES = (
- ('en', u'English'),
-)
-
REST_FRAMEWORK = {
"DEFAULT_RENDERER_CLASSES": (
'rest_framework.renderers.JSONRenderer',
from django.contrib import admin
from django.views.generic import RedirectView
import django.views.static
-from migdal.urls import urlpatterns as migdal_urlpatterns
import catalogue.views
import picture.views
from . import views
# url(r'^post-test/$', views.post_test),
]
-urlpatterns += migdal_urlpatterns
-
if settings.DEBUG:
urlpatterns += [