Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

gimler/techism2

Repository files navigation

# Techism2.


## Setting up Development Environment
* Install Python 2.5 (only Python Version supported by AppEngine)
* Install Appengine SDK for Python 
* See http://code.google.com/appengine/docs/python/gettingstarted/devenvironment.html for details.


## Checkout Source
* Read-Only access:  git clone git://github.com/cko/techism2.git
* Read-Write access: git clone git@github.com:cko/techism2.git


## Run Tests:
```sh
./manage.py test techism2
```

## Start the Development Server
```sh
$ cd techism2
$ ./manage.py runserver
```


The following URLs are available:

* Main application: [[http://localhost:8000/]]
* Admin application: [[http://localhost:8000/admin/]]
* Development console: [[http://localhost:8000/_ah/admin]]
* Dummy Login: [[http://localhost:8000/_ah/login]]


## Update Third-Party Libraries:


### django-nonrel (9085:d578c187d733)
```sh
$ hg clone http://bitbucket.org/wkornewald/django-nonrel
$ cd django-nonrel
$ zip -r django.zip django
$ cp django.zip <path-to-techism2>/zip-packages/django.zip
```

### djangoappengine (117:cf992e9c916f)
```sh
$ hg clone http://bitbucket.org/wkornewald/djangoappengine
$ cp -a djangoappengine <path-to-techism2>
$ rm -rf <path-to-techism2>/.hg*
```

### djangotoolbox (154:3ea35d37a2b7)
```sh
$ rm -rf <path-to-techism2>/djangotoolbox
$ cp -a djangotoolbox/djangotoolbox <path-to-techism2>
```

### gaeauth (0:38772f617369)
```sh
$ rm -rf <path-to-techism2>/gaeauth
$ cp -a django-gaeauth/gaeauth <path-to-techism2>
```

### django_openid_auth (version 0.3)
Download django-openid-auth-X.Y.tar.gz from https://launchpad.net/django-openid-auth
```sh
$ tar -xvzf django-openid-auth-X.Y.tar.gz
$ cp -a django-openid-auth-X.Y/django_openid_auth <path-to-techism2>
```

### geapytz (version 2010l)
Download gaepytz-YYYYX.tar.gz from http://pypi.python.org/pypi/gaepytz
```sh
$ tar -xvzf gaepytz-YYYYX.tar.gz
$ cp -a gaepytz-YYYYX/pytz <path-to-techism2>
```

### html5lib (1641:b9d3898c665b)
```sh
$ hg clone https://html5lib.googlecode.com/hg/ html5lib
$ cd html5lib/python
$ zip -r html5lib.zip html5lib
$ cp html5lib.zip <path-to-techism2>/zip-packages/html5lib.zip
```

### python-openid (version 2.2.5)
Download python-openid-X.Y.Z.tar.gz from http://pypi.python.org/pypi/python-openid
```sh
$ tar -xvzf python-openid-X.Y.Z.tar.gz
$ cd python-openid-X.Y.Z
$ zip -r openid.zip openid
$ cp openid.zip <path-to-techism2>/zip-packages/openid.zip
```


## Deployment to App Engine:
```sh
./manage.py deploy
```


## Migration from Mixxt:
```sh
./manage.py shell
```
```py
from techism2 import migration
migration.fetch_events_from_mixxt('mixxt_events.json')
migration.fetch_archive_from_mixxt('mixxt_archive.json')
(optional: delete existing data, see below)
migration.import_from_json('mixxt_events.json')
migration.import_from_json('mixxt_archive.json')
quit()
```


## Add Dummy Locations and Events
Open the "Interactive Console" (http://localhost:8000/_ah/admin/interactive), paste this and run the program:
```py
from techism2.models import Location
from techism2.models import Event
from random import choice

# Available tags (higher weight to Pyhton and HTML)
tags=["Java","Python","Python","Python","PHP","NoSQL",".NET","MySQL","Google","Scrum","Open Source","Social","Linux","Mac","HTML","HTML","HTML","JavaScript"]

# Available cities
cities=["München"]

# Available streets
streets=["Leopoldstr.","Dachauer Str.", "Prinzregentenstr.", "Hauptbahnhof", "Marienplatz"]

# Create 10 locations, choose a random city and street
locations=[]
for i in range(1,10):
    l = Location(
        name="Location " + str(i),
        street=choice(streets),
        city=choice(cities),
        latitude=48.1372,
        longitude=11.57542)
    locations.append(l)
    l.save()

# Create 31 events, from 10 days in past to 20 days in future. 
# Choose one of the previously created locations for each event.
# Choose two of the available tags.
for i in range(-5,10):
    e = Event(
        title="Event " + str(i),
        date_time_begin=datetime.datetime.today() + datetime.timedelta(days=i),
        url="http://www.google.de",
        description="Some description of event " + str(i) + ".",
        location=choice(locations),
        tags=[choice(tags),choice(tags)],
        published=True)
    e.update_archived_flag()
    e.save()
```

## Delete all Events and Locations
```py
from techism2.models import Location
from techism2.models import Event

event_list = Event.objects.all()
for event in event_list:
    event.delete()

location_list = Location.objects.all()
for location in location_list:
    location.delete()
```

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published