-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
executable file
·55 lines (44 loc) · 2.21 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
How to taste it
what you need is:
- python 2.5 or higher installed.
NOTE: Django framework works with any Python version from 2.4 to 2.7 (due to backwards incompatibilities in Python 3.0, Django does not currently work with Python 3.0;
- django framework installed (http://www.djangoproject.com/ take the latest one)
- python-aspects-1.3 (http://www.cs.tut.fi/~ask/aspects/index.shtml)
Before any further actions performed, remember to edit
* settings.py file:
- specify absolute path to db file -> DATABASE_NAME = 'D:\\currworkspace\\dj_test\\sqlite.db'
- specify absolute path to templates directory -> TEMPLATE_DIRS = (
"D:/currworkspace/dj_test/src/templates",
)
* urls.py file:
- specify absolute path to media root folder -> (r'^makler/media(?P<path>.*)$', 'django.views.static.serve',
{'document_root': 'D:/currworkspace/dj_test/src/templates/makler/media'}),
how to run web app:
- cd dj_test/src/dj_test folder
- run "python manage.py runserver"
- take a look at localhost:8000/makler page from your browser
how to run tests:
- set your PYTHONPATH, for example "set PYTHONPATH=%PYTHONPATH%;D:\currworkspace\dj_test\src"
- cd to tests\parser, for example: "cd D:\currworkspace\dj_test\src\tests\parser"
- run "python bunch_test.py"
internalization:
* To use internalization in your py scripts:
from django.utils.translation import ugettext as _
...
SPORTS_CHOICES = (
('basketball', _('Basketball')),
('football', _('Football')),
('hockey', _('Hockey')),
)
Now, your Basketball, Football and Hockey strings will be translated into current locale.
* To use internalization in your html files(remember that the flow is different for javascript files):
place {% load i18n %} some where in the begginning of html(or even template if any):
{% load i18n %}
...
{% trans "Room count:" %}
* To generate messages file run(in project folder):
- python manage.py makemessages -l ru # to generate messages for ru language
- python manage.py compilemessages # to compile messages
- restart server
There is much more about internalization, see http://docs.djangoproject.com/en/dev/topics/i18n
PLEASE CONFIGURE YOUR IDE TO USED WHITESPACES INSTEAD OF TABS