Skip to content

Setup guide (development, testing)

chibicitiberiu edited this page Dec 30, 2018 · 5 revisions

This guide will show how to setup YTSM for development or testing. This is not ideal for a production environment, but it is a good starting point.

Windows

There are a few dependencies that need to be installed for the program to run, namely Python 3, ffmpeg and some pip packages.

  1. Get latest version of Python 3 from the official website, and install it. Make sure Python is in your PATH environment variable (here you can find a detailed guide how to add something to the PATH environment variable).
  2. Get the right FFMPEG build for your installed system, extract it and add its directory to the PATH environment variable.
  3. Clone this repository using git, or download and extract it
  4. Install required pip packages; to do this, open up a command prompt and navigate to the repository folder (Shift + Right click somewhere in the extracted repository - Open Command Window Here), and execute this command: pip install --no-cache-dir -r requirements.txt.

Now that all the dependencies are installed, the next stage is to configure the application. By default, application data (the database, logs, thumbnails) is stored in the /data directory where the application is installed, but it can be configured by setting a YTSM_DATA_DIR environment variable. You can also change some stuff in /config/config.ini, such as the database (the default is SQLite, but you can use any database you want). Once you are done customizing, continue with the following steps.

  1. Run the database migrations. These will set up the database tables. In the command prompt, run these commands:

    cd app

    python manage.py migrate

  2. Start the server by running the following command. Replace [port] with any port you want (the parameter is optional).

    python manage.py runserver [port] --noreload

  3. Open your browser, and go to the address: localhost:port (port is what you set previously). The application should now guide you through the rest of the setup.

Upgrading

  1. Make sure the server is stopped

  2. Get the latest version of YTSM (using git pull or download latest version, extract). If you haven't modified the application data folder, you should copy it to the new extracted folder. I recommend making a backup of the database between upgrades, since this application is still in development, there is a risk of data loss.

  3. Run the pip command from step #4 to make sure any new dependency is installed. At this stage, we can also upgrade all the packages to the latest version.

pip install --no-cache-dir -r requirements.txt

pip install --no-cache-dir --upgrade -r requirements.txt

  1. Run the migrations from step #5, and then start the server using the command from step #6.

Linux

The steps are pretty similar to the Windows section, only some commands are slightly different. In this guide I will show how to install on Ubuntu systems, but it should be pretty easy to figure out on other systems as well.

  1. Install required programs:

    sudo apt install python3 python3-pip ffmpeg

  2. Clone this repository using git, or download and extract it

  3. Install required pip packages:

    sudo pip3 install --no-cache-dir -r requirements.txt

Now that all the dependencies are installed, the next stage is to configure the application. By default, application data (the database, logs, thumbnails) is stored in the /data directory where the application is installed, but it can be configured by setting a YTSM_DATA_DIR environment variable. You can also change some stuff in /config/config.ini, such as the database (the default is SQLite, but you can use any database you want). Once you are done customizing, continue with the following steps.

  1. Run the database migrations. These will set up the database tables. In the command prompt, run these commands:

    cd app

    python3 manage.py migrate

  2. Start the server by running the following command. Replace [port] with any port you want (the parameter is optional).

    python3 manage.py runserver [port] --noreload

  3. Open your browser, and go to the address: localhost:port (port is what you set previously). The application should now guide you through the rest of the setup.

Clone this wiki locally