Giter Site home page Giter Site logo

django-fiber / django-fiber Goto Github PK

View Code? Open in Web Editor NEW
672.0 33.0 118.0 13.7 MB

Django Fiber - a simple, user-friendly CMS for all your Django projects

Home Page: http://ridethepony.org/

License: Other

Python 3.73% CSS 0.76% JavaScript 4.38% HTML 91.13%
python django cms

django-fiber's Introduction

Django Fiber

CI Status PyPI version Coverage Status

An important message about this project

Hi Django Fiber enthusiasts! This project was started by the people at Ride The Pony, Leukeleu and Jouw Omgeving. They started Django Fiber in 2011, because they wanted a good, simple Django CMS available. Lots of people felt the same, which was why Django Fiber became pretty popular. And it is still going strong in lots of sites, so we hear :)

Later, they discovered Wagtail, and found it to be even better than their own creation. So they decided to move on. Nevertheless, Django Fiber was popular, used in many websites, and they didn't want to just drop it. At the start of 2017 they handed over control of the project to a new group of maintainers - the discussion about this handover can be found in issue #244.

Currently Django Fiber is in 'maintenance mode'. What this means it that it will be updated to run with the latest releases of Django - and of other packages that Django Fiber depends on. However, no effort will be made to add new features.

If a user really wants a new feature added - then a well-written PR will be reviewed and considered. But other than that, Django Fiber is staying exactly as it is :)

About Django Fiber

Do you want to see a Django Fiber screencast, to get a feel for what it can do for you? Check it out on Vimeo

Convinced? Want to use Django Fiber in your own Django project? Then follow the instructions below.

Requirements

These dependencies are automatically installed:

Pillow>=2.2.1
django-mptt>=0.8
django_compressor>=2.0
djangorestframework>=3.4
easy-thumbnails>=2.2

Installation

We're assuming you are using Django 1.9-2.0. Then simply install Fiber using pip:

$ pip install django-fiber

Setup

Open settings.py and add the following to your INSTALLED_APPS

INSTALLED_APPS = (
     'mptt',
     'compressor',
     'easy_thumbnails',
     'fiber',
     ...
)

Add Fiber to the MIDDLEWARE_CLASSES list

import django.conf.global_settings as DEFAULT_SETTINGS

MIDDLEWARE_CLASSES = DEFAULT_SETTINGS.MIDDLEWARE_CLASSES + (
    'fiber.middleware.ObfuscateEmailAddressMiddleware',
    'fiber.middleware.AdminPageMiddleware',
    ...
)

(Or, add the same items to MIDDLEWARE if you are using Django 1.10 or later.)

Add the request context processor

TEMPLATES = [
    {
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.request',
                ...
            ]
        }
        ...
    },
]

And configure compressor

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

STATIC_ROOT = os.path.join(BASE_DIR, 'static')
STATIC_URL = '/static/'
STATICFILES_FINDERS = DEFAULT_SETTINGS.STATICFILES_FINDERS + [
    'compressor.finders.CompressorFinder',
]

Edit your urls.py to add the Fiber site to your url-patterns

from django.urls import include, path, re_path
from fiber.views import page

urlpatterns = [
    ...
    path('api/v2/', include('fiber.rest_api.urls')),
    path('admin/fiber/', include('fiber.admin_urls')),
    ...
    re_path('', page),
]

Post-installation

Create database tables:

$ python manage.py migrate

All static Fiber files need to be symlinked in (or copied to) your static files folder if you're not on your dev machine:

$ python manage.py collectstatic --link

Further documentation

For further usage and configuration details take a look at our documentation project at readthedocs.

Changelog

See CHANGELOG.md for the latest changes.

django-fiber's People

Contributors

153957 avatar airtonix avatar bashu avatar bheesink avatar bsimons avatar chrisclark avatar dbunskoek avatar dependabot[bot] avatar jaap3 avatar maartendraijer avatar markotibold avatar mvdwaeter avatar pirandig avatar ramonakira avatar rcsheets avatar richardbarran avatar robertquitt avatar ryuusenshi avatar selwin avatar spookylukey avatar vdboor avatar vladyslav2 avatar

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

django-fiber's Issues

Javascript incompatability issue?

Whenever I open the admin panel on the front end, I get a strange javascript error in the log: “Uncaught SyntaxError: Unexpected token ,”

Here's a link to the project template: https://github.com/octaflop/Zoot/blob/master/app/pages/templates/base.html#L48

I'm a bit of a javascript newb, so I have no idea what's causing this error. I'm pretty sure it's the reason I can't make any edits on the frontend and/or see the add to page button (django-fiber-example works just fine).

Can't add contents on not fiber pages

I try to use this tag in a not fiber page {% show_content "registration_footer" %} but i don't see anything on the page.
I also try to use show_content_page but the result is the same.
On a fiber page all works fine (i can add a "block" clicking on the plus icon)

Can't edit ContentItems on not-fiber pages

If a page is not a fiber Page and i have a ContentItem on it (templatetag show_content), Firebug throws:

