This repository has been archived by the owner on Mar 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
174 lines (139 loc) · 4.48 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# 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 [email protected]: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()
```