Code Monkey home page Code Monkey logo

django-portfolio's Introduction

django-portfolio

https://secure.travis-ci.org/dokterbob/django-portfolio.png

What's this?

An artist's portfolio as a pluggable Django app, based on the following assumptions:

  1. A portfolio consists of collections containing artworks.
  2. Artworks have one or more pictures and (optionally) a title and a description.
  3. Artworks can be listed from within collections or categories.

Features

  • Well tested, decent code coverage and used in production environments.
  • Makes good use of Django's admin; drag and drop sorting, search, filtering, pagination and thumbnail previews.
  • All strings are fully translatable (will integrate with Transifex on request, feel free to create a GitHub issue).
  • Optional template context processors and sitemaps available.
  • Very basic front-end templates to help kickstart integration.
  • South migrations available for hassle-free upgrade paths.

Contributors

Installation

  1. pip install -e https://github.com/dokterbob/django-portfolio.git#egg=django-portfolio

  2. Follow sorl-thumbnail's installation instructions.

  3. Follow django-admin-sortable's installation instructions.

  4. Add portfolio to INSTALLED_APPS.

  5. Include URL's into Django's URL space, like such:

    urlpatterns = patterns('',
        (r'^portfolio/', include('portfolio.urls')),
        ...
    )
    
  6. Have a cup of coffee! You deserve one; basic integration of the portfolio app is done now.

  7. Copy the minimal base templates from the templates folder to your project's template folder and start customizing.

  8. (Optionally) Configure sitemaps by updating your sitemaps dictionary with portfolio.sitemaps.portfolio_sitemaps.

    For example:

    from portfolio.sitemaps import portfolio_sitemaps
    
    sitemaps = {
        'blog': GenericSitemap(info_dict, priority=0.6),
    }
    
    sitemaps.update(portfolio_sitemaps)
    ...
    urlpatterns = patterns('',
        (r'^portfolio/', include('portfolio.urls')),
    
        # Sitemaps
        (r'^sitemap\.xml$', 'django.contrib.sitemaps.views.sitemap',
            {'sitemaps': sitemaps}),
    )
    
  9. (Optionally) Enable template context processors for collections, artworks and/or categories in settings.py:

    TEMPLATE_CONTEXT_PROCESSORS = (
        ...
        'portfolio.context_processors.collections',
        'portfolio.context_processors.artworks'
        'portfolio.context_processors.categories'
    )
    
  10. (Optionally) Install and configure your preferred rich text widget:

    INSTALLED_APPS = (
        ...
        # Imperavi (or tinymce) rich text editor is optional
        'imperavi',
    )
    

Known to work are django-imperavi as well as django-tinymce . Be sure to follow installation instructions for respective editors.

Template tags

1. artworks

Returns a list of artworks optionally filtered by category/collection (with offset/limit).

Arguments: * collection - (optional) Collection object, id or slug to filter artworks by collection * category - (optional) Category object, id or slug to filter artworks by category * offset - (optional) Offset for objects list (default: 0) * limit - (optional) Limit for objects list (default: 10000)

Usage example:

{% load portfolio_tags %}

{% artworks collection="featured" as artwork_list %}

2. collections

Returns a list of collections (with offset/limit).

Arguments: * offset - (optional) Offset for objects list (default: 0) * limit - (optional) Limit for objects list (default: 10000)

Usage example:

{% load portfolio_tags %}

{% collections as collection_list%}

3. categories

Returns a list of categories (with offset/limit).

Arguments: * offset - (optional) Offset for objects list (default: 0) * limit - (optional) Limit for objects list (default: 10000)

Usage example:

{% load portfolio_tags %}

{% categories as category_list %}

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.