uncaught exception: Invalid JSON: {"type": "content_item", "id": 4, "url": "/admin/fiber/fiber_admin/fiber/contentitem/4/", "add_url": "invalid: ContentItem.get_add_url", "page_id": invalid: fiber_page.id, "block_name": "invalid: fiber_block_name"}

and ContentItems are not editable on that Page.

Remove dependency on PIL

I installed django-fiber-example and I noticed that the installation of PIL took the most time.

It would be nice if PIL was an optional requirement. PIL is quite big and also contains c-code I believe.

RFC: Multisite Fiber (django.contrib.sites)

I need to use fiber with django.contrib.sites. I think i'll use a ManyToMany between Page and Site, and i won't change ContentItem.

What do you think? Do you like this solution? Can it be pulled in you repo or not?

Image resize

Are there any plans on resizing uploaded images so that they don't exceed the width of the content part?

Don't show edit interface on non-fiber pages

I can add "exclude urls" to my settings to keep the edit interface from showing up, but I'd rather see that fiber only shows that interface on actual fiber pages.

That also fits better with fiber's philosophy of not intruding on the rest of the site :-)

(In practice: I've got a map application that uses the full width of the screen and fiber's edit interface mucks up my layout).

hidden class on admin sidebar

I'm trying out fiber for the first time and I was using it with https://github.com/paulirish/html5-boilerplate -- which has a general .hidden class defined as {display:none; visibility:hidden} (https://github.com/paulirish/html5-boilerplate/blob/master/css/style.css#L186). So when I toggle the sidebar, the toggle button is disappearing as well.

Obviously I can change that class name in the boilerplate when working with fiber, but I was thinking it might be better for fiber to use a different class for that, since 'hidden' is a bit generic whereas fiber is using it for something pretty specific. Either that or explicitly state {display:block; visibility:visible} in your CSS.

Remove django-staticfiles from dependencies

Since Django==1.3 is out for a while now (since March, 2011) and I like to encourage people to use django==1.3 I would suggest to remove the dependency django-staticfiles from Fiber.

In the Readme you could add if a user wants to use Django==1.2.x it should also manually install django-staticfiles.

What does the 'protected' field do?

I have been digging through the source code but I can't find any implementation of the following field of the ContentItem model:

protected = models.BooleanField(_('protected'), default=False)

Why is it there and what does it do?

Offtopic edit: and is there any chance you will be joining #django-fiber on Freenode again? :-)

Sandboxing of fiber dom elements

Before fiber was released I worked on my own implementation of a frontend admin. My first version was using a technique similar to fiber, manipulating existing DOM and injecting stuff.

The problem with this technique is that everything is global, so the site's styles can override fiber's styles and the same is true for JavaScript.

The problem became apparent when I started using it on larger projects with multiple third party plugins and their CSS/JS. I encountered nasty namespace clashes which let me no choices to either change code in my front-admin or fork the third party project and fix it. Needless to say it quickly became a maintenance nightmare.

The ideal solution would of course to be able to use the Shadow DOM, but unfortunately this is not possible.

The closest thing I found to really sandbox my frontadmin and prevent any site level CSS or JavaScript to mess with it was to use iframes. So this is what I did for the second generation of my frontadmin and it works surprisingly well.

I don't know if this could work for fiber, but this is definitely a nice to have.

Less intrusive url than /api

Django-fiber requires its api to be mounted as /api/v1. /api is very generic and it is what we use in at least one spot to mount our website's own api.

=> Perhaps rename it to /fiberapi/ ?

Too many DB queries

I have a menu:

{% show_menu "mainmenu" 1 2 %}

This generates 4 identical SQL queries (seen with django-debug-toolbar):

SELECT "fiber_page"."id", "fiber_page"."created", "fiber_page"."updated", "fiber_page"."parent_id", "fiber_page"."title", "fiber_page"."url", "fiber_page"."redirect_page_id", "fiber_page"."mark_current_regexes", "fiber_page"."template_name", "fiber_page"."show_in_menu", "fiber_page"."protected", "fiber_page"."metadata", "fiber_page"."lft", "fiber_page"."rght", "fiber_page"."tree_id", "fiber_page"."level" FROM "fiber_page" WHERE "fiber_page"."id" = 3

Let me know if you can't replicate this.

"response_change_form.form is undefined" when used with django debug toolbar

There's probably something wrong in my setup or order of packages or middleware or so, but I'm getting "response_change_form.form is undefined" when saving edits in fiber. The change itself submits just fine and when I reload the page, the change is there. But the edit popup never goes away and the spinner just keeps spinning.

Without django debug toolbar, the problem goes away. So there's something going wrong in the combination.

But... django debug toolbar is pretty much standard, so I guess there's something wrong in my setup. Any hints welcome.

Take proper action upon 401 HTTP response for ajax requests

When a user is not logged in but has a front admin dialog open and click save, unwanted things happens. Like closing the window letting the user think it has been saved (while leaving the overlay) or simply doing nothing (image upload).

