Coder Social home page Coder Social logo

divio / aldryn-newsblog Goto Github PK

View Code? Open in Web Editor NEW
68.0 30.0 118.0 1.9 MB

A combined news/weblog application for Aldryn and django CMS – part of the Essential Addons.

Home Page: https://marketplace.django-cms.org/en/addons/browse/aldryn-newsblog/

License: Other

HTML 9.90% Python 77.30% Shell 0.12% JavaScript 12.36% Dockerfile 0.32%

aldryn-newsblog's Introduction

Deprecated

This project is no longer supported.

Divio will undertake no further development or maintenance of this project. If you are interested in continuing to develop it, use the fork functionality from GitHub. We are not able to transfer ownership of the repository to another party.

Please have a look at alternatives such as djangocms-blog.

Aldryn News & Blog for django CMS

PyPI Version Build Status Coverage Status Code Climate Requirements Status

Aldryn News & Blog is an Aldryn-compatible news and weblog application for django CMS.

Content editors looking for documentation on how to use the editing interface should refer to our user manual section.

Django developers who want to learn more about django CMS, as well as how to install, configure and customize it for their own projects should refer to the documentation sections.

Aldryn News & Blog is intended to serve as a model of good practice for development of django CMS and Aldryn applications.

Installation & Updates

Please head over to our documentation for all the details on how to install, configure and use Aldryn News & Blog.

You can also find instructions on how to upgrade from earlier versions.

Contributing

This is a an open-source project. We'll be delighted to receive your feedback in the form of issues and pull requests. Before submitting your pull request, please review our contribution guidelines.

We're grateful to all contributors who have helped create and maintain this package. Contributors are listed at the contributors section.

aldryn-newsblog's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aldryn-newsblog's Issues

Missing ability to get tags, dates, authors for (filtered) queryset

This is required to build templatetags and CMS plugins, which do not get deep inside newsblog implementation details.
Should this be implemented like here:
https://github.com/aldryn/aldryn-blog/blob/29b224989396cc4d170855afc3af162917fe0846/aldryn_blog/models.py#L81 ? This custom manager should take namespace relation into account.
Authors part is related to #45. Not sure if we also need to add something for categories. (I am not using them in the project.)

ImproperlyConfigured: CMS Plugins must define a render template

after install and configure i try to start test server (python manage.py runserver)
and i got:
ImproperlyConfigured: CMS Plugins must define a render template (<class 'aldryn_newsblog.cms_plugins.NewsBlogArchivePlugin'>) that exists: aldryn_newsblog/plugins/archive.html
after comment it in settings.py -
ImproperlyConfigured: CMS Plugins must define a render template (<class 'aldryn_people.cms_plugins.PeoplePlugin'>) that exists: aldryn_people/plugins/standard/people_list.html

Exception when running migrations

After following the installations instructions according to the github readme, when trying to run migrations for installed on top of django-cms 3.0.13 running on python 2.7.6, an AttributeError is thrown:

File "/local/lib/python2.7/site-packages/aldryn_newsblog/models.py", line 104, in <module>
    class Article(TranslationHelperMixin, TranslatableModel):
  File "/local/lib/python2.7/site-packages/django/utils/encoding.py", line 33, in python_2_unicode_compatible
    if '__str__' not in klass.__dict__:
AttributeError: 'NoneType' object has no attribute '__dict__'

Any ideas on what could cause this issue?

Article fields in the wrong language are getting indexed

At search_indexes.py there are safe_translation_getter() calls without current language argument (and it looks like parler does not try to detect the current language inside that method either). So, article's filelds translated in first available language are sometimes indexed in the Solr core for another language.
The aldryn-search was built with hvad in mind, so we probably need to take some extra steps in index methods to properly index translatable models.
@yakky, can you try to reproduce this and adjust the index?
CC: @czpython @intellectronica

Integration with aldryn-search

I will try to come up with simple search configuration. Multi-language support is very different from aldryn-blog, so we can not just reuse that code blindly. I am also unsure if we will be able to easily create unit tests (that will be also run on Travis).
@czpython any assistance with hits issue will be very appreciated.

Blog menu item disappears when switching language

If my user language is configured to english and I visit my blog list page, I can see the blog menu item in the toolbar but if I switch to another language like german, the entry disappears. I've published the page in all languages and set the apphook config for all languages.

Sitemaps

I want to add sitemaps to newsblog. Should I add option to NewsBlogConfig to choose if current instance should be displayed in sitemap?

"_south_new_aldryn_newsblog_article_translation" already exists

When migrating, getting the following error.

