-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall
More file actions
executable file
·48 lines (40 loc) · 1.18 KB
/
Copy pathinstall
File metadata and controls
executable file
·48 lines (40 loc) · 1.18 KB
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
#!/bin/bash
# You'll need Python 2.7+ for this application. RHEL, notably,
# uses 2.6 as default. Change this variable to wherever you've
# compiled Python 2.7.
# E.g.
# PYTHON_PATH="/usr/bin/python2.7"
PYTHON_PATH=$(which python)
# Halt if virtualenv or pip are not installed
for command in virtualenv pip; do
which $command &> /dev/null
if [ $? -ne 0 ]; then
echo -e "! Check if $command is installed";
exit 1
fi
done
# Warning about Python 2.7
echo -e "
! Things won't work if you don't have Python 2.7+
Cancel in the next few seconds if you don't.
See README.md or edit this file if you've compiled
it for your platform.
"
echo -n "You're currently using "
$PYTHON_PATH --version
sleep 9
# Create a nice virtual environment
virtualenv -p $PYTHON_PATH .
source ./bin/activate
# Install required modules
pip install -r requirements.txt
# Create some folders and logfiles
mkdir -p logs uploads
touch logs/nginx.{access,error}.log
# Don't track a few files
echo -e "install" >> ./.gitignore
echo -e "scripts/run.sh" >> ./.gitignore
echo -e "settings.py" >> ./.gitignore
# Generate secret key
secret_key=$(openssl rand -base64 24)
echo -e "SECRET_KEY = \"$secret_key\"" >> settings.py