Since fiber ships with a login dialog, I think it should be fairly easy to open it when such responses occur.

Caught UncompressableFileError while rendering: 'fiber/js/jquery-1.5.2.min.js' isn't accesible via COMPRESS_URL ('/static/') and can't be compressed

I've seen there's a closed issue about this.
I've upgraded django-fiber but the problem remains.

I'm using Python 2.7, Django 1.3, on Windows 7.

Here's the stack trace:

Environment:

Request Method: GET
Request URL: http://localhost:8080/exams/

Django Version: 1.3
Python Version: 2.7.2
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'django.contrib.staticfiles',
'piston',
'mptt',
'compressor',
'fiber',
'exams']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'fiber.middleware.ObfuscateEmailAddressMiddleware',
'fiber.middleware.AdminPageMiddleware',
'fiber.middleware.PageFallbackMiddleware')

Template error:
In template c:\work_apps\python27\lib\site-packages\fiber\templates\fiber\header.html, error at line 5
Caught UncompressableFileError while rendering: 'fiber/js/jquery-1.5.2.min.js' isn't accesible via COMPRESS_URL ('/static/') and can't be compressed
1 : {% load compress %}
2 :
3 : <script src="{% url django.views.i18n.javascript_catalog %}" type="text/javascript"></script>
4 :
5 : {% compress js %}
6 : <script type="text/javascript">
7 : var LANGUAGE_CODE = '{{ LANGUAGE_CODE }}'
8 : var STATIC_URL = '{{ STATIC_URL }}';
9 : var BACKEND_BASE_URL = '{{ BACKEND_BASE_URL }}';
10 : var FIBER_LOGIN_URL = '{{ FIBER_LOGIN_URL }}';
11 : </script>
12 : <script src="{{ STATIC_URL }}fiber/js/jquery-1.5.2.min.js" type="text/javascript"></script>
13 :
14 : <script src="{{ STATIC_URL }}fiber/js/simple-javascript-inheritance.js" type="text/javascript"></script>
15 : <script src="{{ STATIC_URL }}fiber/js/jquery.dataset.js" type="text/javascript"></script>

Traceback:
File "C:\work_apps\Python27\lib\site-packages\django\core\handlers\base.py" in get_response

  1.             response = middleware_method(request, response)
    
    File "C:\work_apps\Python27\lib\site-packages\fiber\middleware.py" in process_response
  2.                     self.get_header_html(request),
    
    File "C:\work_apps\Python27\lib\site-packages\fiber\middleware.py" in get_header_html
  3.     return t.render(c)
    
    File "C:\work_apps\Python27\lib\site-packages\django\template\base.py" in render
  4.         return self._render(context)
    
    File "C:\work_apps\Python27\lib\site-packages\django\template\base.py" in _render
  5.     return self.nodelist.render(context)
    
    File "C:\work_apps\Python27\lib\site-packages\django\template\base.py" in render
  6.             bits.append(self.render_node(node, context))
    
    File "C:\work_apps\Python27\lib\site-packages\django\template\debug.py" in render_node
  7.         result = node.render(context)
    
    File "C:\work_apps\Python27\lib\site-packages\compressor\templatetags\compress.py" in render
  8.     rendered_output = compressor.output(self.mode, forced=forced)
    
    File "C:\work_apps\Python27\lib\site-packages\compressor\base.py" in output
  9.     verbatim_content, rendered_content = self.filtered_input(mode)
    
    File "C:\work_apps\Python27\lib\site-packages\compressor\utils\decorators.py" in call
  10.         value = self.func(_args, *_kwargs)
    
    File "C:\work_apps\Python27\lib\site-packages\compressor\base.py" in filtered_input
  11.     for mode, hunk in self.hunks(mode):
    
    File "C:\work_apps\Python27\lib\site-packages\compressor\base.py" in hunks
  12.     for kind, value, basename, elem in self.split_contents():
    
    File "C:\work_apps\Python27\lib\site-packages\compressor\js.py" in split_contents
  13.             basename = self.get_basename(attribs['src'])
    
    File "C:\work_apps\Python27\lib\site-packages\compressor\base.py" in get_basename
  14.                                       "compressed" % (url, base_url))
    

Exception Type: TemplateSyntaxError at /exams/
Exception Value: Caught UncompressableFileError while rendering: 'fiber/js/jquery-1.5.2.min.js' isn't accesible via COMPRESS_URL ('/static/') and can't be compressed

And my settings:

