-
Notifications
You must be signed in to change notification settings - Fork 19
Setup guide (development, testing)
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.
There are a few dependencies that need to be installed for the program to run, namely Python 3
, ffmpeg
and some pip packages.
- 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 thePATH
environment variable). - Get the right FFMPEG build for your installed system, extract it and add its directory to the
PATH
environment variable. - Clone this repository using git, or download and extract it
- 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.
-
Run the database migrations. These will set up the database tables. In the command prompt, run these commands:
cd app
python manage.py migrate
-
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
-
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.
-
Make sure the server is stopped
-
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. -
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
- Run the migrations from step #5, and then start the server using the command from step #6.
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.
-
Install required programs:
sudo apt install python3 python3-pip ffmpeg
-
Clone this repository using git, or download and extract it
-
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.
-
Run the database migrations. These will set up the database tables. In the command prompt, run these commands:
cd app
python3 manage.py migrate
-
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
-
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.