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
|
Standalone Setup
----------------
NOTE: The standalone setup is most suitable for development.
For docker setup use the Docker-based setup covered in the
main README.
In order to run this application standalone, you will need:
* Python 3.4 or newer
* Django 2.2 - tested with 2.2; newer versions may work, but
haven't been tested.
* Third-party Django/python modules as detailed by requirements.txt.
If you're using pip, you can install these by running:
pip install -r requirements.txt
* For production usage, a web server set up to host Django applications
(not needed for local-only testing)
* A database supported by Django (SQLite, MySQL, etc.). Django takes
care of creating the database itself, you just need to ensure that the
database server (if not using SQLite) is configured and running.
Example virtualenv-based setup for the above:
Python's virtualenv provides an easy way to isolate the python dependencies
of applications such as the layer index. Here's an example of setting up a
virtualenv for the layer index that's particularly useful for development.
(This assumes a Debian-based distribution, adjust accordingly for other
distros).
1. Install required host distro packages (some of these are required by
pip to build the dependencies; it's also assumed you want MariaDB as
the database backend):
sudo apt-get install git virtualenv libmariadb-dev build-essential python3-dev libjpeg-dev libz-dev libfreetype6-dev mariadb-server rabbitmq-server
2. Work around path issues (you may not need this):
sudo ln -s /usr/bin/mariadb_config /usr/bin/mysql_config
3. Create a Python 3 virtualenv (path can be anywhere you like):
virtualenv -p python3 /path/to/desired/venv
4. Activate the virtualenv:
. /path/to/desired/venv/bin/activate
5. Install requirements:
pip install -r requirements.txt
Setup instructions:
1. Edit settings.py to specify a database, EMAIL_HOST, SECRET_KEY and
other settings specific to your installation. Ensure you set
REPO_BASE_DIR to an absolute path (Eg: /tmp/repos) to a location with sufficient
space for fetching layer repositories.
2. Run the following commands within the git-refinery-web directory to
initialise the database:
./manage.py migrate
./manage.py createsuperuser
You should answer "yes" when asked to create an admin account.
3. You can test the web application locally by setting DEBUG = True in
settings.py and running the following:
./manage.py runserver
Then visit http://127.0.0.1:8000/gitrefinery/ with your browser. As
with all Django applications there is an admin interface available
at http://127.0.0.1:8000/admin/ also. The initial login and password
will be those you entered in the step above when creating an admin
account.
NOTE: This local server should only be used for testing - for
production you need to use a proper web server and have DEBUG set
to False.
4. Set the site name (as displayed in the top bar and page titles) by
going into the admin interface (http://127.0.0.1:8000/admin/),
clicking on "Sites" at the bottom, and editing the first entry,
setting "Display name" to the desired name.
|