aldryn_newsblog:0035_auto__chg_field_articletranslation_language_code__chg_field_newsblogco
FATAL ERROR - The following SQL query failed: CREATE TABLE "_south_new_aldryn_newsblog_article_translation" ("meta_description" text NOT NULL, "meta_title" varchar(255) NOT NULL, "meta_keywords" text NOT NULL, "title" varchar(234) NOT NULL, "search_data" text NOT NULL, "lead_in" text NOT NULL, "language_code" varchar(15) NOT NULL, "id" integer PRIMARY KEY, "master_id" integer, "slug" varchar(255) NOT NULL)
The error was: table "_south_new_aldryn_newsblog_article_translation" already exists

South 0016 Migration MySQL

Migration is now working on mysql db.
Changed row 17 and 21 to if connection.vendor not in ['sqlite', 'mysql', ]:

error message:
FATAL ERROR - The following SQL query failed: ALTER TABLE aldryn_newsblog_latestentriesplugin ADD CONSTRAINT app_config_id_refs_id_522159a1 FOREIGN KEY (app_config_id) REFERENCES aldryn_newsblog_newsblogconfig (id);

AttributeError at /en/admin/cms/page/5/en/publish/ 'Text' object has no attribute '_placeholder_cache'

Impossible to create text page. aldryn-newsblog v. 0.8.7.

Environment:


Request Method: GET
Request URL: http://localhost/en/admin/cms/page/5/en/publish/

Django Version: 1.7.7
Python Version: 2.7.9
Installed Applications:
('djangocms_admin_style',
 'djangocms_text_ckeditor',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.admin',
 'django.contrib.sites',
 'django.contrib.sitemaps',
 'django.contrib.staticfiles',
 'django.contrib.messages',
 'cms',
 'menus',
 'sekizai',
 'treebeard',
 'djangocms_style',
 'djangocms_column',
 'djangocms_file',
 'djangocms_flash',
 'djangocms_googlemap',
 'djangocms_inherit',
 'djangocms_link',
 'djangocms_picture',
 'djangocms_teaser',
 'djangocms_video',
 'reversion',
 'mysite',
 'aldryn_apphooks_config',
 'aldryn_boilerplates',
 'aldryn_categories',
 'aldryn_newsblog',
 'aldryn_people',
 'aldryn_reversion',
 'easy_thumbnails',
 'filer',
 'parler',
 'taggit',
 'sortedm2m')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.locale.LocaleMiddleware',
 'django.middleware.doc.XViewMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware',
 'cms.middleware.user.CurrentUserMiddleware',
 'cms.middleware.page.CurrentPageMiddleware',
 'cms.middleware.toolbar.ToolbarMiddleware',
 'cms.middleware.language.LanguageCookieMiddleware')


Traceback:
File "/home/nedr/progs/env/cms/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  111.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/nedr/progs/env/cms/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view
  105.                     response = view_func(request, *args, **kwargs)
File "/home/nedr/progs/env/cms/lib/python2.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
  52.         response = view_func(request, *args, **kwargs)
File "/home/nedr/progs/env/cms/lib/python2.7/site-packages/django/contrib/admin/sites.py" in inner
  206.             return view(request, *args, **kwargs)
File "/home/nedr/progs/env/cms/lib/python2.7/site-packages/django/db/transaction.py" in inner
  394.                 return func(*args, **kwargs)
File "/home/nedr/progs/env/cms/lib/python2.7/site-packages/reversion/revisions.py" in do_revision_context
  297.                 return func(*args, **kwargs)
File "/home/nedr/progs/env/cms/lib/python2.7/site-packages/cms/admin/pageadmin.py" in publish_page
  956.             published = page.publish(language)
File "/home/nedr/progs/env/cms/lib/python2.7/site-packages/cms/models/pagemodel.py" in publish
  593.             self._copy_contents(public_page, language)
File "/home/nedr/progs/env/cms/lib/python2.7/site-packages/cms/models/pagemodel.py" in _copy_contents
  304.                 copy_plugins_to(plugins, ph, no_signals=True)
File "/home/nedr/progs/env/cms/lib/python2.7/site-packages/cms/utils/copy_plugins.py" in copy_plugins_to
  32.             new_instance.post_copy(old_plugin, plugins_ziplist)
File "/home/nedr/progs/env/cms/lib/python2.7/site-packages/djangocms_text_ckeditor/models.py" in post_copy
  68.         self.save()
File "/home/nedr/progs/env/cms/lib/python2.7/site-packages/djangocms_text_ckeditor/models.py" in save
  50.         super(AbstractText, self).save(*args, **kwargs)
File "/home/nedr/progs/env/cms/lib/python2.7/site-packages/cms/models/pluginmodel.py" in save
  238.         super(CMSPlugin, self).save()