Setting Value
COMPRESS_URL
'/static/'
COMPRESS_OUTPUT_DIR
'CACHE'
IGNORABLE_404_STARTS
('/cgi-bin/', '/vti_bin', '/vti_inf')
USE_L10N
False
COMPRESS_DATA_URI_MAX_SIZE
1024
LANGUAGE_CODE
'pt-PT'
ROOT_URLCONF
'evaluation.urls'
MANAGERS
()
COMPRESS_CSS_HASHING_METHOD
'mtime'
BASE_DIR
'C:\work\projectos\django\evaluation\evaluation'
DEFAULT_CHARSET
'utf-8'
STATIC_ROOT
'C:\work\projectos\django\evaluation\evaluation\static'
COMPRESS_CLOSURE_COMPILER_ARGUMENTS
''
USE_THOUSAND_SEPARATOR
False
MESSAGE_STORAGE
'django.contrib.messages.storage.user_messages.LegacyFallbackStorage'
DATABASE_HOST
''
EMAIL_SUBJECT_PREFIX
'[Django] '
SEND_BROKEN_LINK_EMAILS
False
URL_VALIDATOR_USER_AGENT
'Django/1.3 (http://www.djangoproject.com)'
STATICFILES_FINDERS
('django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
'django.contrib.staticfiles.finders.DefaultStorageFinder',
'compressor.finders.CompressorFinder')
COMPRESS_CSSTIDY_ARGUMENTS
'--template=highest'
SESSION_COOKIE_DOMAIN
None
SESSION_COOKIE_NAME
'sessionid'
ADMIN_FOR
()
TIME_INPUT_FORMATS
('%H:%M:%S', '%H:%M')
DATABASES
{'default': {'ENGINE': 'django.db.backends.mysql',
'HOST': 'localhost',
'NAME': 'evaluation',
'OPTIONS': {},
'PASSWORD': '*******************
',
'PORT': '',
'TEST_CHARSET': None,
'TEST_COLLATION': None,
'TEST_MIRROR': None,
'TEST_NAME': None,
'TIME_ZONE': 'Europe/Lisbon',
'USER': 'eval_user'}}
TEST_DATABASE_NAME
None
COMPRESS_YUI_BINARY
'java -jar yuicompressor.jar'
FILE_UPLOAD_PERMISSIONS
None
FILE_UPLOAD_HANDLERS
('django.core.files.uploadhandler.MemoryFileUploadHandler',
'django.core.files.uploadhandler.TemporaryFileUploadHandler')
DEFAULT_CONTENT_TYPE
'text/html'
COMPRESS_CSS_COMPRESSOR
'compressor.css.CssCompressor'
APPEND_SLASH
True
FIRST_DAY_OF_WEEK
0
DATABASE_ROUTERS
[]
YEAR_MONTH_FORMAT
'F Y'
COMPRESS_OFFLINE_TIMEOUT
31536000
STATICFILES_STORAGE
'django.contrib.staticfiles.storage.StaticFilesStorage'
CACHES
{'default': {'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
'LOCATION': ''}}
SERVER_EMAIL
'root@localhost'
SESSION_COOKIE_PATH
'/'
COMPRESS_PARSER
'compressor.parser.AutoSelectParser'
IGNORABLE_404_ENDS
('mail.pl', 'mailform.pl', 'mail.cgi', 'mailform.cgi', 'favicon.ico', '.php')
COMPRESS_CACHE_BACKEND
'default'
MIDDLEWARE_CLASSES
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'fiber.middleware.ObfuscateEmailAddressMiddleware',
'fiber.middleware.AdminPageMiddleware',
'fiber.middleware.PageFallbackMiddleware')
USE_I18N
False
THOUSAND_SEPARATOR
','
SECRET_KEY
'**
'
LANGUAGE_COOKIE_NAME
'django_language'
DEFAULT_INDEX_TABLESPACE
''
TRANSACTIONS_MANAGED
False
LOGGING_CONFIG
'django.utils.log.dictConfig'
TEMPLATE_LOADERS
('django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader')
TEMPLATE_DEBUG
True
CSRF_COOKIE_NAME
'csrftoken'
TEST_DATABASE_COLLATION
None
FORCE_SCRIPT_NAME
None
CACHE_BACKEND
'locmem://'
COMPRESS_CSSTIDY_BINARY
'csstidy'
SESSION_COOKIE_SECURE
False
COMPRESS_DEBUG_TOGGLE
'None'
COMPRESS_VERBOSE
False
CSRF_COOKIE_DOMAIN
None
FILE_CHARSET
'utf-8'
DEBUG
True
SESSION_FILE_PATH
None
COMPRESS_JS_FILTERS
['compressor.filters.jsmin.JSMinFilter']
DEFAULT_FILE_STORAGE
'django.core.files.storage.FileSystemStorage'
INSTALLED_APPS
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'django.contrib.staticfiles',
'piston',
'mptt',
'compressor',
'fiber',
'exams']
LANGUAGES_BIDI
('he', 'ar', 'fa')
DATABASE_ENGINE
''
COMPRESS_YUI_CSS_ARGUMENTS
''
DATABASE_NAME
''
COMMENTS_FIRST_FEW
0
PREPEND_WWW
False
TEST_DATABASE_CHARSET
None
SESSION_COOKIE_HTTPONLY
False
DATABASE_PORT
''
DEBUG_PROPAGATE_EXCEPTIONS
False
MONTH_DAY_FORMAT
'F j'
LOGIN_URL
'/accounts/login/'
SESSION_EXPIRE_AT_BROWSER_CLOSE
False
TIME_FORMAT
'P'
COMPRESS_STORAGE
'compressor.storage.CompressorFileStorage'
DATE_INPUT_FORMATS
('%Y-%m-%d',
'%m/%d/%Y',
'%m/%d/%y',
'%b %d %Y',
'%b %d, %Y',
'%d %b %Y',
'%d %b, %Y',
'%B %d %Y',
'%B %d, %Y',
'%d %B %Y',
'%d %B, %Y')
COMPRESS_CSS_FILTERS
['compressor.filters.css_default.CssAbsoluteFilter']
AUTHENTICATION_BACKENDS
('evaluation.auth_backends.ExamUserModelBackend',)
EMAIL_HOST_PASSWORD
'**
'
COMPRESS_REBUILD_TIMEOUT
2592000
PASSWORD_RESET_TIMEOUT_DAYS
'**
'
CACHE_MIDDLEWARE_ALIAS
'default'
SESSION_SAVE_EVERY_REQUEST
False
ADMIN_MEDIA_PREFIX
'/static/admin/'
NUMBER_GROUPING
0
SESSION_ENGINE
'django.contrib.sessions.backends.db'
CSRF_FAILURE_VIEW
'django.views.csrf.csrf_failure'
COMMENTS_SKETCHY_USERS_GROUP
None
COMPRESS_CACHE_KEY_FUNCTION
'compressor.cache.simple_cachekey'
LOGIN_REDIRECT_URL
'/accounts/profile/'
DECIMAL_SEPARATOR
'.'
COMPRESS_PRECOMPILERS
()
COMPRESS_MTIME_DELAY
10
SITE_ID
1
LOCALE_PATHS
()
TEMPLATE_STRING_IF_INVALID
''
COMMENTS_ALLOW_PROFANITIES
False
LOGOUT_URL
'/accounts/logout/'
EMAIL_USE_TLS
False
TEMPLATE_DIRS
('/work/projectos/django/evaluation/evaluation/static/templates/',
'/work/projectos/django/evaluation/evaluation/static/templates/default')
FIXTURE_DIRS
()
EMAIL_HOST
'localhost'
DATE_FORMAT
'N j, Y'
MPTT_ADMIN_LEVEL_INDENT
30
MEDIA_ROOT
''
CUSTOM_USER_MODEL
'exams.ExamUser'
DEFAULT_SETTINGS
<module 'django.conf.global_settings' from 'C:\work_apps\Python27\lib\site-packages\django\conf\global_settings.pyc'>
ADMINS
()
FORMAT_MODULE_PATH
None
DEFAULT_FROM_EMAIL
'webmaster@localhost'
COMPRESS_ROOT
'c:\work\projectos\django\evaluation\evaluation\static'
STATICFILES_DIRS
()
MEDIA_URL
''
DATETIME_FORMAT
'N j, Y, P'
COMPRESS_YUI_JS_ARGUMENTS
''
COMPRESS_JS_COMPRESSOR
'compressor.js.JsCompressor'
DISALLOWED_USER_AGENTS
()
ALLOWED_INCLUDE_ROOTS
()
COMPRESS_MINT_DELAY
30
LOGGING
{'disable_existing_loggers': False,
'handlers': {'mail_admins': {'class': 'django.utils.log.AdminEmailHandler',
'level': 'ERROR'}},
'loggers': {'django.request': {'handlers': ['mail_admins'],
'level': 'ERROR',
'propagate': True}},
'version': 1}
SHORT_DATE_FORMAT
'm/d/Y'
DATABASE_USER
''
TEST_RUNNER
'django.test.simple.DjangoTestSuiteRunner'
COMPRESS_ENABLED
False
CACHE_MIDDLEWARE_KEY_PREFIX
''
COMPRESS_OFFLINE
False
TIME_ZONE
'Europe/Lisbon'
COMPRESS_OFFLINE_CONTEXT
{'MEDIA_URL': '', 'STATIC_URL': '/static/'}
EMAIL_BACKEND
'django.core.mail.backends.smtp.EmailBackend'
DEFAULT_TABLESPACE
''
TEMPLATE_CONTEXT_PROCESSORS
('django.core.context_processors.request',
'django.contrib.auth.context_processors.auth',
'fiber.context_processors.page_info')
SESSION_COOKIE_AGE
1209600
SETTINGS_MODULE
'evaluation.settings'
USE_ETAGS
False
LANGUAGES
(('ar', 'Arabic'),
('az', 'Azerbaijani'),
('bg', 'Bulgarian'),
('bn', 'Bengali'),
('bs', 'Bosnian'),
('ca', 'Catalan'),
('cs', 'Czech'),
('cy', 'Welsh'),
('da', 'Danish'),
('de', 'German'),
('el', 'Greek'),
('en', 'English'),
('en-gb', 'British English'),
('es', 'Spanish'),
('es-ar', 'Argentinian Spanish'),
('es-mx', 'Mexican Spanish'),
('es-ni', 'Nicaraguan Spanish'),
('et', 'Estonian'),
('eu', 'Basque'),
('fa', 'Persian'),
('fi', 'Finnish'),
('fr', 'French'),
('fy-nl', 'Frisian'),
('ga', 'Irish'),
('gl', 'Galician'),
('he', 'Hebrew'),
('hi', 'Hindi'),
('hr', 'Croatian'),
('hu', 'Hungarian'),
('id', 'Indonesian'),
('is', 'Icelandic'),
('it', 'Italian'),
('ja', 'Japanese'),
('ka', 'Georgian'),
('km', 'Khmer'),
('kn', 'Kannada'),
('ko', 'Korean'),
('lt', 'Lithuanian'),
('lv', 'Latvian'),
('mk', 'Macedonian'),
('ml', 'Malayalam'),
('mn', 'Mongolian'),
('nl', 'Dutch'),
('no', 'Norwegian'),
('nb', 'Norwegian Bokmal'),
('nn', 'Norwegian Nynorsk'),
('pa', 'Punjabi'),
('pl', 'Polish'),
('pt', 'Portuguese'),
('pt-br', 'Brazilian Portuguese'),
('ro', 'Romanian'),
('ru', 'Russian'),
('sk', 'Slovak'),
('sl', 'Slovenian'),
('sq', 'Albanian'),
('sr', 'Serbian'),
('sr-latn', 'Serbian Latin'),
('sv', 'Swedish'),
('ta', 'Tamil'),
('te', 'Telugu'),
('th', 'Thai'),
('tr', 'Turkish'),
('uk', 'Ukrainian'),
('ur', 'Urdu'),
('vi', 'Vietnamese'),
('zh-cn', 'Simplified Chinese'),
('zh-tw', 'Traditional Chinese'))
COMPRESS_CLOSURE_COMPILER_BINARY
'java -jar compiler.jar'
FILE_UPLOAD_TEMP_DIR
None
INTERNAL_IPS
()
STATIC_URL
'/static/'
EMAIL_PORT
25
SHORT_DATETIME_FORMAT
'm/d/Y P'
FILE_UPLOAD_MAX_MEMORY_SIZE
2621440
ABSOLUTE_URL_OVERRIDES
{}
DATABASE_OPTIONS
{}
CACHE_MIDDLEWARE_SECONDS
600
BANNED_IPS
()
DATETIME_INPUT_FORMATS
('%Y-%m-%d %H:%M:%S',
'%Y-%m-%d %H:%M',
'%Y-%m-%d',
'%m/%d/%Y %H:%M:%S',
'%m/%d/%Y %H:%M',
'%m/%d/%Y',
'%m/%d/%y %H:%M:%S',
'%m/%d/%y %H:%M',
'%m/%d/%y')
DATABASE_PASSWORD
'**
'
COMMENTS_MODERATORS_GROUP
None
PROFANITIES_LIST
'**
*****************'
EMAIL_HOST_USER
''
COMMENTS_BANNED_USERS_GROUP
None

