-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathINSTALL.Debian.txt
106 lines (86 loc) · 4.93 KB
/
INSTALL.Debian.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
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
#!/bin/bash
# Wasa2il installation instructions for Debian-based systems
# Document version 1.3
# Python package versions for reference:
# - Django (1.7)
# - django-bootstrap-form (3.1)
# - django-registration-redux (1.1)
# - lxml (3.4.0)
# - markdown2 (2.3.0)
# - MySQL-python (1.2.5)
# - Pillow (2.5.3)
# - suds (0.4)
# For the daring, you may run these instruction notes by issuing the command: "bash INSTALL.Debian.txt"
# Please note that this method is only intended for experienced users and it may very well royally screw
# an existing instance if you've already run it once.
# If you're unsure, just read these instructions and copy/paste the commands as you go.
# Install all the Debian packages we might need.
# Debian packages required: git pip python-dev libxslt1-dev libjpeg8-dev
# Optional for MySQL: libmysqlclient-dev mysql-server
# Optional for virtualenv: python-virtualenv
# If you don't have 'sudo' installed, comment the line that begins with 'sudo' and uncomment the line below which beings with 'su -c'
sudo apt-get -y install git python-pip python-dev libxslt1-dev python-virtualenv libmysqlclient-dev mysql-server libjpeg8-dev
#su -c "apt-get -y install git python-pip python-dev libxslt1-dev python-virtualenv libmysqlclient-dev mysql-server"
# Prepare MySQL database.
# NOTE: This assumes that you have a MySQL server running locally and that you have the root password.
mysql -u root -p -e "CREATE DATABASE wasa2il;"
mysql -u root -p -e "GRANT ALL ON wasa2il.* TO 'wasa2il'@'localhost' IDENTIFIED BY 'wasa2il-pass';"
# Retrieve source code.
git clone https://github.com/piratar/wasa2il.git
# Setup and enable virtualenv.
# NOTE: This step is not required but is recommended to isolate the Python packages required
# to run Wasa2il from the rest of the system. If you skip this step, you will probably need root
# access for the 'pip' command below and your packages will be system-wide.
# If you're unsure, follow this step. Virtualenv is cool.
virtualenv --no-site-packages wasa2il
source wasa2il/bin/activate
# Install Python dependency packages.
pip install -r wasa2il/requirements.txt
# Create local settings skeleton.
cp wasa2il/wasa2il/local_settings.py-example wasa2il/wasa2il/local_settings.py
# Open local_settings.py with a text editor and configure (in this case, with 'nano').
nano wasa2il/wasa2il/local_settings.py
# Configure the database, example is provided for MySQL as configured above.
# DATABASE_ENGINE = 'django.db.backends.mysql'
# DATABASE_HOST = 'localhost'
# DATABASE_PORT = ''
# DATABASE_NAME = 'wasa2il'
# DATABASE_USER = 'wasa2il'
# DATABASE_PASSWORD = 'wasa2il-pass'
# Configure a secret, random key - just bash the keyboard for a bit.
# IMPORTANT: MAKE YOUR OWN STRING! DO NOT USE ONE FROM INSTRUCTIONS!
# SECRET_KEY = '34gjap48jg34hgoahra3g4oagq0220fj20fj1fj1jag344h009gr'
# If you intend to use email, uncomment and configure mail settings.
# Otherwise, the default email backend prints to console, useful for development.
# Assuming a command line, run: python -m smtpd -n -c DebuggingServer localhost:25000
# EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
# EMAIL_HOST = 'localhost'
# EMAIL_PORT = '25000'
# EMAIL_HOST_USER = ''
# EMAIL_HOST_PASSWORD = ''
# EMAIL_USE_TLS = False
# Create database tables and relationships
# NOTE: If you're using Virtualenv, it is assumed that you've run "source wasa2il/bin/activate" as above.
wasa2il/wasa2il/manage.py migrate
# Create superuser account.
# For the remainder of this tutorial we will assume the username 'johndoe'.
# NOTE: If you're using Virtualenv, it is assumed that you've run "source wasa2il/bin/activate" as above.
wasa2il/wasa2il/manage.py createsuperuser
# Compile the translation files. This is optional.
# NOTE: If you're using Virtualenv, it is assumed that you've run "source wasa2il/bin/activate" as above.
ls wasa2il/wasa2il/locale | xargs -n 1 pybabel compile -d wasa2il/wasa2il/locale/ -D django -l
# Run the server.
# The default port is 8000 and doesn't need to be specified.
# However, to allow connections from outside of localhost, for example if you running
# the project in a virtual machine, you should add "0.0.0.0:8000".
# NOTE: If you're using Virtualenv, it is assumed that you've run "source wasa2il/bin/activate" as above.
wasa2il/wasa2il/manage.py runserver 0.0.0.0:8000
# Open the website with your favorite browser.
# Typically the address will be http://localhost:8000 - although if you're running
# the project in a virtual machine, you will have to figure out the networking yourself.
# VirtualBox hint: VM Settings -> Network -> Adapter 1 -> Attached to: "Bridged Adapter"
# Login to the website, using the credentials you declared when running 'syncdb' above.
# In the case of this tutorial, it is "johndoe".
# After login, follow the page for creating a new polity.
# This first polity automatically becomes the main polity, called a front polity.
# We're done! You now should have a running Wasa2il instance ready to mess around with!