Giter VIP home page Giter VIP logo

awi's Introduction

Lupinia Website (Awi)

Full website for Lupinia Studios, built with Django. The site can be viewed at www.lupinia.net.

Built by Natasha L. (@lupinia)

Apps/Modules Included

  • System/Structure
    • Awi Access: Unified access control, permissions, and ownership settings for any object.
    • Awi Error: Unified error text handling/template tags.
    • DeerFind: Intelligent 404 handler.
  • Main Content
    • DeerTrees: Multi-level object-agnostic category system.
    • DeerBooks: Enhanced text/writing management, with multi-format display (HTML, Markdown, Plain Text, LaTeX), and automatic generation of PDF, DVI, and PostScript files from dynamically-generated LaTeX source.
    • DeerConnect: Link directory and contact information manager, with email form.
    • Sunset: Advanced image gallery, with built-in watermarking, metadata parsing, hash-based de-duplication, and batch imports from server-side directories. Also provides dynamic background images for page body site-wide.
  • Second Life Systems/Content
    • GridUtils: Standard models, views, and utility functions for common data types and structures used in Second Life and other virtual worlds.
    • DeerGuard SL: Security/authentication system for LSL scripted systems in Second Life and other virtual worlds.
  • Other
    • Awi Utils: Miscellaneous core components used by multiple other modules/apps.
    • DeerAttend: Event attendance history tracker/display.
    • DeerFood: Restaurant-style menu system.
    • DeerCoins: Coin collection (numismatic) database and tools.

Third-Party Apps/Modules Used

  • BeautifulSoup: A Python library for parsing and manipulating HTML.
  • Django Admin Tools: Improvements to the Django administrative dashboard.
  • Django Cookielaw: Easy tool for compliance with EU cookie law.
  • Django Debug Toolbar: Profiling and debugging tools for Django. (Dev only)
  • Django Haystack: Powerful tool for integrating search indexing servers into Django.
  • Django Honeypot: Provides tools to reduce automated form spam.
  • Django MPTT: Provides support for a recursive traversal tree structure; used for nested categories.
  • Django MPTT Admin: Enhanced administrative interface for objects using Django MPTT
  • Django Static Precompiler: Server-side compilation of CSS from SCSS.
  • Django S3 Folder Storage: Adds Amazon S3 as a file storage provider, with the ability to use folders within the same bucket (instead of separate buckets for everything).
  • ExifTool: Advanced metadata read/write tool.
  • Highlight.js: Syntax highlighting for code displayed in HTML content.
  • HTML2Text: Library for converting HTML to Markdown.
  • JustifiedGallery: JQuery plugin for displaying a justified grid of mixed-width thumbnails.
  • MapBox: Map data.
  • Pillow: Upgraded fork of PIL (Python Imaging Library).
  • PyExifTool: Python wrapper for ExifTool.
  • Rubber: Utility for building documents from LaTeX source more easily.
  • SassC: Library for processing CSS from SCSS.

Infrastructure

  • Web Server: Nginx (seneca.lupinia.net)
  • WSGI Connector: uWSGI
  • Database Server: PostgreSQL (Amazon RDS)
  • Static/Media Hosting: Amazon S3/CloudFront (cdn.fur.vc)
  • Search Indexing Server: Amazon OpenSearch
  • Cache Server: Amazon ElastiCache (Memcached)

Custom Management Commands

  • process_images (Sunset): If images need their assets rebuilt, this will rebuild them in the background. If not, it will check batch import folders for new images to import.
  • compile_latex (DeerBooks): If document files for a page need to be built/rebuilt, this will rebuild them in the background.
  • set_cat_thumb (DeerTrees): Set the thumbnail for categories containing images.
  • cleanup_working_dir (Awi Utils): Delete unused files from the local working directories for background processes that need to perform file manipulation (compile_latex, process_images).
  • health_check (DeerConnect): Performs a HEAD request to every external link in the system, and notifies the administrator(s) if any links return a status other than 200.
  • promote_seasonal (Awi Utils): Selectively feature/unfeature certain categories based on the current month.
  • clearcache (Awi Utils): Clear Django's cache, something that Django really should have a built-in management command for.
  • no_export_deleted (DeerBooks): Sets auto_export to False on pages that have been moved to the "Trash" category, in case this wasn't already handled.