Use django permissions instead of staff

The JS stuff is pretty slow and intrusive (but i like it! ;). I have a few users that are staff but with no permissions to edit Fiber Pages. I think it would be better to check permissions on Fiber models instead of the generic is_staff flag.

Non-editing mode while still logged in?

Thank you for your work on this brilliant app, I'm loving it so far!

One thing I was looking for is a way to turn off all of the front-end editing features while remaining logged into the site. I am planning to put some password protection / user privileges into the code so each user may have custom views of the same urls. But 99% of the time, users will just want to see and use their custom-made homepage, rather than having all the editing controls still available.

So, what's the best way to switch off the front-end editing / sidebar all together, while remaining logged-in, so that user-customized views can remain in effect?

Incompatible with django-mptt 0.5-pre

The folks over at django-mptt have just committed a backwards incompatible change: the TreeManager on an MPTTModel can no longer be accessed using the .tree attr; instead, TreeManager is now the default manager, accessible via .objects. I think an easy fix is to add tree = TreeManager() to the Page model. This will ensure that fiber remains compatible with 0.4.2 and 0.5 (which is due for release soon).

Codemirror for html view in editor

I'm trying to include codemirror inside the raw-html editor. If there is any interest in this functionality, i could make a pull request. Let me know please :)

request.META['QUERY_STRING'] can be None

