Installing Django on Ubuntu 10.04 LTS

check your hostname is set properly:

>hostname
>hostname -f

update the server:

apt-get update
>apt-get upgrade

install apache and mod_wsgi:

>sudo apt-get install apache2 libapache2-mod-wsgi

and install setup tools for python, and pip:

> sudo apt-get install python-setuptools
> sudo apt-get install python-pip

Pick a database:

>apt-get install mysql-server python-mysqldb
>apt-get install postgresql python-psycopg2
>apt-get install sqlite3 python-sqlite

Now install Django:

> sudo pip install django

and prepare the folders you will need :

> sudo mkdir /srv/www
> sudo mkdir /srv/www/wsgi
> sudo mkdir /srv/www/public_html

create a file to test if wsgi working:
sudo vim /srv/www/wsgi/app.wsgi

putting this content into the app.wsgi file:
def application(environ, start_response):
status = '200 OK'
output = 'Hello World!'

response_headers = [('Content-type', 'text/plain'),
('Content-Length', str(len(output)))]
start_response(status, response_headers)

return [output]

create a new apache site to test wsgi:
sudo vim /etc/apache2/sites-available/wsgi

and add this content to the site, replacing “myDocRootUrl” as appropriate — NOTE: bug in my blog software, so left out the opening less than sign on the virtual host tags:
VirtualHost *:80>

ServerName myDocRootUrl.wsgi
DocumentRoot /srv/www/wsgi

Order allow,deny
Allow from all

WSGIScriptAlias / /srv/www/wsgi/app.wsgi

/VirtualHost>

Next, check for and remove any default sites in sites-enabled folder:

>ls /etc/apache2/sites-available
>rm whatever defaults in there...

Now activate the test of wsgi site:
> sudo a2ensite wsgi
> sudo /etc/init.d/apache2 reload

Now visit the url you specified as myDocRootUrl.wsgi and you should see “Hello World!”

If not, first thing, check your apache error log (you likely need to change to root user here, not just sudo):

>sudo su -
>cat /var/log/apache2/error.log

Create django project:

> cd /srv/www
> sudo django-admin.py startproject myProject

Your project folder should now contain these files:
__init__.py manage.py settings.py urls.py

Create a wsgi file for the project (rename myProject as appropriate):

> sudo mkdir /srv/www/myProject/apache
> sudo vim /srv/www/myProject/apache/django.wsgi

and put this text in that django.wsgi file (rename myProject as appropriate):
import os
import sys

path = '/srv/www'
if path not in sys.path:
sys.path.insert(0, '/srv/www')

os.environ['DJANGO_SETTINGS_MODULE'] = 'myProject.settings'

import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()

Create a new apache sites-available for your django project:

>sudo vim /etc/apache2/sites-available/myProject

and add starter virtual host content to it (rename myProject as appropriate)(virtual hosts tags missing leading <):

VirtualHost *:80>

ServerName myDocRootUrl.myProject
DocumentRoot /srv/www/myProject

Order allow,deny
Allow from all

WSGIDaemonProcess myDocRootUrl.myProject processes=2 threads=15 display-name=%{GROUP}
WSGIProcessGroup myDocRootUrl.myProject

WSGIScriptAlias / /srv/www/myProject/apache/django.wsgi

/VirtualHost>

Activate the new project site:
> sudo a2ensite myProject
> sudo /etc/init.d/apache2 reload

browse to your project url and hopefully you see the default django welcome message!

Sources:
Mostly this article came from below, but I added to it:
http://blog.stannard.net.au/2010/12/11/installing-django-with-apache-and-mod_wsgi-on-ubuntu-10-04/

Typical github steps moving in a new repository

Global setup:
Set up git
git config --global user.name "Dave Parizek"
git config --global user.email dude@wherever.com

Next steps:
mkdir UAC
cd UAC
git init
touch README
git add README
git commit -m 'first commit'
git remote add origin git@github.com:BioComputing/UAC.git
git push -u origin master

Existing Git Repo?
cd existing_git_repo
git remote add origin git@github.com:BioComputing/UAC.git
git push -u origin master

Restarting Apache, different ways

Just reference for restarting apache, different strokes for different servers:

# /etc/init.d/httpd restart
# /etc/init.d/httpd start
# /etc/init.d/httpd stop

# service httpd restart

# apachectl -k graceful

sometimes you need sudo because it might only see the path from root

 

Oops, deleted super user Drupal 6, what to do? maybe you emptied user table?

I left my thinking cap off and emptied the user table of a dev Drupal 6 site I was working on. If that happens to you, just access your database with phpMyAdmin or similar, and:

INSERT INTO users (uid, name, pass) VALUES ('1', 'yourname', md5('yourpassword'));

then edit the users table further to add your email address and set status = 1.

Drupal 6 Programmatically Create Users

How to programmatically create new users in Drupal 6:

'username',
'pass' => 'password', // note: do not md5 the password
'mail' => 'email address',
'status' => 1,
'init' => 'email address'
);
user_save(null, $newUser);
?>

To update an existing user:

some_property = 'what_you_want_to_set_it_to';