License

This project as a whole is not currently licensed for re-use, but individual components of it may be licensed and distributed separately, including apps I've built.

awi's People

Contributors

lupinia avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

outrayjus

awi's Issues

Remove/Replace Summernote

Having a WYSIWYG editor is a nice idea, but Summernote causes a LOT more problems than it solves. I may just ditch it entirely, but if I can find one that I can trust to not insert garbage markup, it'd be nice to have.

Duplicate SQL Query: Sunset (Asset Retrieval)

Getting specific assets for image objects tends to incur extra database queries; including image_assets via prefetch/select_related whenever sunset.models.image is queried should take care of this, but a method of asset retrieval other than looping image.assets.all() would be ideal. The get_object_or_None() function in django_annoying would be ideal here; I may just go with that.

Remove dependency on django-processinfo

Django-processinfo was a great app, and I still like it in some ways, but it's holding back my ability to upgrade to a newer version of Django. Therefore, it's officially causing more problems than it solves.

Update to last version of Django 1.x

I've been using Django 1.8 for way too long, and that needs to change. There are some third-party dependencies that I need to deal with before I can get this done, and probably some changes to my own code, but I can't keep putting this off any longer.

This to-do list will be modified as I explore what's needed to make this upgrade work.

  • Remove django-processinfo, or modify it
  • Investigate compatibility of django-static-precompiler
  • Add names to django.contrib.auth views
  • #68

Sunset: Enable pingback

Pingbacks aren't as popular as they used to be, but it's a feature I liked back in the days of Wordpress blogging, and there's a Django app for it. Once I get it implemented for DeerBooks (#12), I'll implement it for Sunset too.

Sunset: Custom tag for inserting image into other content

Awi v3.x had support for custom HTML-esque tags, which automatically inserted a Gallery2 image block, using pipe-separated parameters. For example, <g2>25694|photo|single</g2> would be converted to <div class="one-image"><a href="http://www.lupinia.net/photo/25694.g2"><img src="http://www.lupinia.net/gallery/25696/3.g2" width="225" height="129" class="giThumbnail" alt="Assateague-1443"/> </a> </div>.

In that version of the site, the resulting markup was coming from Gallery2, and I had little control over it. The tag I defined was simply used to insert parameters into the API query to Gallery2 which returned the resulting markup. But the concept is easy enough to implement in Django.

Fix breadcrumb title for tags with no title set

The core bug was already fixed by switching to using an object's unicode/str method instead of the title attribute specifically, I just need to implement that fix in the breadcrumb generator.

Awi Access: TypeError: 'tuple' object does not support item assignment (is_public() method)

The is_public() method has a bug that has never come up in the year or so since I implemented it, so it's quite an obscure corner case: If a model overrides that method, AND the super() call to it returns (True, ''), AND the overridden method finds a reason why something should not be public (in this case, a Sunset image that was newly uploaded and its assets had not yet been processed), the standard override template is to overwrite the value of the return of super().is_public() with new data. This does not work, because is_public() always returns a tuple.

Stack trace:

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 87, in get_exception_response
    response = callback(request, **param_dict)
  File "./deerfind/views.py", line 102, in not_found
    url_check = finder_function(request)
  File "./deerfind/views.py", line 48, in g2_finder
    access_check = gallery_check[0].image.can_view(request)
  File "./deertrees/models.py", line 174, in can_view
    public_check = self.is_public()
  File "./sunset/models.py", line 134, in is_public
    ispublic[0] = False
TypeError: 'tuple' object does not support item assignment

Awi Access: Move timestamp fields to access_control

Having these separate made sense early-on, but it makes a lot less sense now that they play an increasingly-vital role in checking .can_view and .is_public. Plus, every model that extends access_control already has these fields anyway. And shifting the timestamp-related fields and methods/properties to access_control would bring some of the more advanced functionality from DeerTrees.leaf (choice of which timestamp to display) to all models.

DeerTrees: Tag synonyms