The following line in middleware.py fails when request.META['QUERY_STRING'] is None, which can happen with mod_python.

if not (request.path.endswith('@fiber') or request.META['QUERY_STRING'].endswith('@fiber')):

Missing csrf_token on second POST when adding a page

I'm trying to bolt django-fiber onto our existing system. Of course, that's got a tad of javascript lying around, which perhaps causes the problem. Anyway, I've got the csrf middleware enabled; django 1.3; even Django's suggested javascript snippet to work around csrf issues in ajax posts.

But when I want to add a new page, I get a 403 with a missing csrf token:

[30/Jan/2012 17:20:41] "GET /static_media/fiber/js/ckeditor-3.6.2/skins/kama/icons.png HTTP/1.1" 304 0
[30/Jan/2012 17:20:41] "GET /static_media/fiber/js/ckeditor-3.6.2/plugins/styles/styles/default.js?t=B8DJ5M3 HTTP/1.1" 304 0
[30/Jan/2012 17:20:44] "POST /admin/fiber/fiber_admin/fiber/contentitem/add/ HTTP/1.1" 302 0
[30/Jan/2012 17:20:44] "GET /admin/fiber/fiber_admin/fiber/contentitem/3/ HTTP/1.1" 200 1885
[30/Jan/2012 17:20:45] "GET /admin/fiber/fiber_admin/jsi18n/ HTTP/1.1" 200 1689
[30/Jan/2012 17:20:45] "GET /jsi18n/ HTTP/1.1" 200 745
[30/Jan/2012 17:20:47] "GET /static_media/fiber/js/ckeditor-3.6.2/config.js?t=B8DJ5M3 HTTP/1.1" 304 0
WARNING Forbidden (CSRF token missing or incorrect.): /api/v1/page_content_items/
[30/Jan/2012 17:20:47] "POST /api/v1/page_content_items/ HTTP/1.1" 403 2332

