Code Monkey home page Code Monkey logo

django-faq's Introduction

Django-FAQ

This is a simple FAQ application for a Django powered site. This app follows several "best practices" for reusable apps by allowing for template overrides and extra_context arguments and such.

Features

Question Headers can be created that can be used to group related questions into sections.

Questions can be "protected" in which case they are only presented to authenticated users.

There are some saved FAQs in a fixture named initial_data.json that provide the example apps with some questions to view when you bring them up for the first time. These FAQs provide additional notes about installing and using django-faq.

There is a SubmitFAQForm defined that you can use to allow site visitors to submit new questions and/or answers to the site administrator for consideration. All submitted questions are added as "inactive" and so it is up to the administrator to edit, activate or discard the question as well as set its' sort_order field and slug to reasonable values.

Requirements

Django 1.3, Python 2.5 or greater.

Installation

  1. pip install -e git://github.com/howiworkdaily/django-faq.git#egg=django_faq

  2. Add "faq" to your INSTALLED_APPS setting.

  3. Wire up the FAQ views by adding a line to your URLconf:

    url('^faq/', include('faq.urls'))
    

Note: do not use pip install django-faq to install this app, as that currently grabs another package entirely.

If you want to customize the templates then either create an 'faq' directory in your projects templates location, or you can also pass along custom 'template_name' arguments by creating your own view wrappers around the 'faq' app views. I show how to do the latter in the 'example' project included - look at the views.py file to see the details.

If you'd like to load some example data then run python manage.py loaddata faq_test_data.json

Example Site

There is a stand-alone example site in the example directory. To try it out:

  1. Install django-faq (see above).
  2. Run python manage.py syncdb (This assumes that sqlite3 is available; if not you'll need to change the DATABASES setting first.)
  3. If you'd like to load some example data then run python manage.py loaddata faq_test_data.json
  4. Run python manage.py runserver and you will have the example site up and running. The home page will have links to get to the available views as well as to the admin.

After logging into the admin you will notice an additional question appears in the FAQ. That question is "protected" and therefore not presented to non-authenticated users.

The capability to submit an FAQ is available and works whether or not you are a logged in user. Note that a staff member will have to use the admin and review any submitted FAQs and clean them up and set them to active before they are viewable by the end user views.

django-faq's People

Contributors

brosner avatar dulacp avatar howiworkdaily avatar ipmb avatar jacobian avatar jezdez avatar mikek avatar montylounge avatar rockhoward 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

django-faq's Issues

Django 1.4 Compatibility

Use of django.contrib.auth.get_user_model brokes compatibility with Django 1.4.
I Think it can be easily fixed just by checking django version before use get_user_model.
Cheers!
Matías.

No FAQ = error

when there are no FAQ objects, there is an error. This should be handled a bit better.

Fixture data faq_test_data.json fails to load

  • Python2.7 and Django 1.3 on Ubuntu 10.10 (Maverick Meerkat).
  • Cloned git repo.
  • cd django-faq/example
  • python manage.py syncdb (created admin user when asked)
  • python manage.py loaddata ../faq/fixtures/faq_test_data.json produces:

Problem installing fixture '../faq/fixtures/faq_test_data.json': Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/Django-1.3-py2.7.egg/django/core/management/commands/loaddata.py", line 169, in handle
for obj in objects:
File "/usr/local/lib/python2.7/dist-packages/Django-1.3-py2.7.egg/django/core/serializers/json.py", line 35, in Deserializer
for obj in PythonDeserializer(simplejson.load(stream), **options):
File "/usr/local/lib/python2.7/dist-packages/Django-1.3-py2.7.egg/django/core/serializers/python.py", line 93, in Deserializer
field = Model._meta.get_field(field_name)
File "/usr/local/lib/python2.7/dist-packages/Django-1.3-py2.7.egg/django/db/models/options.py", line 289, in get_field
raise FieldDoesNotExist('%s has no field named %r' % (self.object_name, name))
FieldDoesNotExist: Topic has no field named 'sort_order'

A possibly related problem (?). After this failure, 'rm faq.db' and 'python manage.py syncdb' to create a fresh one (just in case), then:

TemplateSyntaxError at /

'faqtags' is not a valid tag library: Template library faqtags not found, tried django.templatetags.faqtags,django.contrib.admin.templatetags.faqtags

However, ~/django-faq/faq/templatetags/faqtags.py (and .../init.py) do exist.

setup fails

error on linux system is

error: can't copy 'faq/faq': doesn't exist or not a regular file

faq is actually a link to itself. Why, I don't know.

pypi release ?

HI!

Stumbled upon this app this afternoon and i like it quite a bit. Does a simple job and does it well. I want to use it and have a few minor tweaks in mind i'll gladly contribute.

Something confuses me, tho:
Why isn't this on pypi ? If i use it in my project, i'd rather have my requirements.txt pointing at some specific release than to the github repo.

I saw a fork of the project, django-fack, is available there. Should this one be considered the currently active one, and the one i should follow if i want to get involved ?

License?

I don't see any mention of what license this has been released under. I'm assuming BSD, but it would be nice if it was noted somewhere in the README. Thanks!

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.