From 3b79b3a404c43ff51ec4790f7ffb1c33833bc93d Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Wed, 16 Jun 2010 19:33:50 -0400 Subject: added sphinx documentation --- .gitignore | 1 - askbot/doc/Makefile | 130 ++++++++++++++++++++++ askbot/doc/askbot-docs.zip | Bin 0 -> 10154 bytes askbot/doc/make.bat | 155 ++++++++++++++++++++++++++ askbot/doc/source/conf.py | 253 +++++++++++++++++++++++++++++++++++++++++++ askbot/doc/source/index.rst | 258 ++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 796 insertions(+), 1 deletion(-) create mode 100644 askbot/doc/Makefile create mode 100644 askbot/doc/askbot-docs.zip create mode 100644 askbot/doc/make.bat create mode 100644 askbot/doc/source/conf.py create mode 100644 askbot/doc/source/index.rst diff --git a/.gitignore b/.gitignore index 795e011d..232c1cfd 100755 --- a/.gitignore +++ b/.gitignore @@ -12,7 +12,6 @@ settings.py env nbproject pip-log.txt -*.zip tmp/* /tmp/ /__init__.py diff --git a/askbot/doc/Makefile b/askbot/doc/Makefile new file mode 100644 index 00000000..0fe0d3db --- /dev/null +++ b/askbot/doc/Makefile @@ -0,0 +1,130 @@ +# Makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +PAPER = +BUILDDIR = build + +# Internal variables. +PAPEROPT_a4 = -D latex_paper_size=a4 +PAPEROPT_letter = -D latex_paper_size=letter +ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source + +.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest + +help: + @echo "Please use \`make ' where is one of" + @echo " html to make standalone HTML files" + @echo " dirhtml to make HTML files named index.html in directories" + @echo " singlehtml to make a single large HTML file" + @echo " pickle to make pickle files" + @echo " json to make JSON files" + @echo " htmlhelp to make HTML files and a HTML help project" + @echo " qthelp to make HTML files and a qthelp project" + @echo " devhelp to make HTML files and a Devhelp project" + @echo " epub to make an epub" + @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" + @echo " latexpdf to make LaTeX files and run them through pdflatex" + @echo " text to make text files" + @echo " man to make manual pages" + @echo " changes to make an overview of all changed/added/deprecated items" + @echo " linkcheck to check all external links for integrity" + @echo " doctest to run all doctests embedded in the documentation (if enabled)" + +clean: + -rm -rf $(BUILDDIR)/* + +html: + $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." + +dirhtml: + $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." + +singlehtml: + $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml + @echo + @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." + +pickle: + $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle + @echo + @echo "Build finished; now you can process the pickle files." + +json: + $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json + @echo + @echo "Build finished; now you can process the JSON files." + +htmlhelp: + $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp + @echo + @echo "Build finished; now you can run HTML Help Workshop with the" \ + ".hhp project file in $(BUILDDIR)/htmlhelp." + +qthelp: + $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp + @echo + @echo "Build finished; now you can run "qcollectiongenerator" with the" \ + ".qhcp project file in $(BUILDDIR)/qthelp, like this:" + @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Askbot.qhcp" + @echo "To view the help file:" + @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Askbot.qhc" + +devhelp: + $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp + @echo + @echo "Build finished." + @echo "To view the help file:" + @echo "# mkdir -p $$HOME/.local/share/devhelp/Askbot" + @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Askbot" + @echo "# devhelp" + +epub: + $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub + @echo + @echo "Build finished. The epub file is in $(BUILDDIR)/epub." + +latex: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo + @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." + @echo "Run \`make' in that directory to run these through (pdf)latex" \ + "(use \`make latexpdf' here to do that automatically)." + +latexpdf: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through pdflatex..." + make -C $(BUILDDIR)/latex all-pdf + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." + +text: + $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text + @echo + @echo "Build finished. The text files are in $(BUILDDIR)/text." + +man: + $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man + @echo + @echo "Build finished. The manual pages are in $(BUILDDIR)/man." + +changes: + $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes + @echo + @echo "The overview file is in $(BUILDDIR)/changes." + +linkcheck: + $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck + @echo + @echo "Link check complete; look for any errors in the above output " \ + "or in $(BUILDDIR)/linkcheck/output.txt." + +doctest: + $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest + @echo "Testing of doctests in the sources finished, look at the " \ + "results in $(BUILDDIR)/doctest/output.txt." diff --git a/askbot/doc/askbot-docs.zip b/askbot/doc/askbot-docs.zip new file mode 100644 index 00000000..4d3be1b5 Binary files /dev/null and b/askbot/doc/askbot-docs.zip differ diff --git a/askbot/doc/make.bat b/askbot/doc/make.bat new file mode 100644 index 00000000..880892a3 --- /dev/null +++ b/askbot/doc/make.bat @@ -0,0 +1,155 @@ +@ECHO OFF + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set BUILDDIR=build +set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% source +if NOT "%PAPER%" == "" ( + set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% +) + +if "%1" == "" goto help + +if "%1" == "help" ( + :help + echo.Please use `make ^` where ^ is one of + echo. html to make standalone HTML files + echo. dirhtml to make HTML files named index.html in directories + echo. singlehtml to make a single large HTML file + echo. pickle to make pickle files + echo. json to make JSON files + echo. htmlhelp to make HTML files and a HTML help project + echo. qthelp to make HTML files and a qthelp project + echo. devhelp to make HTML files and a Devhelp project + echo. epub to make an epub + echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter + echo. text to make text files + echo. man to make manual pages + echo. changes to make an overview over all changed/added/deprecated items + echo. linkcheck to check all external links for integrity + echo. doctest to run all doctests embedded in the documentation if enabled + goto end +) + +if "%1" == "clean" ( + for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i + del /q /s %BUILDDIR%\* + goto end +) + +if "%1" == "html" ( + %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/html. + goto end +) + +if "%1" == "dirhtml" ( + %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. + goto end +) + +if "%1" == "singlehtml" ( + %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. + goto end +) + +if "%1" == "pickle" ( + %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle + echo. + echo.Build finished; now you can process the pickle files. + goto end +) + +if "%1" == "json" ( + %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json + echo. + echo.Build finished; now you can process the JSON files. + goto end +) + +if "%1" == "htmlhelp" ( + %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp + echo. + echo.Build finished; now you can run HTML Help Workshop with the ^ +.hhp project file in %BUILDDIR%/htmlhelp. + goto end +) + +if "%1" == "qthelp" ( + %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp + echo. + echo.Build finished; now you can run "qcollectiongenerator" with the ^ +.qhcp project file in %BUILDDIR%/qthelp, like this: + echo.^> qcollectiongenerator %BUILDDIR%\qthelp\Askbot.qhcp + echo.To view the help file: + echo.^> assistant -collectionFile %BUILDDIR%\qthelp\Askbot.ghc + goto end +) + +if "%1" == "devhelp" ( + %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp + echo. + echo.Build finished. + goto end +) + +if "%1" == "epub" ( + %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub + echo. + echo.Build finished. The epub file is in %BUILDDIR%/epub. + goto end +) + +if "%1" == "latex" ( + %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex + echo. + echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. + goto end +) + +if "%1" == "text" ( + %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text + echo. + echo.Build finished. The text files are in %BUILDDIR%/text. + goto end +) + +if "%1" == "man" ( + %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man + echo. + echo.Build finished. The manual pages are in %BUILDDIR%/man. + goto end +) + +if "%1" == "changes" ( + %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes + echo. + echo.The overview file is in %BUILDDIR%/changes. + goto end +) + +if "%1" == "linkcheck" ( + %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck + echo. + echo.Link check complete; look for any errors in the above output ^ +or in %BUILDDIR%/linkcheck/output.txt. + goto end +) + +if "%1" == "doctest" ( + %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest + echo. + echo.Testing of doctests in the sources finished, look at the ^ +results in %BUILDDIR%/doctest/output.txt. + goto end +) + +:end diff --git a/askbot/doc/source/conf.py b/askbot/doc/source/conf.py new file mode 100644 index 00000000..8e9b110c --- /dev/null +++ b/askbot/doc/source/conf.py @@ -0,0 +1,253 @@ +# -*- coding: utf-8 -*- +# +# Askbot documentation build configuration file, created by +# sphinx-quickstart on Wed Jun 16 19:22:51 2010. +# +# This file is execfile()d with the current directory set to its containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +import sys, os + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +#sys.path.append(os.path.abspath('.')) + +# -- General configuration ----------------------------------------------------- + +# If your documentation needs a minimal Sphinx version, state it here. +#needs_sphinx = '1.0' + +# Add any Sphinx extension module names here, as strings. They can be extensions +# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. +extensions = ['sphinx.ext.autodoc', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.viewcode'] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix of source filenames. +source_suffix = '.rst' + +# The encoding of source files. +#source_encoding = 'utf-8-sig' + +# The master toctree document. +master_doc = 'index' + +# General information about the project. +project = u'Askbot' +copyright = u'2010, Evgeny Fadeev' + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The short X.Y version. +version = '0.6' +# The full version, including alpha/beta/rc tags. +release = '0.6' + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +#language = None + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +#today = '' +# Else, today_fmt is used as the format for a strftime call. +#today_fmt = '%B %d, %Y' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = [] + +# The reST default role (used for this markup: `text`) to use for all documents. +#default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +#add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +#add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +#show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +# A list of ignored prefixes for module index sorting. +#modindex_common_prefix = [] + + +# -- Options for HTML output --------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +html_theme = 'default' + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +#html_theme_options = {} + +# Add any paths that contain custom themes here, relative to this directory. +#html_theme_path = [] + +# The name for this set of Sphinx documents. If None, it defaults to +# " v documentation". +#html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +#html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +#html_logo = None + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +#html_favicon = None + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +#html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +#html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +#html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +#html_additional_pages = {} + +# If false, no module index is generated. +#html_domain_indices = True + +# If false, no index is generated. +#html_use_index = True + +# If true, the index is split into individual pages for each letter. +#html_split_index = False + +# If true, links to the reST sources are added to the pages. +#html_show_sourcelink = True + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +#html_show_sphinx = True + +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. +#html_show_copyright = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +#html_use_opensearch = '' + +# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml"). +#html_file_suffix = '' + +# Output file base name for HTML help builder. +htmlhelp_basename = 'Askbotdoc' + + +# -- Options for LaTeX output -------------------------------------------------- + +# The paper size ('letter' or 'a4'). +#latex_paper_size = 'letter' + +# The font size ('10pt', '11pt' or '12pt'). +#latex_font_size = '10pt' + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, author, documentclass [howto/manual]). +latex_documents = [ + ('index', 'Askbot.tex', u'Askbot Documentation', + u'Evgeny Fadeev', 'manual'), +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +#latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +#latex_use_parts = False + +# If true, show page references after internal links. +#latex_show_pagerefs = False + +# If true, show URL addresses after external links. +#latex_show_urls = False + +# Additional stuff for the LaTeX preamble. +#latex_preamble = '' + +# Documents to append as an appendix to all manuals. +#latex_appendices = [] + +# If false, no module index is generated. +#latex_domain_indices = True + + +# -- Options for manual page output -------------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + ('index', 'askbot', u'Askbot Documentation', + [u'Evgeny Fadeev'], 1) +] + + +# -- Options for Epub output --------------------------------------------------- + +# Bibliographic Dublin Core info. +epub_title = u'Askbot' +epub_author = u'Evgeny Fadeev' +epub_publisher = u'Evgeny Fadeev' +epub_copyright = u'2010, Evgeny Fadeev' + +# The language of the text. It defaults to the language option +# or en if the language is not set. +#epub_language = '' + +# The scheme of the identifier. Typical schemes are ISBN or URL. +#epub_scheme = '' + +# The unique identifier of the text. This can be a ISBN number +# or the project homepage. +#epub_identifier = '' + +# A unique identification for the text. +#epub_uid = '' + +# HTML files that should be inserted before the pages created by sphinx. +# The format is a list of tuples containing the path and title. +#epub_pre_files = [] + +# HTML files shat should be inserted after the pages created by sphinx. +# The format is a list of tuples containing the path and title. +#epub_post_files = [] + +# A list of files that should not be packed into the epub file. +#epub_exclude_files = [] + +# The depth of the table of contents in toc.ncx. +#epub_tocdepth = 3 diff --git a/askbot/doc/source/index.rst b/askbot/doc/source/index.rst new file mode 100644 index 00000000..48eacfe8 --- /dev/null +++ b/askbot/doc/source/index.rst @@ -0,0 +1,258 @@ +Askbot is a Question and Answer (Q&A) forum whose design is inspired by StackOverflow_ +and YahooAnswers_ and other similar projects (to lesser extent). + +Askbot is written in Python_ on top of Django_ platform. +Code of Askbot grew out of CNPROG_ project originally written by +`Mike Chen `_ and Sailing Cai. + +If you have any questions installing or tweaking askbot - please do not hesitate to ask +at the forum_ or email to admin@askbot.org. + +Prerequisites +====================== +To install and run Askbot the following are required: + +* Python_ version 2.4 - 2.6 (Version 3 is not supported) +* MySQL_ version 5 + +For the production deployment you will also need a webserver capable to run +python web applications (see section Deployment_). + +Installation Instructions +=========================== + +To simplify future deployment, please make sure to use the same python +interpreter for the installation and testing as the one assigned +(or will be assigned) to the webserver. + +If you already have `easy_install`_ on your system, then type:: + easy_install askbot + +If you are using the easy\_install tool, make sure that it was also +originally installed with the python interpreter mentioned above, +otherwise use the second method: + +Download the latest version of askbot_, unzip and untar the archive and run:: + python setup.py install + +If you are planning to use askbot on Windows, please install +`mysql-python windows binary package `_ manually. + +Chances are that steps above will complete your installation. If so, then +proceed to the Configuration_ section. Below are extra installation notes +that cover some special cases. + +To install in non-standard locations add parameter --prefix=/path/to/some/dir to both commands. + +Askbot depends on about a dozen other packages. Normally those dependencies will be +automatically resolved. However, if something does not go well - e.g. +some dependency package site is not accessible, please +download and install some of those things +( +django-1.1.2_, +django-debug-toolbar_, +South_, +recaptcha-client_, +markdown2_, +html5lib_, +python-openid_, +django-keyedcache_, +django-threaded-multihost_, +mysql-python_ +) manually. + +If any of the provided links +do not work please try to look up those packages or notify askbot maintainers at admin@askbot.org. + +.. _Configuration: +Configuration +==================== + +type:: + startforum + +and answer questions. + +The startforum script will attempt to create necessary directories +and copy files. + +If you are creating a new Django project, you will need to edit file + +In the case you are adding askbot to an existing Django project, you will need to +merge askbot files settings.py_ and urls.py_ into your project files manually. + +Within settings.py, at the very minimum you will need to provide correct values to:: + DATABASE_NAME = '' + DATABASE_USER = '' + DATABASE_PASSWORD = '' + +within single quotes - login credential to your mysql database. Assuming that +the database exists, you can now install the tables by running:: + python manage.py syncdb + python manage.py migrate forum + +now run the development sever:: + python manage.py runserver `hostname -i`:8000 #or use some other port number > 1024 + +`hostname -i` is a Unix command returning the IP address of your system, you can also type +the IP manually or replace it with localhost if you are installing askbot +on a local machine. + +Your basic installation is now complete. Many settings can be +changed at runtime by following url /settings. + +If you choose to host a real website, please read +section Deployment_. For advice on hosting Askbot, please take +a look at section Hosting_. + +.. _Deployment: +Deployment +============== +Webserver process must be able to write to the following locations:: + /path/to/django-project/log/ + /path/to/django-project/askbot/upfiles + +If you know user name or the group name under which the webserver runs, +you can make those directories writable by setting the permissons +accordingly: + +For example, if you are using Linux installation of apache webserver running under +group name 'apache' you could do the following:: + + chown -R yourlogin:apache /path/to/askbot-site + chmod -R g+w /path/to/askbot-site/forum/upfiles + chmod -R g+w /path/to/askbot-site/log + +If your account somehow limits you from running such commands - please consult your +system administrator. + +Installation under Apache/mod\_wsgi +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Apache/mod\_wsgi combination is the only type of deployment described in this +document at the moment. mod_wsgi_ is currently the most resource efficient +apache handler for the Python web applications. + +The main wsgi script is in the file django.wsgi_ +it does not need to be modified + +Configure webserver +^^^^^^^^^^^^^^^^^^^^^^ + +Settings below are not perfect but may be a good starting point:: + + WSGISocketPrefix /path/to/socket/sock #must be readable and writable by apache + WSGIPythonHome /usr/local #must be readable by apache + WSGIPythonEggs /var/python/eggs #must be readable and writable by apache + + #NOTE: all urs below will need to be adjusted if + #settings.FORUM_SCRIPT_ALIAS !='' (e.g. = 'forum/') + #this allows "rooting" forum at http://example.com/forum, if you like + + ServerAdmin forum@example.com + DocumentRoot /path/to/askbot-site + ServerName example.com + + #run mod_wsgi process for django in daemon mode + #this allows avoiding confused timezone settings when + #another application runs in the same virtual host + WSGIDaemonProcess askbot + WSGIProcessGroup askbot + + #force all content to be served as static files + #otherwise django will be crunching images through itself wasting time + Alias /m/ /path/to/askbot-site/forum/skins/ + Alias /upfiles/ /path/to/askbot-site/forum/upfiles/ + + Order deny,allow + Allow from all + + + #this is your wsgi script described in the prev section + WSGIScriptAlias / /path/to/askbot-site/django.wsgi + + #this will force admin interface to work only + #through https (optional) + #"nimda" is the secret spelling of "admin" ;) + + RewriteEngine on + RewriteRule /nimda(.*)$ https://example.com/nimda$1 [L,R=301] + + CustomLog /var/log/httpd/askbot/access_log common + ErrorLog /var/log/httpd/askbot/error_log + + #(optional) run admin interface under https + + ServerAdmin forum@example.com + DocumentRoot /path/to/askbot-site + ServerName example.com + SSLEngine on + SSLCertificateFile /path/to/ssl-certificate/server.crt + SSLCertificateKeyFile /path/to/ssl-certificate/server.key + WSGIScriptAlias / /path/to/askbot-site/django.wsgi + CustomLog /var/log/httpd/askbot/access_log common + ErrorLog /var/log/httpd/askbot/error_log + DirectoryIndex index.html + + +Database configuration +~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Database can be prepared via your hosting control panel, if available or +can be created manually (provided that you have a mysql account with +a sufficient privilege) + +The relevant MySQL the commands are:: + create database askbot DEFAULT CHARACTER SET UTF8 COLLATE utf8_general_ci; + grant all privileges on dbname.* to dbuser@localhost identified by 'dbpassword'; + +where dbname, dbuser and dbpassword should be replaced with the real values. +MySQL will create a user with those credentials if it does not yet exist. + +Automation of maintenance jobs +=============================== + +There are routine tasks that should be performed periodically +from the command line. They can be automated via cron_ jobs + +File askbot_cron_job_ has a sample script that can be run say hourly + +The script currently does two things: (1) sends delayed email alerts and +(2) awards badges. These two actions can be separated into two separate jobs, +if necessary + +Sitemap registration +======================= +Sitemap to your forum will be available at url /sitemap.xml +e.g yoursite.com/forum/sitemap.xml or yoursite.com/sitemap.xml + +Google will be pinged each time question, answer or +comment is saved or a question deleted. + +If you register you sitemap through `Google Webmasters Tools`_ Google +will have be indexing your site more efficiently. + +.. _`Google Webmasters Tools`: https://www.google.com/webmasters/tools/ +.. _Python: http://www.python.org/download/ +.. _MySQL: http://www.mysql.com/downloads/mysql/#downloads +.. _YahooAnswers: http://answers.yahoo.com/ +.. _StackOverflow: http://stackoverflow.com/ +.. _CNPROG: http://cnprog.com +.. _askbot: http://pypi.python.org/pypi/askbot +.. _django-1.1.2: http://www.djangoproject.com/download/1.1.2/tarball/ +.. _django-debug-toolbar: http://github.com/robhudson/django-debug-toolbar +.. _South: http://www.aeracode.org/releases/south/ +.. _recaptcha-client: http://code.google.com/p/django-recaptcha/ +.. _markdown2: http://code.google.com/p/python-markdown2/ +.. _html5lib: http://code.google.com/p/html5lib/ +.. _python-openid: http://github.com/openid/python-openid +.. _django-keyedcache: http://bitbucket.org/bkroeze/django-keyedcache/src +.. _django-threaded-multihost: http://bitbucket.org/bkroeze/django-threaded-multihost/src +.. _mysql-python-win: +.. _mysql-python: http://sourceforge.net/projects/mysql-python/ +.. _settings.py: http://github.com/ASKBOT/askbot-devel/blob/master/askbot/setup_templates/settings.py +.. _urls.py: http://github.com/ASKBOT/askbot-devel/blob/master/askbot/setup_templates/urls.py +.. _cron: http://www.unixgeeks.org/security/newbie/unix/cron-1.html +.. _mod_wsgi: http://code.google.com/p/modwsgi/ +.. _django.wsgi: http://github.com/ASKBOT/askbot-devel/blob/master/askbot/setup_templates/django.wsgi +.. _forum: http://askbot.org +.. _askbot_cron_job: http://github.com/ASKBOT/askbot-devel/blob/master/askbot/cron/askbot_cron_job -- cgit v1.2.3-1-g7c22