13 | | svn co http://codespeak.net/svn/pypy/dist pypy-dist |
14 | | }}} |
15 | | This checks out a pypy package and a py package(has py.test and other neat Python code) |
16 | | If you are using git to check out, check out the py repository separately or install py using easy_install. |
17 | | |
18 | | PyPy runs on |
19 | | * Windows 32bit |
20 | | * Mac OS X Intel and PPC |
21 | | * Linux 32bit and 64bit |
22 | | |
23 | | == Build pypy-c == |
24 | | |
25 | | Don't try this on a weak machine. It must have at least 1Gb memory and a 2+Gb swap space or it will do a lot of swapping. 2Gb is plenty. |
26 | | Expect it to take 30-60 minutes |
27 | | {{{ |
28 | | cd pypy/translator/goal |
29 | | ./translate.py --batch --opt=3 |
30 | | }}} |
31 | | This will create a pypy-c executable in the current directory. |
32 | | * Python Language |
33 | | * Thread support |
34 | | * Hybrid generational style garbage collector |
35 | | * All optimisations |
36 | | * All working modules |
37 | | * Support old style classes style as done in Python 2.5 (default) |
38 | | |
39 | | The generated interpreter will use the modified |
40 | | and standard Python libraries bundled with the PyPy source code if a runtime library is not already on the PYTHONPATH. |
41 | | |
42 | | Now copy or link the pypy-c executable to a place that is on your PATH, such as: |
43 | | {{{ |
44 | | ln -s pypy-c /opt/local/bin |
| 7 | pypy ./manage.py syncdb |
| 8 | pypy ./manage.py runserver |
51 | | === Platform prerequisites === |
52 | | |
53 | | To compile PyPy you need a couple of developer tools. Essentially, |
54 | | * Python 2.5 or 2.4 with ctypes |
55 | | * C Compiler (gcc or equivalent) |
56 | | * C Libraries |
57 | | * libbz2-dev |
58 | | * zlib-dev |
59 | | * libffi |
60 | | * python-dev |
61 | | |
62 | | For testing you probably use sqlite for the database. Make sure you have the proper database |
63 | | client software installed. |
64 | | |
65 | | === For Mac === |
66 | | |
67 | | * Install Developer Tools |
68 | | * Install [http://www.macports.org MacPorts] |
69 | | * Install python25 and libffi via [http://www.macports.org MacPorts] |
70 | | |
71 | | |
72 | | And you should be good to go |
73 | | |
74 | | |
75 | | == Check out Django == |
76 | | |
77 | | Do a subversion checkout of django trunk. |
78 | | {{{ |
79 | | svn co http://code.djangoproject.com/svn/django/trunk/ django-trunk |
80 | | }}} |
81 | | |
82 | | Django does not need to be modified in order to run on top of PyPy. |
83 | | |
84 | | == Python 2.4 == |
85 | | |
86 | | PyPy supports the 2.4 runtime library (although the work is underway to improve the situation), |
87 | | so you have to be aware of code using 2.5 features. |
88 | | |
89 | | Django only requires Python 2.3. So as such Django runs just fine on PyPy. |
90 | | But, be aware that many popular django applications depend on Python 2.5 runtime lib. |
91 | | |
92 | | Getting the Pinax Django Hotclub project running we needed a couple of extra dependencies, |
93 | | * elementtree |
94 | | * hashlib |
95 | | But these have now been included in PyPy during the EuroPython sprint (well done hpk & hruske). |
96 | | |
97 | | If you try to run Pinax on cPython 2.4 you would have this dependency problem. |
98 | | |
99 | | Also be on the lookout for dependency on PIL, which is not currently ported to ctypes |
100 | | |
101 | | == Pinax Project == |
102 | | |
103 | | If you want to get the Pinax project up and running you need to check out the trunk |
104 | | {{{ |
105 | | svn checkout http://django-hotclub.googlecode.com/svn/trunk/ django-hotclub |
106 | | }}} |
107 | | This checks out pinax and all the associated applications from Google Code. If you want to check out with |
108 | | git follow the instructions on the project wiki at |
109 | | |
110 | | http://code.google.com/p/django-hotclub/wiki/UsingGit |
111 | | |
112 | | |
113 | | == Run Django == |
114 | | |
115 | | Switch to the Pinax project directory and run the development server |
116 | | {{{ |
117 | | pypy-c ./manage.py syncdb |
118 | | pypy-c ./manage.py runserver --noreload |
119 | | }}} |
120 | | |
121 | | Reloading doesn't seem to be working properly at the moment, so you need to disable it. |
| 15 | Some C-based DB drivers don't work with [[http://pypy.org/ | PyPy]]. See the |
| 16 | [[https://bitbucket.org/pypy/compatibility/wiki/Home#!db-adaptors | Compatibility Wiki]] for an overview of what works. |