Kevin Mok
5 years ago
13 changed files with 82 additions and 69 deletions
-
4.gitignore
-
16README.md
-
6login/views.py
-
40requirements.txt
-
2scripts/create_user.sql
-
8scripts/queries/history.sql
-
0scripts/queries/most-played.sql
-
40scripts/requirements.txt
-
21scripts/reset_db.sh
-
4scripts/reset_db.sql
-
8spotifyvis/settings.py
-
1spotifyvis/urls.py
-
1static/todo.md
@ -0,0 +1,40 @@ |
|||
astroid==2.2.5 |
|||
backports.csv==1.0.7 |
|||
certifi==2019.6.16 |
|||
chardet==3.0.4 |
|||
defusedxml==0.6.0 |
|||
Django==2.2.4 |
|||
django-appconf==1.0.3 |
|||
django-compressor==2.3 |
|||
django-crispy-forms==1.7.2 |
|||
django-filter==2.2.0 |
|||
django-sass-processor==0.7.3 |
|||
django-tables2==2.1.0 |
|||
djangorestframework==3.10.2 |
|||
et-xmlfile==1.0.1 |
|||
idna==2.8 |
|||
isort==4.3.21 |
|||
jdcal==1.4.1 |
|||
lazy-object-proxy==1.4.2 |
|||
libsass==0.19.2 |
|||
mccabe==0.6.1 |
|||
odfpy==1.4.0 |
|||
openpyxl==2.6.3 |
|||
psycopg2==2.8.3 |
|||
psycopg2-binary==2.8.3 |
|||
pylint==2.3.1 |
|||
python-dateutil==2.8.0 |
|||
pytz==2019.2 |
|||
PyYAML==5.1.2 |
|||
rcssmin==1.0.6 |
|||
requests==2.22.0 |
|||
rjsmin==1.1.0 |
|||
six==1.12.0 |
|||
sqlparse==0.3.0 |
|||
tablib==0.13.0 |
|||
typed-ast==1.4.0 |
|||
unicodecsv==0.14.1 |
|||
urllib3==1.25.3 |
|||
wrapt==1.11.2 |
|||
xlrd==1.2.0 |
|||
xlwt==1.3.0 |
@ -0,0 +1,2 @@ |
|||
DROP ROLE IF EXISTS spotifyvis_user; |
|||
CREATE ROLE spotifyvis_user LOGIN PASSWORD 'spotifyvis_user'; |
@ -1,40 +0,0 @@ |
|||
astroid==2.2.5 |
|||
backports.csv==1.0.7 |
|||
certifi==2019.3.9 |
|||
chardet==3.0.4 |
|||
defusedxml==0.5.0 |
|||
Django==2.2 |
|||
django-appconf==1.0.3 |
|||
django-compressor==2.2 |
|||
django-crispy-forms==1.7.2 |
|||
django-filter==2.1.0 |
|||
django-sass-processor==0.7.3 |
|||
django-tables2==2.0.6 |
|||
djangorestframework==3.9.2 |
|||
et-xmlfile==1.0.1 |
|||
idna==2.8 |
|||
isort==4.3.17 |
|||
jdcal==1.4 |
|||
lazy-object-proxy==1.3.1 |
|||
libsass==0.18.0 |
|||
mccabe==0.6.1 |
|||
odfpy==1.4.0 |
|||
openpyxl==2.6.2 |
|||
psycopg2==2.8.2 |
|||
psycopg2-binary==2.8.2 |
|||
pylint==2.3.1 |
|||
python-dateutil==2.8.0 |
|||
pytz==2019.1 |
|||
PyYAML==5.1 |
|||
rcssmin==1.0.6 |
|||
requests==2.21.0 |
|||
rjsmin==1.1.0 |
|||
six==1.12.0 |
|||
sqlparse==0.3.0 |
|||
tablib==0.13.0 |
|||
typed-ast==1.3.1 |
|||
unicodecsv==0.14.1 |
|||
urllib3==1.24.1 |
|||
wrapt==1.11.1 |
|||
xlrd==1.2.0 |
|||
xlwt==1.3.0 |
@ -1,15 +1,16 @@ |
|||
# check if in virtual environment |
|||
# https://stackoverflow.com/questions/15454174/how-can-a-shell-function-know-if-it-is-running-within-a-virtualenv/15454916 |
|||
#!/bin/bash |
|||
|
|||
# python -c 'import sys; print(sys.real_prefix)' 2>/dev/null && INVENV=1 || INVENV=0 |
|||
# INVENV=$(python -c 'import sys; print ("1" if hasattr(sys, "real_prefix") else "0")') |
|||
# check if in virtual environment |
|||
# https://stackoverflow.com/a/15454284/8811872 |
|||
|
|||
[[ "$VIRTUAL_ENV" == "" ]]; INVENV=$? |
|||
# if $INVENV is 1, then in virtualenv |
|||
# echo $INVENV |
|||
# if [ $INVENV -eq 1 ]; then |
|||
if [ $INVENV -eq 1 ]; then |
|||
rm login/migrations/0* api/migrations/0* |
|||
sudo -u postgres psql -f reset_db.sql |
|||
python manage.py makemigrations login api |
|||
python manage.py migrate --fake |
|||
python manage.py runserver |
|||
# fi |
|||
sudo -u postgres psql -f ./scripts/reset_db.sql |
|||
python3 manage.py makemigrations login api |
|||
python3 manage.py migrate --fake |
|||
python3 manage.py runserver |
|||
fi |
|||
|
@ -1,3 +1,3 @@ |
|||
DROP DATABASE spotifyvis; |
|||
DROP DATABASE IF EXISTS spotifyvis; |
|||
CREATE DATABASE spotifyvis; |
|||
GRANT ALL PRIVILEGES ON DATABASE spotifyvis TO django; |
|||
GRANT ALL PRIVILEGES ON DATABASE spotifyvis TO spotifyvis_user; |
Write
Preview
Loading…
Cancel
Save
Reference in new issue