The strange thing is that it is the second POST that fails, the first one is OK. I see a csrf token in the first request, but not in the second.

So... am I doing something wrong? I didn't see an issue mentioning this, so probably it is me :-)

When to show menu-items?

For most websites I create a 'Login' page (and menu-item), and I find it quite annoying that I can't hide this menu-item when a user is logged in already.

So I think there should be an option to hide a menu-item when a user is logged in (most likely only for non-staff logged in users).

What probably would be even better is to create a selectbox or something per page with options when to show a page in the menu as follows:

[ ] Always
[ ] Only to guests
[ ] Only to logged in users
[ ] Never

What are your views on this?

Template parameter for {% show_menu %} tag

For this last project I wanted to include images within my menu. Therefor I had to change/overwrite the templates/fiber/menu.html template.

I think it should be better if the {% show_menu %} templatetag gets an addition template parameter, which defaults to templates/fiber/menu.html.

This way you can easily use your own templates for rendering the menu.

i18n

Is it possible to have content translatable ?

How do i use my own views on fiber-pages?

I'm trying to build a site with fiber. I currently created all basic pages, now i'm at the point i would like to render some agenda-items on the agenda page. Crawling the web for like an hour or two know, although this isn't a issue in the software (i hope), it's and issue for me the documentation isn't saying anything about this at all.

From 'Reinout van Rees' website, i got Quote: "Custom pieces of content (like a list of blog items) can be either a custom view or an extra context processor."'

Now i used my view_name in the Template field, that didnt work. I tried to use a template extension, and render that from my custom view, in which i threw
{% load fiber_tags %}
{% block content %}
{% show_content "monkey" %}
{% endblock %}
Actually that works (after linking it to my urls), but gets it out of the CMS.

My question is simple:
How do i render some context to a specific fiber page?
If i use a 'custom view', then that 'page' isnt manageable from fiber, is it? -> what is the best approach?

Use a catch-all in urls.py instead of PageFallbackMiddleware

