Geoffrey-Django/GeoffreyApp/docs/source/getting_started.rst

113 lines
2.2 KiB
ReStructuredText
Raw Normal View History

2019-01-02 23:48:31 +00:00
.. _getting_started:
.. |br| raw:: html
2019-01-02 23:48:31 +00:00
<br>
2019-01-02 23:48:31 +00:00
***************
Getting Started
***************
2019-01-02 23:48:31 +00:00
Requirements
#############
Versions shown have been tested to work
2019-01-02 23:48:31 +00:00
* `Python 3.6.6`_
* `Django 2.1.2`_
* `Requests 2.20.0`_
* `simplejson 3.16.0`_
2019-01-02 23:48:31 +00:00
.. _Python 3.6.6: https://www.python.org/
.. _Django 2.1.2: https://pypi.org/project/Django/
.. _Requests 2.20.0: https://pypi.org/project/requests2/
.. _simplejson 3.16.0: https://pypi.org/project/simplejson/
2019-01-02 23:48:31 +00:00
Setup
#####
.. Note:: Geoffrey is a Django application. To install Geoffrey, you need to have a Django site already setup instructions to do that can be found `here`_
2019-01-02 23:48:31 +00:00
2019-08-21 13:27:59 +00:00
.. _here: https://docs.djangoproject.com/en/2.1/intro/tutorial01/
2019-01-02 23:48:31 +00:00
2019-05-11 01:51:06 +00:00
Installing GeoffreyApp From Source
**********************************
1. Download Geoffrey by cloning it
::
2019-01-02 23:48:31 +00:00
git clone https://git.etztech.xyz/ZeroHD/Geoffrey.git GeoffreyApp
2019-01-02 23:48:31 +00:00
2019-05-11 01:51:06 +00:00
2. Change directories into GeoffreyApp
::
cd GeoffreyApp/
2019-05-11 01:51:06 +00:00
3. Install Geoffrey as a module
2019-05-11 01:51:06 +00:00
::
pip3 install -e .
2019-05-11 01:51:06 +00:00
Integrate Geoffrey Into a Django Project
******************************************
1. In ``settings.py`` add ``GeoffreyApp`` to ``INSTALLED_APPS``
::
INSTALLED_APPS = [
'GeoffreyApp',
...
2019-01-02 23:48:31 +00:00
2. Once installed, run the migrations to setup the database for the first time
::
2019-01-02 23:48:31 +00:00
python manage.py makemigrations
python manage.py migrate
2019-01-02 23:48:31 +00:00
3. Then add the URLs to your projects's ``urls.py``
::
2019-05-11 01:51:06 +00:00
path('GeoffreyApp/', include('GeoffreyApp.urls')),
2019-01-02 23:48:31 +00:00
Setup Settings
**************
To setup your ``settings.py`` for Geoffrey, checkout :ref:`django_settings`
2019-01-02 23:48:31 +00:00
Enable Username Updates
***********************
Minecraft usernames in Geoffrey can be updated using the `update_mc_username` sub-command:
::
python manage.py update_mc_username
2019-07-21 21:38:26 +00:00
To handle username updates automatically, an external scheduling program should be used. Below is an example of how to
do this with a Linux cron job:
.. code-block:: bash
#!/bin/bash
PATH_TO_GEOFFREY_MANAGE=/home/geoffrey/django/manage.py
PATH_TO_VENV=/home/geoffrey/venv
source "$PATH_TO_VENV/bin/activate"
python $PATH_TO_GEOFFREY_MANAGE update_mc_username
deactivate
2019-07-21 21:38:26 +00:00
The above script should be placed in the appropriate `/etc/cron.` directory.
2019-01-02 23:48:31 +00:00