File "/home/nedr/progs/env/cms/lib/python2.7/site-packages/django/db/models/base.py" in save
  589.                        force_update=force_update, update_fields=update_fields)
File "/home/nedr/progs/env/cms/lib/python2.7/site-packages/django/db/models/base.py" in save_base
  626.                                    update_fields=update_fields, raw=raw, using=using)
File "/home/nedr/progs/env/cms/lib/python2.7/site-packages/django/dispatch/dispatcher.py" in send
  198.             response = receiver(signal=self, sender=sender, **named)
File "/home/nedr/progs/env/cms/lib/python2.7/site-packages/aldryn_newsblog/models.py" in update_seach_index
  505.         placeholder = instance._placeholder_cache

Exception Type: AttributeError at /en/admin/cms/page/5/en/publish/
Exception Value: 'Text' object has no attribute '_placeholder_cache'

Comments

Hi,

I need to add comments to aldryn-newsblog, are You intrested in adding it as part of newsblog?

What i want to create is:

  • adding/editing comments
  • comments moderation
  • some spam filters

AttributeError at /en/blog/ 'NoneType' object has no attribute 'template_prefix'

Occurs on the clean and updated setups when trying to load page with newsblog content. All software was updated from pip.

Environment:


Request Method: GET
Request URL: http://localhost/en/blog/?edit&language=en

Django Version: 1.7.7
Python Version: 2.7.9
Installed Applications:
('djangocms_admin_style',
 'djangocms_text_ckeditor',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.admin',
 'django.contrib.sites',
 'django.contrib.sitemaps',
 'django.contrib.staticfiles',
 'django.contrib.messages',
 'cms',
 'menus',
 'sekizai',
 'treebeard',
 'djangocms_style',
 'djangocms_column',
 'djangocms_file',
 'djangocms_flash',
 'djangocms_googlemap',
 'djangocms_inherit',
 'djangocms_link',
 'djangocms_picture',
 'djangocms_teaser',
 'djangocms_video',
 'reversion',
 'mysite',
 'aldryn_apphooks_config',
 'aldryn_boilerplates',
 'aldryn_categories',
 'aldryn_newsblog',
 'aldryn_people',
 'aldryn_reversion',
 'easy_thumbnails',
 'filer',
 'parler',
 'taggit',
 'sortedm2m')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.locale.LocaleMiddleware',
 'django.middleware.doc.XViewMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware',
 'cms.middleware.user.CurrentUserMiddleware',
 'cms.middleware.page.CurrentPageMiddleware',
 'cms.middleware.toolbar.ToolbarMiddleware',
 'cms.middleware.language.LanguageCookieMiddleware')


Traceback:
File "/home/nedr/ssd/progs/env/nedrigailov_tk/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  111.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/nedr/ssd/progs/env/nedrigailov_tk/lib/python2.7/site-packages/cms/views.py" in details
  165.                 return view(request, *args, **kwargs)
File "/home/nedr/ssd/progs/env/nedrigailov_tk/lib/python2.7/site-packages/django/views/generic/base.py" in view
  69.             return self.dispatch(request, *args, **kwargs)
File "/home/nedr/ssd/progs/env/nedrigailov_tk/lib/python2.7/site-packages/aldryn_newsblog/views.py" in dispatch
  57.         return super(EditModeMixin, self).dispatch(request, *args, **kwargs)
File "/home/nedr/ssd/progs/env/nedrigailov_tk/lib/python2.7/site-packages/aldryn_apphooks_config/mixins.py" in dispatch
  16.         return super(AppConfigMixin, self).dispatch(request, *args, **kwargs)
File "/home/nedr/ssd/progs/env/nedrigailov_tk/lib/python2.7/site-packages/django/views/generic/base.py" in dispatch
  87.         return handler(request, *args, **kwargs)
File "/home/nedr/ssd/progs/env/nedrigailov_tk/lib/python2.7/site-packages/django/views/generic/list.py" in get
  161.         return self.render_to_response(context)
File "/home/nedr/ssd/progs/env/nedrigailov_tk/lib/python2.7/site-packages/aldryn_apphooks_config/mixins.py" in render_to_response
  20.         return super(AppConfigMixin, self).render_to_response(context, **response_kwargs)
File "/home/nedr/ssd/progs/env/nedrigailov_tk/lib/python2.7/site-packages/django/views/generic/base.py" in render_to_response
  130.             template=self.get_template_names(),
File "/home/nedr/ssd/progs/env/nedrigailov_tk/lib/python2.7/site-packages/aldryn_newsblog/views.py" in get_template_names
  44.         return self.prefix_template_names(template_names)
