Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.

First steps to UniSport-O-Mat

Some notes

To ensure a clean development and production environment, we will use virtualenv. If you have not installed or used it yet, please refer to the official documentation.

Starting virtualenv

First create a new folder, in which you want to give this project a new home. Then, create a new virtualenv via this command in your terminal

virtualenv -p python3 .

You'll see a few new folders and a config file for your virtualenv. You can start the new environment via this command in your terminal, depending on your OS.

Linux/MacOS:

source bin/activate

Windows

Scripts/activate

If done correctly, you'll see the name of the virtual environment printed at the beginning of your command promt, eg. in bash:

(unisport-o-mat) 18:57:55 [foo@bar unisport-o-mat]$

Cloning the project

To clone the project via git, please enter one of these commands via your terminal, depending on your preferred way to authenticate. Via HTTPS:

git clone https://git.imp.fu-berlin.de/swp-unisport/team-warumkeinrust/unisport-o-mat.git

Via ssh:

git clone git@git.imp.fu-berlin.de:swp-unisport/team-warumkeinrust/unisport-o-mat.git

Installing dependencies

You can verify that no python libraries are installed in your virtualenv, if you enter the following command via terminal. It should not return any modules right now.

python -m pip freeze

All required dependency, such as Django, will be installed via pip and a text file, such as requirements.txt. First, switch the current directory via cd into the cloned folder. Then, install the dependencies all at once via this command in your terminal.

python -m pip install -r requirements.txt

Starting the django web server

To start the web server, change the directory via cd in the project folder. Here you will find the manage.py script, which will be used to start commands depending on the Django framework. Start the web server via this command in your terminal.

python manage.py runserver

If successful, you can now see the running server in your browser at http://127.0.0.1:8000.

Populate the database with test data

To populate the database with some test data run

python manage.py seed_db [-y] [--seed SEED] [--no-superuser]

All the existing data from your database will be lost!
Per default a super user called "admin" will be created for development. You will be prompted for a password.
Run python manage.py seed_db --help for more information.

Use the django admin interface to view and edit data during development

If you started the server as described above, you can access the django admin interface on localhost:8000/admin.
If you seeded the database you can login with username: "admin" and the password you specified.