Coder Social home page Coder Social logo

haystack-static-pages's Introduction

haystack_static_pages

Haystack Static Pages is an extension library for Haystack. Currently, it adds the ability to index static pages through the use of a settings.py variable and command extension.

Basic Usage:

  1. Setup and install Haystack.

  2. Add haystack_static_pages to your INSTALLED_APPS in settings.py

  3. Add HAYSTACK_STATIC_PAGES to your settings.py.

    eg.

    HAYSTACK\_STATIC\_PAGES = (
        'static-about_us',                        # A named url
        'static-help',                            # Another named url
        'http://www.example.com/some_page.html',  # An fully qualified url
    )
    
  4. ./manage.py syncdb to create the necessary tables.

  5. ./manage.py crawl_static_pages to populate the database with the static page content. This is needed for Haystack to properly map the urls to the content. Output should indicate which pages were crawled and where, as well as the total number of pages found. Crawled pages must be accessible through an http connection. ie., they must be viewable in a browser.

  6. ./manage.py rebuild_index to create the search indexes used by Haystack. You should see a note about how many static pages were indexed. The number of static pages indexed should match the number of static pages created in the step above.

Advanced Usage:

There are currently two command line options that can be used with the crawl_static_pages command:

-l LANG, --language=LANG
 This allows the user to specify the desired language for indexing content. Each page will include a language attribute that will correspond to the page's language as detected in the html lang attribute or 'en' if unable to be determined.
-p PORT, --port=PORT
 This allows the user to include the port number to crawl, if required.

haystack-static-pages's People

Contributors

notanumber avatar

Stargazers

 avatar

Watchers

 avatar

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.