fixed up INSTALL, settings_local.py.dist and replaced strings osqa->askbot everywhere, except main README file

This commit is contained in:
Evgeny Fadeev 2010-04-10 11:29:55 -04:00
parent 8822e0f2cf
commit 6fd183a0e5
17 changed files with 165 additions and 351 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>osqa</name>
<name>askbot</name>
<comment></comment>
<projects>
</projects>

View File

@ -5,6 +5,6 @@
<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.6</pydev_property>
<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH">
<path>/osqa</path>
<path>/askbot</path>
</pydev_pathproperty>
</pydev_project>

View File

@ -18,17 +18,17 @@ logging.debug('') #this will add time, line number, function and file record
#etc - take a look at http://docs.python.org/library/logging.html
-------------------------------
in OSQA logging is currently set up in settings_local.py.dist
in Askbot logging is currently set up in settings_local.py.dist
please update it if you need - in older revs logging strings have less info
messages of interest can be grepped out of the log file by module/file/function name
e.g. to take out all django_authopenid logs run:
>grep 'osqa\/django_authopenid' log/django.osqa.log | sed 's/^.*MSG: //'
>grep 'askbot\/django_authopenid' log/django.askbot.log | sed 's/^.*MSG: //'
in the example above 'sed' call truncates out a long prefix
and makes output look more meaningful
2) DJANGO DEBUG TOOLBAR
osqa works with django debug toolbar
askbot works with django debug toolbar
if debugging under apache server, check
that debug toolbar media is loaded correctly
if toolbar is enabled but you do not see it, possibly some Alias statement

141
INSTALL
View File