The use of PageFallbackMiddleware is sub-optimal in a number of ways:

  • it means that you have to render the 404 template on every page, before discarding it and then rendering the normal output.
  • it means you need the @csrf_protect hack on the page view, and any other view middleware are also affected.
  • it means that if you have some other page which deliberately throws a 404 (e.g. the admin when an object doesn't exist), you trigger the overhead of then looking for a fiber which will match. This could occasionally be useful, but usually it is just unhelpful overhead
  • you get a really unhelpful 500 error for every page if you forget to create a 404 template. This error only shows with DEBUG=False, so is hard to debug.

Is there a reason for this design choice? I know that Django had/has a flatpages middleware that does the same thing, but that too is a mistake IMO.

It is almost possible to use the existing 'fiber.views.page' view directly from urls.py, but the URLs in the DB are all different by a leading '/'. The following does work as a minimal urls.py, without any need for the middleware, and without changing existing code or database:

def fiber_page(request):
    from fiber.views import page
    return page(request, request.path_info)

urlpatterns = patterns('',
                       (r'^api/v1/', include('fiber.api.urls')),
                       (r'^admin/fiber/', include('fiber.admin_urls')),
                       (r'^jsi18n/$', 'django.views.i18n.javascript_catalog', {'packages': ('fiber',),}),
                       url(r'^admin/', include(admin.site.urls)),
                       (r'', fiber_page),
)

I would propose removing PageFallbackMiddleware, and changing the fiber.views.page so that it starts like this:

def page(request):
    url = request.path_info
    if not url.endswith('/') and settings.APPEND_SLASH ...

and documenting that you need to install it in your urls.

Alternatively, there is the more compatible route that just deprecates PageFallbackMiddleware.

File upload fails with 401 response and logs out user

If I try to upload an image from the frontend dialog, piston returns a 401 HTTP response (I've only tested with the latest code from git hub).

From the request I see in console, it seems this is probably caused by a missing sessionid parameter:

"POST /api/v1/images/?sessionid=null&qqfile=test.jpg HTTP/1.1" 401 0

After this request the user is automatically logged out..

Obviously it works fine if the image is uploaded using the classical admin.

I get the same result in Firefox and Chrome, it seems the cookie is never set. After login with the admin, I return to the front site and type this in firebug after a page refresh:

jQuery.cookie('sessionid')
null

CKEditor Custom Settings!?

When one is editing a fibre content either through back end admin or front end the styles sheets of course are not loaded, how can one specify custom CKEditor settings? Per content not per page, so one can add 'custom' client templates for example per content chunk.

What's the deal with the fiber_admin?

I noticed that in /admin/fiber/page/add/ , FIBER_TEMPLATE_CHOICES doesn't work - you don't get a select widget.

Tracking this down, I eventually found that there are two admins, and you only get that widget if you go to /admin/fiber/fiber_admin/

This URL isn't documented anywhere, and it isn't the admin that is switched to when you do the 'backend' switch.

So, I'm confused. How is this supposed to work?

Doc suggestion: how to extend fiber with news items

The advanced usage doc has a short section on "using a news template and showing newsitems there", but not how to actually integrate it. You probably have a couple of examples lying around, so perhaps you could show some sample code?

Newsitems are a good example. Some of the questions I have after reading the advanced usage doc:

  • Newsitem as completely separate models? Or subclass of Page or ContentItem? Should it contain contentitems?
  • Can you hook it up somehow in the nice edit interface? Or is that out of scope for fiber?
  • How to inject a list of most recent newsitems in a fiber page? Should you do it with a template or can you also do it as a contentitem?

content holder names

Firstly great work, nice concept and great for simple sites.

The DragDrop interface would be greatly aided if one were able to see the names of what content items are being dropped into; in some cases there content blocks that are fairly close together and certain users are getting confused.

Will try make a patch available if this becomes a big mission :)

Logo?

While writing content for a webpage, I didn't find any suitable graphics or logo to describe Django Fiber, so I created this.

It needs some refinements but if you want to use it, fell free to do so. If you wan't to refine it I'll send you the SVG.

Absolute imports instead of relative ones.

In fiber/views.py, I see "from models import Page".

It is clearer (and much safer in the end) to change them all into absolute imports: "from fiber.models import Page". In later Python versions this will be required, btw.

PEP 8: Style Guide for Python Code

I don't want to be a "style nazy" but when i was copy/paste'ing from your README i noticed this and i want to just point out for better codding/documenting style:

From PEP8:

Use 4 spaces per indentation level.

For really old code that you don't want to mess up, you can continue to use 8-space tabs.

P.S. Its not an old code...

http://www.python.org/dev/peps/pep-0008/

The test_move test fails (and one test is skipped)

See below:

======================================================================
ERROR: test_move (fiber.tests.PageContentItemTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/mnt/hgfs/aluminum/virtualenvs/fiber_example/src/django-fiber/fiber/tests.py", line 267, in test_move
    PageContentItem.objects.move(item_a, item_c)
AttributeError: 'Manager' object has no attribute 'move'

----------------------------------------------------------------------
Ran 483 tests in 13.055s

FAILED (errors=1, skipped=1)

This issue is related to pull request #82, which is currently placed in the dev branch

Adding a content item takes a long time

Is this because of the split in create and move? Or is it caused by serializing too much objects?

This issue is related to pull request #82, which is currently placed in the dev branch

jsi18n and django compressor

If i enable the compression with COMPRESS=True i get:

Caught UncompressableFileError while rendering: '/jsi18n/' isn't accesible via COMPRESS_URL ('/static/') and can't be compressed

in header.html. If i set COMPRESS_URL='/' then i get:

Caught UncompressableFileError while rendering: 'jsi18n/' could not be found in the COMPRESS_ROOT

Is jsi18n supposed to be under django-compressor? Can i bring it out?

Incompatibility with django-filebrowser

If you connect with django-filebrovser with django-fiber, button "Upload" won't work. The problem is somewhere in fiber.middleware.AdminPageMiddleware:

response.content = self.body_re.sub(
                r"<head>\g<IN_HEAD>%s</head>\g<AFTER_HEAD><body data-fiber-data='%s'\g<IN_BODY_TAG>>\g<BODY_CONTENTS></body>" % (
                    self.get_header_html(request),
                    simplejson.dumps(fiber_data),
                ),
                smart_unicode(response.content)
)

You can make a diff between the output html:

I'm looking for a solution. Temporary solution:

if "/filebrowser/upload/" in request.META["PATH_INFO"]:
        return response

Are there ideas?

Fiber depends on wrong version of django-piston

In setup.py there is a requirement for "django-piston==0.2.3rc1'.

However, 0.2.3 was released on 2011-11-01 and now 0.2.3rc1 can't be downloaded anymore. So right now I can't install Fiber.

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.