forked from fr4c74l/diggems
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DEV_ENV_SETUP.txt
80 lines (59 loc) · 2.41 KB
/
DEV_ENV_SETUP.txt
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
For development:
1) Install Postgres, libpq-dev and python2.7-dev
$> su -c 'apt-get install postgresql libpq-dev'
$> su -c 'zypper install postgresql libpqxx-devel'
2) Create the database
$> sudo su postgres
$> createuser <user>
$> createdb -O <user> diggems
3) Install some OS dependencies
DEBIAN: su -c 'apt-get install libev-dev'
OPENSUSE: su -c 'zypper install libev-devel'
4) Configure the virtual environment: {optional}
4.1) Install pythonbrew
REF: https://pypi.python.org/pypi/pythonbrew/
$ curl -kL http://xrl.us/pythonbrewinstall | bash
After that, pythonbrew installs itself to ~/.pythonbrew.
4.2) Add the following line to the end of your ~/.bashrc::
#------------------------------------------------------------------------
[[ -s $HOME/.pythonbrew/etc/bashrc ]] && source $HOME/.pythonbrew/etc/bashrc
#------------------------------------------------------------------------
4.3) Install versioned python (2.7+) and virtualenvwrapper
$ pythonbrew install --configure="--enable-threads" 2.7.3
$ pythonbrew switch 2.7.3
$ pip install virtualenvwrapper
4.4) Install virtualenv
DEBIAN: su -c 'apt-get install virtualenv'
OPENSUSE: su -c 'zypper install virtualenv'
4.5) Create a directory: ~/.virtualenvs
$ mkdir ~/.virtualenvs
4.6) Add the following lines in the ~/.bashrc
------------------------------------------------------------------------
export WORKON_HOME=$HOME/.virtualenvs
export VIRTUALENVWRAPPER_PYTHON=$HOME/.pythonbrew/pythons/Python-2.7.3/bin/python
source $HOME/.pythonbrew/pythons/Python-2.7.3/bin/virtualenvwrapper.sh
------------------------------------------------------------------------
5) Install virtual environment:
$ sudo apt-get install virtualenv virtualenvwrapper
6) Create the virtual environment:
$ mkvirtualenv --no-site-packages diggemsenv
7) Change to diggemsenv and install Diggems requirements
$ workon diggemsenv
$ pip install -r local-requirements.txt
8) Create django database and run server
8.1) Add the followin line in the ~/.bashrc
------------------------------------------------------------------------
export WORKON_HOME=$HOME/.virtualenvs
8.2)
$ workon diggemsenv
8.3)
$ python manage.py syncdb
$ python manage.py createcachetable cache
$ python manage.py migrate game
$ python manage.py runserver
8.4) Aply translatinons
LANGUAGE = pt_BR, en, es, etc...
$ cd game
$ ../manage.py makemessages -l <LANGUAGE>
$ ../manage.py makemessages -d djangojs -l <LANGUAGE>
$ ../manage.py compilemessages