Installation¶
This repository contains a fully functional version of fachschaftsempfaenger as it is run by the student union of Computer Science at the university of Tuebingen. This guide aims to instruct you to get your version running either in development mode on your PC or on a production version on a server.
Development Server¶
The easiest way to use this application is to install it via
pip:
pip install git+https://github.com/fsi-tue/fachschaftsempfaenger
fachschaftsempfaenger is now installed as a normal python package.
Install a Django Development Server on your local machine.
django-admin startproject yourproject
This will create a yourproject directory in your current directory:
yourproject/
manage.py
yourproject/
__init__.py
settings.py
urls.py
wsgi.py
Add fachschaftsempfaenger to your
INSTALLED_APPSinsettings.py:
INSTALLED_APPS = [
...,
'fachschaftsempfaenger'
]
Adjust your
settings.pyto accomodate uploads made by fachschaftsempfaenger:
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.0/howto/static-files/
...
MEDIA_URL = '/uploads/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'uploads')
Adjust
urls.pyto make your installation of fachschaftsempfaenger reachable:
...
from .settings import MEDIA_URL, MEDIA_ROOT
from django.urls import path, re_path, include
from django.conf.urls.static import static
urlpatterns = [
...
re_path(r'^', include('fachschaftsempfaenger.urls')),
...
] + static(MEDIA_URL, document_root=MEDIA_ROOT) # this make the uploads folder reachable
Make the migrations to adapt the database scheme locally:
python manage.py migrate
python manage.py makemigrations fachschaftsempfaenger
python manage.py migrate fachschaftsempfaenger
Define a superuser to access the Django admin:
python manage.py createsuperuser
Start a local server:
python manage.py runserver
Open a browser and go to http://127.0.0.1:8000/
Production Server¶
Note
This section is still under construction.