Merge branch 'refactor' of https://github.com/chibicitiberiu/ytsm into refactor

This commit is contained in:
Tiberiu Chibici 2020-10-18 19:33:05 +03:00
commit c8b2ef77e6
4 changed files with 26 additions and 1 deletions

View File

@ -5,7 +5,12 @@ import json
def fix_video_provider(apps, schema_editor): def fix_video_provider(apps, schema_editor):
try:
globalPrefs = apps.get_model('dynamic_preferences', 'GlobalPreferenceModel') globalPrefs = apps.get_model('dynamic_preferences', 'GlobalPreferenceModel')
except LookupError as e:
print("Warning: could not get dynamic_preferences model.")
return
api_key_entries = globalPrefs.objects.filter(name='youtube_api_key') api_key_entries = globalPrefs.objects.filter(name='youtube_api_key')
if len(api_key_entries) < 1: if len(api_key_entries) < 1:
return return

16
make_venv.cmd Normal file
View File

@ -0,0 +1,16 @@
@echo off
echo Installing venv...
python -m pip install virtualenv
echo[
echo Creating venv...
python -m venv venv
call venv\Scripts\activate.bat
echo[
echo Pulling dependencies...
pip install --upgrade pip
pip install -r requirements.txt
pause

2
manage.cmd Normal file
View File

@ -0,0 +1,2 @@
@echo off
python %~dp0\app\manage.py %*

2
venv_cmd.cmd Normal file
View File

@ -0,0 +1,2 @@
@set APP_PATH=%~dp0\app
@cmd /k "set PATH=%PATH%;%APP_PATH% && venv\Scripts\activate.bat