This is mostly an issue on photos added to Sunset from Lightroom, but a method of de-duplicating tags would significantly clean up the tag list. I'm still determining how best to do this, but I'm leaning toward creating a separate model ("synonym", perhaps), and a method in the tag view for converting existing tags into synonyms of other tags.

  • Build tag_synonym model
  • Build admin shortcut to merge tags ("make synonym of")
  • Add synonym support to deertrees.models.leaf.tag_item method
  • Build 404 finder for tag synonyms
  • Build admin inline view for managing tag synonyms
  • Add synonyms to deertrees.views.tag_list (perhaps as a sidebar block)
  • Add synonyms to keywords meta tag on leaf content pages (irrelevant, since I'm apparently not using this meta tag at all)

Implement search functionality

Google does a pretty good job of crawling this site, but built-in search is crucial, and definitely something I want to add. It may require infrastructure upgrades, though; I'm not sure my server can handle ElasticSearch right now.

Admin Improvements: DeerBooks

  • export_file and toc need friendly names ("Document File" and "Book", respectively)
  • export_file:
  • timestamp_mod in list view
    • Count of page objects in list view
  • toc:
    • Help text on slug and title
    • Count of page objects in list view
  • page:
    • Help text on summary, book title, book order
    • Friendly name on docfiles field

Add Create/Update Forms for Content

The Django admin system is awesome, and it's working just fine for me as-is, but I want to add forms that are more seamless. This would also be one way to resolve #30 without major alterations to the admin views.

DeerTrees: Upgrade blocks system

The initial blocks/layout system was a reasonable first step, and it does an ok job for most cases; different types of content (leaves) have priority ratings, and different priorities based on whether they'll be in the main content area or the sidebar. However, the number of edge-cases created by this system has significantly increased the complexity; there's a special flag indicating whether the current view is the homepage, categories and tags have to have a "content priority" setting that overrides the defaults (which can cause more problems than it solves), and I still have no particularly good way of handling special cases like /photo (which should primarily show an array of all highlighted images, not just the ones in child/descendant categories).

I'm still determining what the ideal solution would look like, but I suspect it will involve replacing the content-priority setting with an option to define custom functions/classes that the category and tag views can include. I want to keep the system flexible enough to be content-agnostic, because the "folders that can contain files of any type" paradigm is very important to me, and the DeerTrees app was created to be something that any project could potentially incorporate.

Regardless, this is in the works, and may involve a rebuild of the DeerTrees app, but it's definitely an area that's not quite where I want it to be, and I feel I can do better.

DeerBooks: Enable pingback

Pingbacks aren't as popular as they used to be, but it's a feature I liked back in the days of Wordpress blogging, and there's a Django app for it. I've started the implementation, but I haven't yet finished it.

Duplicate SQL Query: Awi Access

Culprit is in awi_access.models.access_control.is_public(); it checks the current site. Views querysets that check this method need to include Sites via prefetch/select_related.

Awi Access: Content Access Codes

I want to add a method for users who can edit a particular content item to be able to generate an access code for that item, which allows anyone with the code to access it for a certain amount of time. The use-case is for showing works in progress to other people (pre-readers for long-form written work, for example) without needing to publish the item or create user accounts for those people.

Awi Error: Point visitors toward Github issues when a 500 error occurs.

All system errors generate an email notification, but it would be nice to give visitors something other than "The webmaster has been notified", because that always frustrates me when websites generate an error with no way to reach out about it. But I don't want to go to the trouble of spinning up my own issue tracker, so simply using Github for that would be ideal.

Switch from Django Admin Tools to Django Jet

My installation of Django Admin Tools is somewhat buggy, and I really like what I see in Django Jet. It's not a high priority, but it'd be nice to upgrade the site's admin views.

Shift navigation links from template file to settings dictionary

Goal: Reduce redundancy between main navigation links, since each one is effectively duplicated three times: Main navigation bar, mobile navigation menu, and footer navigation links.

However, I'm not quite sure whether this is viable, or whether this would solve more problems/complexity than it creates.

DeerFind: Unicode error when logging redirects for known pointers

Newly-discovered issue that seems to only come into play when a redirect is hit by a browser with malicious information in the browser headers (something that always fails). Dealing with that is a separate issue, but the logging for pointer objects should be able to handle Unicode browser headers regardless.

DeerTrees: Pagination

Related to #5, category/tag views desperately need pagination. Which is very difficult to do with the current system without potentially dropping entire content types off of the front page, so that will probably come with the upgrade.

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.