.. include:: common.rst

.. _getting-started:

Getting Started
===============

Start A Django Project
----------------------

First, you will need a working Django project. Instructions on how to set one up can be found on Django's website_.

.. _website: https://docs.djangoproject.com/en/2.0/intro/install/

Once you have a working Django project, you will need to install Minecraft Manager.



Clone MCM
---------

In your Django project, import your forked MCM repository as ``minecraft_manager``
::

	git clone https://git.etztech.xyz/Etzelia/MinecraftManagerDjango.git minecraft_manager


Add To Project
--------------

In ``settings.py`` add minecraft_manager to INSTALLED_APPS

Make sure to set up the database once the app is installed.
::

	python manage.py makemigrations
	python manage.py migrate

Add MCM urls to your ``urls.py``
::

	path('whitelist/', include('minecraft_manager.urls')),
	path('api/', include('minecraft_manager.api.urls')),
	path('web/', include('minecraft_manager.external.urls'))

.. note::
	Django doesn't provide login/logout templates by default, so MCM has some generic ones if needed.
	::

		from django.contrib.auth import views as auth_views
		path('accounts/login/', auth_views.LoginView.as_view(template_name='minecraft_manager/login.html'),  name='login'),
		path('accounts/logout/', auth_views.LogoutView.as_view(template_name='minecraft_manager/logged_out.html'),  name='logout'),


Configure Settings
------------------

MCM has plenty of optional settings, however there are a few required ones. Refer to :ref:`django-settings` for a complete list.