File "/home/nedr/ssd/progs/env/nedrigailov_tk/lib/python2.7/site-packages/aldryn_newsblog/views.py" in prefix_template_names
  35.         if self.config.template_prefix:

Exception Type: AttributeError at /en/blog/
Exception Value: 'NoneType' object has no attribute 'template_prefix'

More strict dependency versions

For example, we rely on a class decoration feature which is present in reversion>=1.8.2. (I've learned it the hard way during the test project setup for this app.) There might be other similar issues. Let's use some version range specifiers where we can, but not to strict to allow other apps in the hypothetical project to work.

Needs support for recommended articles

Operator should be able to select, and prioritise, a number of existing articles for display in a plugin alongside an existing article on its detail view.

Reverse error

Hi!
I Install aldryn-newsblog, all configure. Add article, category, news blog config. ad add to cms page NewsBlogCategoryPlugin after save page I recive error u'master_class' is not a registered namespace.

'master_class' is name of news blog config.

Default manager prevents to access unpublished objects

Current default manager filters out objects with is_published field set to false.

  • subclass RelatedManager in PublishedRelatedManager, move filtering method there
  • adjust some calls to Article.objects to use PublishedRelatedManager

Do not forget update search_indexes.py and tests accordingly.

docs/installation process updates

In the docs (README.rst) we have:

Run migrations: python manage.py migrate aldryn_newsblog.

NOTE: aldryn_newsblog supports both South and Django 1.7 migrations. If using Django 1.7, you may need to add the following to your settings:

MIGRATION_MODULES = [
   …
   'aldryn_newsblog': 'aldryn_newsblog.south_migrations',
   # The following are for some of the depenencies.
   'djangocms_text_ckeditor': 'djangocms_text_ckeditor.migrations_django',
   'filer': 'filer.migrations_django',
   …
]

It should be something like this:

MIGRATION_MODULES = {
   …
   # The following are for some of the dependencies.
   'djangocms_text_ckeditor': 'djangocms_text_ckeditor.migrations_django',
   'filer': 'filer.migrations_django',
   …
}
  • {} instead of []
  • aldryn_newsblog in 'dev' branch uses django migrations by default;
  • dependencies typo fix

checked with Django 1.7.7, django-cms 3.1.0rc1, newsblog 0.8.4

Django CMS plugins: articles by month/author/tag

We'll need three general CMS plugins providing template context with aggregated data to get:

  • number of articles by month
  • number of articles by author
  • number of articles by each tag

The related manager is ready and I have custom template tags in the project with very similar functionality and (most importantly) working templates.

Better model/attribute names

I am sorry to bring this up again, but if the app is going to be an example, this is something to consider.
Since namespace is not the only thing that NewsBlogConfig model can store... what is the better name for a namespace FK? app_config or app_hook_config or just config? @yakky what is your preference? Doing it early will be less painful.

I've also tried renaming Article to Entry (as a more general name for bog post and news article). Both Django and South migrations are straightforward, renaming templates and all context variables was also possible. The thing that have eventually stopped me was a huge number of article mentions in the test suite =) This would also affect any project already using the app a lot. Article is not a that bad name after all, so renaming a model seems not to be worth it.

Python 3.4 support

Hi, Is Python 3 support something that should work (error on my side) or is it planned?

I get this error because of the use of aldryn-people and vobject already reported on aldryn-people.

divio/aldryn-people#28

Failing Django 1.7 migrations

This results in a failing Travis build. We have to see which jobs have failed before merging PRs now. Is there any option to fix it?

Per app instance number of items per page

Plan:

  • Extend NewsBlogConfigForm to contain (optional?) paginate_by field
  • Add it to NewsBlogConfigAdmin.get_config_fields() as 'config.paginate_by'
  • Replace settings.ALDRYN_NEWSBLOG_PAGINATE_BY usage with this field (with fallback to settings)
  • Add, adjust tests

taggit -> django-taggit in the docs.

Here taggit should be replaced by django-taggit

Run pip install aldryn-newsblog. Also note that a number of other packages may need to be installed if they are not already:

aldryn-apphooks-config
aldryn-boilerplates
aldryn-categories
aldryn-people
aldryn-reversion
djangocms-text-ckeditor
easy_thumbnails
django-filer
django-parler
django-reversion
taggit

Need reliable Article.author slug

Article.author (which is aldryn-people Person model) has optional slug field, but we need it as view argument for AuthorArticleList.
Solutions:

  • adjust Person model to create slug field on save()?
  • generate author slug in this app (but what to do with users, that already have Person model associated with them)?

@intellectronica what do you think?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.