// save existing user
user_save((object) array('uid' => $existingUser->uid), (array) $existingUser);
?>

List of Citizen Science applications / web sites / mobile phone applications

Hello. I am trying to compile a list of web sites and mobile phone applications wherein people are using technology to enable citizen science. If you know of a project I do not have listed, can you add it via the comments, and I will add it to the list? Thanks!

.

Name

URL

.

.

Notes

eBird and Cornell seem most successful, check out these quick facts: More than 60 scientific papers have used Cornell Lab citizen-science data since 1997
97,331 checklists reported from the four-day Great Backyard Bird Count in 2010
More than 96,000 nesting attempts reported to the Cornell Lab since 1997
1,000,000 bird observations reported to eBird on average each month
More than 80,000,000 bird observations in the Avian Knowledge Network

.

Cornell cit sci page

http://www.birds.cornell.edu/page.aspx?pid=1664

.

GeoKnect

www.akshenweb.org/apps

.

Project Noah

http://www.projectnoah.org/

.

Leaf Snap

http://smithsonianscience.org/2011/05/new-mobile-app-that-identifies-plants-by-leaf-shape-launched-by-smithsonian-and-columbia-and-maryland-universities/

.

What's Invasive

http://whatsinvasive.com/

.

Google's Open Data Kit

http://arstechnica.com/open-source/news/2009/11/getting-developing-world-data-with-android-and-open-data-kit.ars

http://code.google.com/p/opendatakit/

.

mapping of sudden oak death

http://ucanr.org/sites/UCCNP/Green_Blog/?blogpost=3948&blogasset=18704

.

HerpCount.org

http://www.herpcount.org/

will be adding android, iphone apps, and probably expanding to WildCount.org

.

at Project Noah

there are other projects linked to from project noah site – ladybugs, many many more, some lame, some real good

.

.

National Phenology Network

http://www.usanpn.org/

.

NestWatch

http://www.birds.cornell.edu/Page.aspx?pid=1139

Cornell is involved in multiple apps, with iphone stuff too, having trouble finding all my links -Dave See http://www.birds.cornell.edu/page.aspx?pid=1664

.

Tucson Bird Count

http://www.tucsonbirds.org/

.

eBird

http://ebird.org/content/ebird/about

.

California Roadkill iphone app

http://roadecology.ucdavis.edu/CROS.html

.

New York, iphone app, horseshoe crabs

http://www.nyhorseshoecrab.org/

.

multiple projects Cornell Ornithology

http://www.birds.cornell.edu/page.aspx?pid=1664

multiple citizen science projects listed here, all related to ornithology

.

Vermont Herp Atlas

http://community.middlebury.edu/~herpatlas/

.

BrachyBio

http://bti.cornell.edu/brachybio

Dave is developing the backend / data entry and presentation part of this site.

.

iPhone apps for citizen science

http://www.suenovotny.com/blog/2009/06/iphone-apps-for-citizen-scienc.php

.

gulf oil / oil spills cit sci apps

http://boingboing.net/2011/04/22/citizen-science-in-t.html

.

IBM's Creek Watch

http://www.huffingtonpost.com/2010/09/24/citizen-science-check-out_n_738220.html

.

interesting article cit sci iphone

http://applicationsforgood.org/blog/exemplars/doing-citizen-science-with-an-iphone/

.

iNaturalist.org

http://www.inaturalist.org/

has an iphone app coming, built one for RedwoodWatch

.

plants, leaves

http://www.treehugger.com/files/2009/05/future-iphone-app-to-make-you-a-citizen-scientist-without-trying.php

.

planetary science and cit sci

http://www.planetary.org/blog/article/00003030/

.

RedwoodWatch

http://rcci.savetheredwoods.org/action/redwoodwatch.shtml

.

Discovery's SciSpy

http://scispy.discovery.com/

.

The Great Yew Tree Hunt

http://www.epicollect.net/project.html?name=YewHunting

.

EpiCollect

http://www.epicollect.net/

EpiCollect.net provides a web application for the generation of forms and freely hosted project websites (using Google's AppEngine) for many kinds of mobile data collection projects.
Data can be collected using multiple mobile phones running either the Android Operating system or the iPhone (using the EpiCollect mobile app) and all data can be synchronised from the phones and viewed centrally (using Google Maps) via the Project website or directly on the phones.

.

connected to EpiCollect

http://www.spatialepidemiology.net/default.php

.

The Gila Monster Project

http://www.eebweb.arizona.edu/faculty/Bonine/Welcome.html

to be intergrated into HerpCount.org

HerpCount.org – a new site for citizen science in Herpetology

Working with Phil Rosen, Kevin Bonine, Julia Fonseca, and Brian Powell, I have in my free time developed a cool site for citizen herpetologists. It enables citizen scientists to contribute observational data on herps of southern Arizona. In the next few months, we hope to add iPhone and Android applications to it, and to make many improvements to the site. We also want to expand its scope both geographically and taxonomically.

Check it out – HerpCount.org.

We have even gotten some press on it already, for example, here: article on HerpCount.