From 8495246162e34c6213633cfdc9a784c636bf75ca Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Mon, 11 Mar 2019 13:26:44 +0100 Subject: [PATCH] Remove some unused stuff. --- .gitignore | 1 - fabfile.py | 75 ---------------------------- requirements/requirements.txt | 3 -- src/api/serializers.py | 22 -------- src/api/views.py | 16 ++---- src/wolnelektury/settings/apps.py | 1 - src/wolnelektury/settings/contrib.py | 17 ------- src/wolnelektury/urls.py | 3 -- 8 files changed, 3 insertions(+), 135 deletions(-) delete mode 100644 fabfile.py diff --git a/.gitignore b/.gitignore index cf605b2b4..99c089870 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ localsettings.py dev.sqlite -fabfile_local.py *.db *.db-journal *~ diff --git a/fabfile.py b/fabfile.py deleted file mode 100644 index 11442c7ea..000000000 --- a/fabfile.py +++ /dev/null @@ -1,75 +0,0 @@ -# -*- 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'), - ] diff --git a/requirements/requirements.txt b/requirements/requirements.txt index 6cffb853d..267e56f8e 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -67,9 +67,6 @@ requests paypalrestsdk -django-haystack<2.8.0 -django-migdal==0.8.5 - python-slugify firebase-admin diff --git a/src/api/serializers.py b/src/api/serializers.py index f2c22d4d4..fb013e417 100644 --- a/src/api/serializers.py +++ b/src/api/serializers.py @@ -6,7 +6,6 @@ from django.contrib.auth.models import User 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): @@ -27,24 +26,3 @@ class BookUserDataSerializer(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'] diff --git a/src/api/views.py b/src/api/views.py index 5df3d689d..99c8df182 100644 --- a/src/api/views.py +++ b/src/api/views.py @@ -16,7 +16,6 @@ from rest_framework.permissions import IsAuthenticated 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 @@ -169,15 +168,6 @@ class BookUserDataView(RetrieveAPIView): 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([]) diff --git a/src/wolnelektury/settings/apps.py b/src/wolnelektury/settings/apps.py index 106e94fe3..d13dfe1d3 100644 --- a/src/wolnelektury/settings/apps.py +++ b/src/wolnelektury/settings/apps.py @@ -62,7 +62,6 @@ INSTALLED_APPS_CONTRIB = [ 'raven.contrib.django.raven_compat', 'club.apps.ClubConfig', - 'migdal', 'django_comments', 'django_comments_xtd', 'django_gravatar', diff --git a/src/wolnelektury/settings/contrib.py b/src/wolnelektury/settings/contrib.py index 2fed2f3ee..978b6db44 100644 --- a/src/wolnelektury/settings/contrib.py +++ b/src/wolnelektury/settings/contrib.py @@ -2,8 +2,6 @@ # 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' @@ -33,21 +31,6 @@ PAYPAL_CONFIG = { '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', diff --git a/src/wolnelektury/urls.py b/src/wolnelektury/urls.py index fbfd226ea..72a524915 100644 --- a/src/wolnelektury/urls.py +++ b/src/wolnelektury/urls.py @@ -7,7 +7,6 @@ from django.conf import settings 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 @@ -92,8 +91,6 @@ urlpatterns += [ # url(r'^post-test/$', views.post_test), ] -urlpatterns += migdal_urlpatterns - if settings.DEBUG: urlpatterns += [ -- 2.20.1