@ -4,7 +4,7 @@ A. PREREQUISITES
B. INSTALLATION
1. Settings file
2. Database
3. Running OSQA in the development server
3. Running Askbot in the development server
4. Installation under Apache/WSGI
5. Full text search
6. Email subscriptions
@ -56,7 +56,7 @@ Notice that you will need to register with recaptcha.net and receive
recaptcha public and private keys that need to be saved in your
settings_local.py file
NOTES: django_authopenid is included into OSQA code
NOTES: django_authopenid is included into Askbot code
and is significantly modified. http://code.google.com/p/django-authopenid/
no need to install this library
@ -64,14 +64,20 @@ B. INSTALLATION
-----------------------------------------------
0. Make sure you have all above python libraries installed.
make osqa installation server-readable on Linux command might be:
chown -R yourlogin:apache /path/to/OSQA
DO NOT name the main directory 'askbot' - this name is reserved
for the future name of the app file itself.
directories templates/upfiles and log must be server writable
make askbot installation server-readable on Linux command might be:
chown -R yourlogin:apache /path/to/askbot-site
directories:
/path/to/askbot-site/forum/upfiles
/path/to/askbot-site/log
must be server writable
on Linux type chmod
chmod -R g+w /path/to/OSQA/upfiles
chmod -R g+w /path/to/log
chmod -R g+w /path/to/askbot-site/forum/upfiles
chmod -R g+w /path/to/askbot-site/log
above it is assumed that webserver runs under group named "apache"
@ -82,16 +88,32 @@ update all your settings. Check settings.py and update
it as well if necessory.
Section C explains configuration paramaters.
Minimally required modification of settings_local.py are
DATABASE_NAME
DATABASE_USER
DATABASE_PASSWORD
DATABASE_ENGINE
If you set these up, and your database is ready (see section 2),
run:
python manage.py syncdb
python manage.py runserver `hostname -i`:8000
(choose another port number if you wish)
and askbot should be running - if you have any issues at this point (or later:)
please post them at http://askbot.org/meta
2. Database
Prepare your database by using the same database/account
configuration from above.
e.g,
create database osqa DEFAULT CHARACTER SET UTF8 COLLATE utf8_general_ci;
grant all on osqa.* to 'osqa'@'localhost';
create database askbot DEFAULT CHARACTER SET UTF8 COLLATE utf8_general_ci;
grant all on askbot.* to 'askbot'@'localhost';
And then run "python manage.py syncdb" to synchronize your database.
3. Running OSQA on the development server
3. Running Askbot on the development server
Run "python manage.py runserver" to startup django
development environment.
@ -112,8 +134,8 @@ import os
import sys
sys.path.insert(0,'/one/level/above') #insert to make sure that forum will be found
sys.path.append('/one/level/above/OSQA') #maybe this is not necessary
os.environ['DJANGO_SETTINGS_MODULE'] = 'OSQA.settings'
sys.path.append('/one/level/above/askbot-site') #maybe this is not necessary
os.environ['DJANGO_SETTINGS_MODULE'] = 'askbot-site.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
-----------
@ -138,26 +160,26 @@ WSGIPythonEggs /var/python/eggs #must be readable and writable by apache
#this allows "rooting" forum at http://example.com/forum, if you like
<VirtualHost ...your ip...:80>
ServerAdmin forum@example.com
DocumentRoot /path/to/osqa-site
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 OSQA
WSGIProcessGroup OSQA
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/osqa-site/forum/skins/
Alias /upfiles/ /path/to/osqa-site/forum/upfiles/
<Directory /path/to/osqa-site/forum/skins>
Alias /m/ /path/to/askbot-site/forum/skins/
Alias /upfiles/ /path/to/askbot-site/forum/upfiles/
<Directory /path/to/askbot-site/forum/skins>
Order deny,allow
Allow from all
</Directory>
#this is your wsgi script described in the prev section
WSGIScriptAlias / /path/to/osqa-site/osqa.wsgi
WSGIScriptAlias / /path/to/askbot-site/askbot.wsgi
#this will force admin interface to work only
#through https (optional)
@ -166,20 +188,20 @@ WSGIPythonEggs /var/python/eggs #must be readable and writable by apache
RewriteEngine on
RewriteRule /nimda(.*)$ https://example.com/nimda$1 [L,R=301]
</Location>
CustomLog /var/log/httpd/OSQA/access_log common
ErrorLog /var/log/httpd/OSQA/error_log
CustomLog /var/log/httpd/askbot/access_log common
ErrorLog /var/log/httpd/askbot/error_log
</VirtualHost>
#(optional) run admin interface under https
<VirtualHost ..your ip..:443>
ServerAdmin forum@example.com
DocumentRoot /path/to/osqa-site
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/osqa-site/osqa.wsgi
CustomLog /var/log/httpd/OSQA/access_log common
ErrorLog /var/log/httpd/OSQA/error_log
WSGIScriptAlias / /path/to/askbot-site/askbot.wsgi
CustomLog /var/log/httpd/askbot/access_log common
ErrorLog /var/log/httpd/askbot/error_log
DirectoryIndex index.html
</VirtualHost>
-------------
@ -196,9 +218,9 @@ WSGIPythonEggs /var/python/eggs #must be readable and writable by apache
configure sphinx, sample configuration can be found in
sphinx/sphinx.conf file usually goes somewhere in /etc tree
build osqa index first time manually
build askbot index first time manually
% indexer --config /path/to/sphinx.conf --index osqa
% indexer --config /path/to/sphinx.conf --index askbot
setup cron job to rebuild index periodically with command
your crontab entry may be something like
@ -246,69 +268,10 @@ There are some demo scripts under sql_scripts folder,
including badges and test accounts for CNProg.com. You
don't need them to run your sample.
C. CONFIGURATION PARAMETERS
#the only parameter that needs to be touched in settings.py is
DEBUG=False #set to True to enable debug mode
#all forum parameters are set in file settings_local.py
LOG_FILENAME = 'osqa.log' #where logging messages should go
DATABASE_NAME = 'osqa' # Or path to database file if using sqlite3.
DATABASE_USER = '' # Not used with sqlite3.
DATABASE_PASSWORD = '' # Not used with sqlite3.
DATABASE_ENGINE = 'mysql' #mysql, etc
SERVER_EMAIL = ''
DEFAULT_FROM_EMAIL = ''
EMAIL_HOST_USER = ''
EMAIL_HOST_PASSWORD = '' #not necessary if mailserver is run on local machine
EMAIL_SUBJECT_PREFIX = '[OSQA] '
EMAIL_HOST='osqa.com'
EMAIL_PORT='25'
EMAIL_USE_TLS=False
TIME_ZONE = 'America/Tijuana'
APP_TITLE = u'OSQA Q&A Forum' #title of your forum
APP_KEYWORDS = u'OSQA,forum,community' #keywords for search engines
APP_DESCRIPTION = u'Ask and answer questions.' #site description for searche engines
APP_INTRO = u'<p>Ask and answer questions, make the world better!</p>' #slogan that goes to front page in logged out mode
APP_COPYRIGHT = '' #copyright message
#if you set FORUM_SCRIPT_ALIAS= 'forum/'
#then OSQA will run at url http://example.com/forum
#FORUM_SCRIPT_ALIAS cannot have leading slash, otherwise it can be set to anything
FORUM_SCRIPT_ALIAS = '' #no leading slash, default = '' empty string
LANGUAGE_CODE = 'en' #forum language (see language instructions on the wiki)
EMAIL_VALIDATION = 'off' #string - on|off
MIN_USERNAME_LENGTH = 1
EMAIL_UNIQUE = False #if True, email addresses must be unique in all accounts
APP_URL = 'http://osqa.com' #used by email notif system and RSS
GOOGLE_SITEMAP_CODE = '' #code for google site crawler (look up google webmaster tools)
GOOGLE_ANALYTICS_KEY = '' #key to enable google analytics on this site
BOOKS_ON = False #if True - books tab will be on
WIKI_ON = True #if False - community wiki feature is disabled
#experimental - allow password login through external site
#must implement django_authopenid/external_login.py
#included prototype external_login works with Mediawiki
USE_EXTERNAL_LEGACY_LOGIN = True #if false OSQA uses it's own login/password
EXTERNAL_LEGACY_LOGIN_HOST = 'login.osqa.com'
EXTERNAL_LEGACY_LOGIN_PORT = 80
EXTERNAL_LEGACY_LOGIN_PROVIDER_NAME = '<span class="orange">OSQA</span>'
FEEDBACK_SITE_URL = None #None or url
LOGIN_URL = '/%s%s%s' % (FORUM_SCRIPT_ALIAS,'account/','signin/')
DJANGO_VERSION = 1.1 #must be either 1.0 or 1.1
RESOURCE_REVISION=4 #increment when you update media files - clients will be forced to load new version
D. Customization
C. Customization
Other than settings_local.py the following will most likely need customization:
* locale/*/django.po - language files that may also contain your site-specific messages
if you want to start with english messages file - look for words like "forum" and
"OSQA" in the msgstr lines
* templates/header.html and templates/footer.html may contain extra links
* templates/about.html - a place to explain for is your forum for
* templates/faq.html - put answers to users frequent questions
* templates/content/style/style.css - modify style sheet to add disctinctive look to your forum
"Askbot" in the msgstr lines
* skins

View File

@ -12,7 +12,7 @@
git://github.com/johnl/deb-sphinx-search.git
* Install a virtual environment OUTSIDE of this directory:
pip install -E ~/env -r osqa-requirements.txt
pip install -E ~/env -r askbot-requirements.txt
[there is discussion on the pinax forums about what it should be outside
the source directory]

View File

@ -1,28 +1,28 @@
Detailed instructions for installing OSQA on WebFaction
Detailed instructions for installing Askbot on WebFaction
Adapted from http://code.pinaxproject.com/wiki/DetailedPinaxWebfaction/
Please email turian at gmail with any updates or corrections.
Installing OSQA on Webfaction
Installing Askbot on Webfaction
------------------------------------
Details the steps for setting up OSQA on a Webfaction shared-hosting
Details the steps for setting up Askbot on a Webfaction shared-hosting
account, including email setup, using Apache2, mod_wsgi, psycopg2.
If you want to search-and-replace through this file, you will need to replace:
osqa_server [name of Webfaction application, which will be in ~/webapps/]
osqa_static [name of Webfaction application for static media serving]
DOMAIN.com [domain name for OSQA site]
askbot_server [name of Webfaction application, which will be in ~/webapps/]
askbot_static [name of Webfaction application for static media serving]
DOMAIN.com [domain name for Askbot site]
PORT [port number assigned by WebFaction to your mod_wsgi application]
SITENAME [name you give the OSQA site, which will contain the apache logs]
MYOSQA [name of the OSQA project]
SITENAME [name you give the Askbot site, which will contain the apache logs]
myaskbot [name of the Askbot project]
MAILBOX_USERNAME [username you give the email address]
MAILBOX_PASSWORD [password that webfaction gives to this email username]
OSQADATABASE_NAME [username you give the database]
OSQADATABASE_PASSWORD [password that webfaction gives to this database]
~/envs/osqa [directory for the OSQA python environment, grep for 'env']
AskbotDATABASE_NAME [username you give the database]
AskbotDATABASE_PASSWORD [password that webfaction gives to this database]
~/envs/askbot [directory for the Askbot python environment, grep for 'env']
USERNAME [your WebFaction username]
Some things I'm not sure about:
@ -30,7 +30,7 @@ Some things I'm not sure about:
Here's what I don't know how to do:
* Set up a nginx server for static media.
* Configure sphinx search
* Use PostgreSQL, not MySQL: http://osqa.net/question/13/can-i-use-osqa-with-postgresql
* Use PostgreSQL, not MySQL: http://askbot.net/question/13/can-i-use-askbot-with-postgresql
Webfaction Control Panel
@ -46,7 +46,7 @@ for you, website/subdomain and associate the two for you.)
Let's call the domain DOMAIN.com.
Create a new Webfaction application with a "Type:" of "mod_wsgi
2.5/Python2.5", naming it "osqa_server". (These instructions
2.5/Python2.5", naming it "askbot_server". (These instructions
might also work with mod_wsgi 2.0, if you like.)
https://panel.webfaction.com/app_/list
@ -55,8 +55,8 @@ for you, website/subdomain and associate the two for you.)
it PORT.
Create a new Webfaction website which will associate the subdomain
with the new osqa_server application. Give it name SITENAME, at least one
domain, and set it to use the osqa_server application for the site's
with the new askbot_server application. Give it name SITENAME, at least one
domain, and set it to use the askbot_server application for the site's
root location, "/".
https://panel.webfaction.com/site/list
@ -64,20 +64,20 @@ for you, website/subdomain and associate the two for you.)
You will need to create a database, typically one for each project
you create. Change the type to PostgreSql and modify the name (it
defaults to your webfaction account name) by adding an underscore
and a project-specific identifier such as "_osqa". Before
and a project-specific identifier such as "_askbot". Before
leaving this section of the control panel, you may wish to change
the password.
https://panel.webfaction.com/database/create
Call these OSQADATABASE_NAME and OSQADATABASE_PASSWORD.
Call these AskbotDATABASE_NAME and AskbotDATABASE_PASSWORD.
Save the database password for later.
[The following I haven't figured out yet]
You will probably want to add a static media server. This is a
Webfaction application. I created one of type "Static only (no
.htaccess)" and with the name of "osqa_static".
.htaccess)" and with the name of "askbot_static".
https://panel.webfaction.com/app_/create
@ -96,15 +96,15 @@ for you, website/subdomain and associate the two for you.)
https://panel.webfaction.com/email/list
OSQA Software
Askbot Software
--------------
Log onto webfaction and get the code. I use my fork because I have
a simple pip installation:
git://github.com/turian/osqa.git
git://github.com/turian/askbot.git
In my situation, I keep source code in ~/utils/src, create
virtual environments in ~/envs/osqa, and create Pinax projects in
~/webapps/osqa_server/projects.
virtual environments in ~/envs/askbot, and create Pinax projects in
~/webapps/askbot_server/projects.
You will need pip + virtualenv installed:
@ -112,15 +112,15 @@ OSQA Software
easy_install --prefix=~/utils/ virtualenv
cd ~/utils/src/
git clone git://github.com/turian/osqa.git
cd osqa
git clone git://github.com/turian/askbot.git
cd askbot
# We need python2.5 to be compatible with WSGI
python2.5 ~/utils/bin/pip install -E ~/envs/osqa -r osqa-requirements.txt
source ~/envs/osqa/bin/activate
python2.5 ~/utils/bin/pip install -E ~/envs/askbot -r askbot-requirements.txt
source ~/envs/askbot/bin/activate
# [Optional] If you want a MySQL database
easy_install-2.5 --prefix ~/envs/osqa/ mysql-python
easy_install-2.5 --prefix ~/envs/askbot/ mysql-python
Additional Software
-------------------
@ -147,39 +147,39 @@ Additional Software
Create a Project
----------------
In Pinax, you clone a project from OSQA.
However, OSQA we just copy it.
In Pinax, you clone a project from Askbot.
However, Askbot we just copy it.
cd ~/webapps/osqa_server
cd ~/webapps/askbot_server
mkdir projects
cd projects
cp -R ~/utils/src/osqa MYOSQA
cd MYOSQA
export OSQAPROJECT=`pwd`
cp -R ~/utils/src/askbot myaskbot
cd myaskbot
export AskbotPROJECT=`pwd`
Make some directories, as described in the OSQA INSTALL file:
Make some directories, as described in the Askbot INSTALL file:
[okay I haven't actually done this yet]
# mkdir -p $OSQASITE/upfiles/
# mkdir -p $OSQALOG
# sudo chown -R `whoami`:www-data $OSQASITE
# sudo chown -R `whoami`:www-data $OSQALOG
# chmod -R g+w $OSQASITE/upfiles
# chmod -R g+w $OSQALOG
# mkdir -p $AskbotSITE/upfiles/
# mkdir -p $AskbotLOG
# sudo chown -R `whoami`:www-data $AskbotSITE
# sudo chown -R `whoami`:www-data $AskbotLOG
# chmod -R g+w $AskbotSITE/upfiles
# chmod -R g+w $AskbotLOG
Edit the settings files:
cd $OSQAPROJECT
cd $AskbotPROJECT
cp settings_local.py.dist settings_local.py
vi settings_local.py settings.py
Pay attention to the following settings:
DATABASE_ENGINE = 'mysql'
DATABASE_NAME = 'OSQADATABASE_NAME'
DATABASE_USER = 'OSQADATABASE_NAME'
DATABASE_PASSWORD = 'OSQADATABASE_PASSWORD'
DATABASE_NAME = 'AskbotDATABASE_NAME'
DATABASE_USER = 'AskbotDATABASE_NAME'
DATABASE_PASSWORD = 'AskbotDATABASE_PASSWORD'
EMAIL_HOST='smtp.webfaction.com'
EMAIL_HOST_USER='MAILBOX_USERNAME'
@ -197,7 +197,7 @@ Create a Project
Create a directory for logs:
cd $OSQAPROJECT
cd $AskbotPROJECT
mkdir log
Modify mail cron scripts "cron/send_email_alerts" as follows:
@ -206,8 +206,8 @@ Create a Project
#!/bin/sh
WORKON_HOME=~/envs/osqa
PROJECT_ROOT=~/webapps/osqa_server/projects/MYOSQA/
WORKON_HOME=~/envs/askbot
PROJECT_ROOT=~/webapps/askbot_server/projects/myaskbot/
# activate virtual environment
. $WORKON_HOME/bin/activate
@ -217,7 +217,7 @@ Create a Project
Use command "crontab -e" to add this script to your cron file, to run twice a day::
1 0,12 * * * ~/webapps/osqa_server/projects/MYOSQA/cron/send_email_alerts
1 0,12 * * * ~/webapps/askbot_server/projects/myaskbot/cron/send_email_alerts
[Configure sphinx]
@ -229,8 +229,8 @@ Create a Project
Build media directory links within the project and create symbolic
links on the static media server.
python manage.py build_media -all
mkdir ~/webapps/OSQA_STATIC/MYOSQA
ln -sd ~/webapps/osqa_server/projects/MYOSQA/site_media ~/webapps/OSQA_STATIC/MYOSQA/site_media
mkdir ~/webapps/Askbot_STATIC/myaskbot
ln -sd ~/webapps/askbot_server/projects/myaskbot/site_media ~/webapps/Askbot_STATIC/myaskbot/site_media
Set up the badges:
@ -249,7 +249,7 @@ Create a Project
4. Use `crontab -e` to call `cron/multi_award_badges` maybe
four times an hour.
4,19,34,49 * * * * ~/webapps/osqa_server/projects/MYOSQA/cron/multi_award_badges
4,19,34,49 * * * * ~/webapps/askbot_server/projects/myaskbot/cron/multi_award_badges
5. Repeat steps 1-4 for `cron/once_award_badges`.
@ -257,10 +257,10 @@ Create a Project
Configure Apache2
----------------
Edit ~/webapps/osqa_server/apache2/conf/httpd.conf as follows::
Edit ~/webapps/askbot_server/apache2/conf/httpd.conf as follows::
ServerAdmin "MAILBOX_USERNAME@DOMAIN.com"
ServerRoot "/home/USERNAME/webapps/osqa_server/apache2"
ServerRoot "/home/USERNAME/webapps/askbot_server/apache2"
ServerName DOMAIN.com
LoadModule dir_module modules/mod_dir.so
@ -274,42 +274,42 @@ Configure Apache2
KeepAlive Off
Listen PORT
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
CustomLog /home/USERNAME/logs/user/access_osqa_server_log combined
ErrorLog /home/USERNAME/logs/user/error_osqa_server_log
CustomLog /home/USERNAME/logs/user/access_askbot_server_log combined
ErrorLog /home/USERNAME/logs/user/error_askbot_server_log
ServerLimit 2
#SetEnvIf X-Forwarded-SSL on HTTPS=1
WSGIPythonPath /home/USERNAME/envs/osqa/lib/python2.5/site-packages/
WSGIScriptAlias / /home/USERNAME/webapps/osqa_server/projects/MYOSQA/osqa.wsgi
WSGIPythonPath /home/USERNAME/envs/askbot/lib/python2.5/site-packages/
WSGIScriptAlias / /home/USERNAME/webapps/askbot_server/projects/myaskbot/askbot.wsgi
LoadModule alias_module modules/mod_alias.so
WSGIDaemonProcess osqaWSGI user=USERNAME group=USERNAME threads=25 python-path=/home/USERNAME/envs/osqa/lib/python2.5/site-packages
WSGIProcessGroup osqaWSGI
WSGIDaemonProcess askbotWSGI user=USERNAME group=USERNAME threads=25 python-path=/home/USERNAME/envs/askbot/lib/python2.5/site-packages
WSGIProcessGroup askbotWSGI
NameVirtualHost 127.0.0.1:PORT
#ErrorLog "logs/MYOSQA_2009_05_06.log"
#ErrorLog "logs/myaskbot_2009_05_06.log"
SetHandler none
#Alias /site_media /home/USERNAME/webapps/static/MYOSQA/site_media
#Alias /site_media /home/USERNAME/webapps/static/myaskbot/site_media
#force all content to be served as static files
#otherwise django will be crunching images through itself wasting time
Alias /content/ /home/USERNAME/webapps/osqa_server/projects/MYOSQA/templates/content/
Alias /forum/admin/media/ /home/turian/envs/osqa/lib/python2.5/site-packages/django/contrib/admin/media/
#AliasMatch /([^/]*\.css) /home/USERNAME/webapps/osqa_server/projects/MYOSQA/templates/content/style/$1
<Directory "/home/USERNAME/webapps/osqa_server/projects/MYOSQA/templates/content">
Alias /content/ /home/USERNAME/webapps/askbot_server/projects/myaskbot/templates/content/
Alias /forum/admin/media/ /home/turian/envs/askbot/lib/python2.5/site-packages/django/contrib/admin/media/
#AliasMatch /([^/]*\.css) /home/USERNAME/webapps/askbot_server/projects/myaskbot/templates/content/style/$1
<Directory "/home/USERNAME/webapps/askbot_server/projects/myaskbot/templates/content">
# Order deny,allow
# Allow from all
</Directory>
If you want virtual hosts of the admin interface under HTTPS, please
look at OSQA's install file.
look at Askbot's install file.
Create osqa.wsgi and edit it:
cp osqa.wsgi.dist osqa.wsgi
Create askbot.wsgi and edit it:
cp askbot.wsgi.dist askbot.wsgi
Edit ~/webapps/osqa_server/projects/MYOSQA/deploy/osqa.wsgi as follows::
Edit ~/webapps/askbot_server/projects/myaskbot/deploy/askbot.wsgi as follows::
import os
import sys
@ -323,13 +323,13 @@ Configure Apache2
# add the virtual environment site-packages to the path
from site import addsitedir
addsitedir('/home/USERNAME/envs/osqa/lib/python2.5/site-packages')
addsitedir('/home/USERNAME/envs/askbot/lib/python2.5/site-packages')
sys.path.insert(0, abspath(join(dirname(__file__), "../")))
sys.path.append(abspath(dirname(__file__)))
from django.conf import settings
os.environ["DJANGO_SETTINGS_MODULE"] = "MYOSQA.settings"
os.environ["DJANGO_SETTINGS_MODULE"] = "myaskbot.settings"
#print sys.path
@ -338,8 +338,8 @@ Configure Apache2
And then you're up and running with:
~/webapps/osqa_server/apache2/bin/stop
~/webapps/osqa_server/apache2/bin/start
~/webapps/askbot_server/apache2/bin/stop
~/webapps/askbot_server/apache2/bin/start
You should log in to the admin interface (http://DOMAIN.com/admin/),
and go to "Sites > Sites", and change the domain name that is used in

View File

@ -1,15 +1,15 @@
* smarter debug mode
* The wonder bar (integrated the search / ask functionality)
* The authentication system ???
* The wonder bar (integrated the search / ask functionality)
* The authentication system ???
* allow multiple logins to the same account
* allow multiple logins to the same account
* more advanced templating/skinning system
* per-tag email subscriptions
* view for personalized news on the site
* a little flag popping when there are news
* drill-down mode for navigation by tags
* improved admin console
* sort out mess with profile - currently we patch django User
* allow multiple logins to the same account
* more advanced templating/skinning system
* per-tag email subscriptions
* view for personalized news on the site
* a little flag popping when there are news
* drill-down mode for navigation by tags
* improved admin console
* sort out mess with profile - currently we patch django User
* Some functionality should be moved out of the forums app, in the case
that the forum app is restricted only to authenticated users:
@ -34,9 +34,9 @@ Just a joke - pick yourself a task and work on it.
* validate HTML
* set up loading of default settings from inside the /forum dir
* automatic dependency checking for modules
* propose how to rename directory forum --> osqa
* propose how to rename directory forum --> askbot
without breaking things and keeping name of the project root
named the same way - osqa
named the same way - askbot
==New features==
Whoever wants - pick a feature from the WISH_LIST

View File

@ -1,7 +1,7 @@
import os
import sys
sys.path.append('/path/to_dir_above')
sys.path.append('/path/to_dir_above/osqa')
os.environ['DJANGO_SETTINGS_MODULE'] = 'osqa.settings'
sys.path.append('/path/to_dir_above/askbot-site')#DO NOT USE name askbot for your own directories!!!
os.environ['DJANGO_SETTINGS_MODULE'] = 'askbot-site.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()

View File

@ -1,31 +0,0 @@
import re
from forum.modules import get_modules_script_classes
from forum.authentication.base import AuthenticationConsumer, ConsumerTemplateContext
class ConsumerAndContext:
def __init__(self, id, consumer, context):
self.id = id
self._consumer = consumer
context.id = id
self.context = context
@property
def consumer(self):
return self._consumer()
consumers = dict([
(re.sub('AuthConsumer$', '', name).lower(), cls) for name, cls
in get_modules_script_classes('authentication', AuthenticationConsumer).items()
if not re.search('AbstractAuthConsumer$', name)
])
contexts = dict([
(re.sub('AuthContext$', '', name).lower(), cls) for name, cls
in get_modules_script_classes('authentication', ConsumerTemplateContext).items()
])
AUTH_PROVIDERS = dict([
(name, ConsumerAndContext(name, consumers[name], contexts[name])) for name in consumers.keys()
if name in contexts
])

View File

@ -1,44 +0,0 @@
class AuthenticationConsumer(object):
def prepare_authentication_request(self, request, redirect_to):
raise NotImplementedError()
def process_authentication_request(self, response):
raise NotImplementedError()
def get_user_data(self, key):
raise NotImplementedError()
class ConsumerTemplateContext(object):
"""
Class that provides information about a certain authentication provider context in the signin page.
class attributes:
mode - one of BIGICON, SMALLICON, FORM
human_name - the human readable name of the provider
extra_js - some providers require us to load extra javascript on the signin page for them to work,
this is the place to add those files in the form of a list
extra_css - same as extra_js but for css files
"""
mode = ''
weight = 500
human_name = ''
extra_js = []
extra_css = []
show_to_logged_in_user = True
@classmethod
def readable_key(cls, key):
return key.key
class InvalidAuthentication(Exception):
def __init__(self, message):
self.message = message

View File

@ -1,73 +0,0 @@
from forum.utils.forms import NextUrlField, UserNameField, UserEmailField, SetPasswordForm
from forum.models import EmailFeedSetting, Question, User
from django.contrib.contenttypes.models import ContentType
from django.utils.translation import ugettext as _
from django.utils.safestring import mark_safe
from django import forms
from forum.forms import EditUserEmailFeedsForm
import logging
class SimpleRegistrationForm(forms.Form):
next = NextUrlField()
username = UserNameField()
email = UserEmailField()
class TemporaryLoginRequestForm(forms.Form):
def __init__(self, data=None):
super(TemporaryLoginRequestForm, self).__init__(data)
self.user_cache = None
email = forms.EmailField(
required=True,
label=_("Your account email"),
error_messages={
'required': _("You cannot leave this field blank"),
'invalid': _('please enter a valid email address'),
}
)
def clean_email(self):
try:
user = User.objects.get(email=self.cleaned_data['email'])
except:
raise forms.ValidationError(_("Sorry, but this email is not on our database."))
self.user_cache = user
return self.cleaned_data['email']
class SimpleEmailSubscribeForm(forms.Form):
SIMPLE_SUBSCRIBE_CHOICES = (
('y',_('okay, let\'s try!')),
('n',_('no OSQA community email please, thanks'))
)
subscribe = forms.ChoiceField(widget=forms.widgets.RadioSelect(), \
error_messages={'required':_('please choose one of the options above')},
choices=SIMPLE_SUBSCRIBE_CHOICES)
def save(self,user=None):
EFF = EditUserEmailFeedsForm
if self.cleaned_data['subscribe'] == 'y':
email_settings_form = EFF()
logging.debug('%s wants to subscribe' % user.username)
else:
email_settings_form = EFF(initial=EFF.NO_EMAIL_INITIAL)
email_settings_form.save(user,save_unbound=True)
class ChangePasswordForm(SetPasswordForm):
""" change password form """
oldpw = forms.CharField(widget=forms.PasswordInput(attrs={'class':'required'}),
label=mark_safe(_('Current password')))
def __init__(self, data=None, user=None, *args, **kwargs):
if user is None:
raise TypeError("Keyword argument 'user' must be supplied")
super(ChangePasswordForm, self).__init__(data, *args, **kwargs)
self.user = user
def clean_oldpw(self):
""" test old password """
if not self.user.check_password(self.cleaned_data['oldpw']):
raise forms.ValidationError(_("Old password is incorrect. \
Please enter the correct password."))
return self.cleaned_data['oldpw']

View File

@ -10,11 +10,11 @@ default/templates - templates must be named the same way
NO NEED TO CREATE ALL TEMPLATES/MEDIA FILES AT ONCE
templates are resolved in the following way:
* check in skin named as in settings.OSQA_DEFAULT_SKIN
* check in skin named as in settings.ASKBOT_DEFAULT_SKIN
* then skin named 'default'
media is resolved with one extra option
* settings.OSQA_DEFAULT_SKIN
* settings.ASKBOT_DEFAULT_SKIN
* 'default'
* 'common'

View File

@ -1,3 +1,3 @@
NAME = 'Osqa Books'
NAME = 'Books'
DESCRIPTION = "Allows discussion around books."
CAN_ENABLE = True

View File

@ -5,7 +5,7 @@
#
msgid ""
msgstr ""
"Project-Id-Version: OSQA\n"
"Project-Id-Version: Askbot\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-03-23 10:41-0400\n"
"PO-Revision-Date: 2010-03-28 22:15-0600\n"
@ -597,7 +597,7 @@ msgid "okay, let's try!"
msgstr "bien, vamos a probar!"
#: forum/authentication/forms.py:42
msgid "no OSQA community email please, thanks"
msgid "no community email please, thanks"
msgstr "no usar un email de la comunidad, por favor"
#: forum/authentication/forms.py:45
@ -2841,20 +2841,20 @@ msgstr "Enviar enlace"
msgid "Connect to %(APP_SHORT_NAME)s with Facebook!"
msgstr "Conectar con %(APP_SHORT_NAME)s Facebook!"
#: forum/skins/default/templates/osqaadmin/base.html:12
msgid "OSQA administration area"
#: forum/skins/default/templates/askbotadmin/base.html:12
msgid "administration area"
msgstr "Área de Administración"
#: forum/skins/default/templates/osqaadmin/base.html:36
#: forum/skins/default/templates/askbotadmin/base.html:36
msgid "Administration menu"
msgstr "Menú de administración"
#: forum/skins/default/templates/osqaadmin/index.html:6
#: forum/skins/default/templates/askbotadmin/index.html:6
msgid "Basic settings"
msgstr "Configuraciones básicas"
#: forum/skins/default/templates/osqaadmin/index.html:9
msgid "Welcome to the OSQA administration area."
#: forum/skins/default/templates/askbotadmin/index.html:9
msgid "Welcome to the administration area."
msgstr "Bienvenido al área de adminstración"
#: forum/templatetags/extra_tags.py:167

View File

@ -73,7 +73,7 @@ INSTALLED_APPS = (
'forum',
'django_authopenid',
'debug_toolbar' ,
#'stackexchange', #se loader
'stackexchange', #se loader
)
AUTHENTICATION_BACKENDS = ('django.contrib.auth.backends.ModelBackend',)

View File

@ -99,9 +99,8 @@ USE_FB_CONNECT=False
FB_API_KEY='' #your api key from facebook
FB_SECRET='' #your application secret
USE_EXTERNAL_LEGACY_LOGIN = False #DO NOT USE, and do not delete this line, will be removed later
#counter colors
VOTE_COUNTER_EXPECTED_MAXIMUM = 3
from forum_modules.grapefruit import Color
COLORS_VOTE_COUNTER_EMPTY_BG = 'white'
COLORS_VOTE_COUNTER_EMPTY_FG = 'gray'
COLORS_VOTE_COUNTER_MIN_BG = 'white'
@ -116,11 +115,11 @@ COLORS_VIEW_COUNTER_MIN_FG = Color.NewFromHtml(COLORS_VIEW_COUNTER_MIN_BG).Darke
COLORS_VIEW_COUNTER_MAX_BG = '#FF8000'#'#F7BE81'
COLORS_VIEW_COUNTER_MAX_FG = Color.NewFromHtml(COLORS_VIEW_COUNTER_MAX_BG).DarkerColor(0.7).html
ANSWER_COUNTER_EXPECTED_MAXIMUM = 4
COLORS_ANSWER_COUNTER_EMPTY_BG = '#a40000'
COLORS_ANSWER_COUNTER_EMPTY_BG = Color.NewFromHtml('#a40000').Blend(Color.NewFromHtml('white'),0.8).html
COLORS_ANSWER_COUNTER_EMPTY_FG = 'yellow'
COLORS_ANSWER_COUNTER_MIN_BG = '#AEB404'#'#81F7F3'#'#A9D0F5'#'#045FB4'
COLORS_ANSWER_COUNTER_MIN_FG = 'white'#'#81F7F3'
COLORS_ANSWER_COUNTER_MAX_BG = '#61380B'#'#4B088A'#'#0B3861'#'#045FB4'
COLORS_ANSWER_COUNTER_MAX_BG = Color.NewFromHtml('#61380B').Blend(Color.NewFromHtml('white'),0.75).html
COLORS_ANSWER_COUNTER_MAX_FG = '#ffff00'
COLORS_ANSWER_COUNTER_ACCEPTED_BG = 'darkgreen'
COLORS_ANSWER_COUNTER_ACCEPTED_BG = Color.NewFromHtml('darkgreen').Blend(Color.NewFromHtml('white'),0.8).html
COLORS_ANSWER_COUNTER_ACCEPTED_FG = '#D0F5A9'

View File

@ -2,10 +2,10 @@ this app's function will be to:
* install it's own tables (#todo: not yet automated)
* read SE xml dump into DjangoDB (automated)
* populate osqa database (automated)
* populate askbot database (automated)
* remove SE tables (#todo: not done yet)
Current process to load SE data into OSQA is:
Current process to load SE data into Askbot is:
==============================================
1) backup database
@ -26,7 +26,7 @@ Current process to load SE data into OSQA is:
5) Install stackexchange models (as well as any other missing models)
python manage.py syncdb
6) make sure that osqa badges are installed
6) make sure that badges are installed
if not, run (example for mysql):
mysql -u user -p dbname < sql_scripts/badges.sql
@ -47,7 +47,7 @@ it assumes that SE dump has been unzipped inside the tmp directory
#!/bin/sh$
python manage.py flush
#delete all data
mysql -u osqa -p osqa < sql_scripts/badges.sql
mysql -u askbot -p aksbot < sql_scripts/badges.sql
python manage.py load_stackexchange tmp
Untested parts are tagged with comments starting with