diff --git a/.env.example b/.env.example index dd17f0f..cfc4629 100644 --- a/.env.example +++ b/.env.example @@ -9,3 +9,9 @@ SENTRY_DSN= EMAIL_PASSWORD= EMAIL_USER= EMAIL_USE_SSL=false + +LAST_FM_API_KET= +LAST_FM_SECRET= +SPOTIFY_ID= +SPOTIFY_SECRET= +YANDEX_TOKEN= diff --git a/about_page/about.html b/about_page/about.html new file mode 100644 index 0000000..c6ce5d5 --- /dev/null +++ b/about_page/about.html @@ -0,0 +1,96 @@ + + +
+ + +This is mainly the backend of music, you should consider using side clients like: otomir23's client
+{% if request.user.is_authenticated %} + {% if last_fm_account %} +Last.fm connected to {{ last_fm_account }}, reconnect
+ {% else %} +Last.fm is not connected, connect
+ {% endif %} +{% else %} +Login to connect last.fm account
+{% endif %} +{% endblock %} diff --git a/akarpov/users/migrations/0014_alter_user_agree_data_to_be_sold.py b/akarpov/users/migrations/0014_alter_user_agree_data_to_be_sold.py new file mode 100644 index 0000000..7a6ce60 --- /dev/null +++ b/akarpov/users/migrations/0014_alter_user_agree_data_to_be_sold.py @@ -0,0 +1,19 @@ +# Generated by Django 4.2.8 on 2024-01-14 12:06 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("users", "0013_user_agree_data_to_be_sold"), + ] + + operations = [ + migrations.AlterField( + model_name="user", + name="agree_data_to_be_sold", + field=models.BooleanField( + default=False, verbose_name="Agree my data to be sold to vendors" + ), + ), + ] diff --git a/akarpov/users/themes/migrations/0002_alter_theme_color.py b/akarpov/users/themes/migrations/0002_alter_theme_color.py new file mode 100644 index 0000000..21a9efa --- /dev/null +++ b/akarpov/users/themes/migrations/0002_alter_theme_color.py @@ -0,0 +1,20 @@ +# Generated by Django 4.2.8 on 2024-01-14 12:06 + +import colorfield.fields +from django.db import migrations + + +class Migration(migrations.Migration): + dependencies = [ + ("themes", "0001_initial"), + ] + + operations = [ + migrations.AlterField( + model_name="theme", + name="color", + field=colorfield.fields.ColorField( + default="#FFFFFF", image_field=None, max_length=25, samples=None + ), + ), + ] diff --git a/config/settings/base.py b/config/settings/base.py index ea0e5b0..959f1c2 100644 --- a/config/settings/base.py +++ b/config/settings/base.py @@ -599,6 +599,10 @@ # YANDEX_MUSIC MUSIC_YANDEX_TOKEN = env("YANDEX_TOKEN", default="") +# LAST.FM +LAST_FM_API_KEY = env("LAST_FM_API_KET", default="") +LAST_FM_SECRET = env("LAST_FM_SECRET", default="") + # ROBOTS # ------------------------------------------------------------------------------ ROBOTS_USE_SITEMAP = True diff --git a/poetry.lock b/poetry.lock index 945898e..9e0a206 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2728,6 +2728,51 @@ files = [ {file = "hiredis-2.3.2.tar.gz", hash = "sha256:733e2456b68f3f126ddaf2cd500a33b25146c3676b97ea843665717bda0c5d43"}, ] +[[package]] +name = "httpcore" +version = "1.0.2" +description = "A minimal low-level HTTP client." +optional = false +python-versions = ">=3.8" +files = [ + {file = "httpcore-1.0.2-py3-none-any.whl", hash = "sha256:096cc05bca73b8e459a1fc3dcf585148f63e534eae4339559c9b8a8d6399acc7"}, + {file = "httpcore-1.0.2.tar.gz", hash = "sha256:9fc092e4799b26174648e54b74ed5f683132a464e95643b226e00c2ed2fa6535"}, +] + +[package.dependencies] +certifi = "*" +h11 = ">=0.13,<0.15" + +[package.extras] +asyncio = ["anyio (>=4.0,<5.0)"] +http2 = ["h2 (>=3,<5)"] +socks = ["socksio (==1.*)"] +trio = ["trio (>=0.22.0,<0.23.0)"] + +[[package]] +name = "httpx" +version = "0.26.0" +description = "The next generation HTTP client." +optional = false +python-versions = ">=3.8" +files = [ + {file = "httpx-0.26.0-py3-none-any.whl", hash = "sha256:8915f5a3627c4d47b73e8202457cb28f1266982d1159bd5779d86a80c0eab1cd"}, + {file = "httpx-0.26.0.tar.gz", hash = "sha256:451b55c30d5185ea6b23c2c793abf9bb237d2a7dfb901ced6ff69ad37ec1dfaf"}, +] + +[package.dependencies] +anyio = "*" +certifi = "*" +httpcore = "==1.*" +idna = "*" +sniffio = "*" + +[package.extras] +brotli = ["brotli", "brotlicffi"] +cli = ["click (==8.*)", "pygments (==2.*)", "rich (>=10,<14)"] +http2 = ["h2 (>=3,<5)"] +socks = ["socksio (==1.*)"] + [[package]] name = "humanize" version = "4.9.0" @@ -4748,6 +4793,23 @@ check = ["check-manifest", "docutils", "flake8", "flake8-black", "flake8-depreca docs = ["sphinx (>=1.8)", "sphinx-intl", "sphinx-py3doc-enhanced-theme", "sphinx-rtd-theme"] test = ["coverage[toml] (>=5.2)", "py-cpuinfo", "pytest", "pytest-benchmark", "pytest-cov", "pytest-pep8", "pytest-profiling"] +[[package]] +name = "pylast" +version = "5.2.0" +description = "A Python interface to Last.fm and Libre.fm" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pylast-5.2.0-py3-none-any.whl", hash = "sha256:89c7c01ea9f08c83865999d8907835157a8096e77dd9dc23420246eb66cfcff5"}, + {file = "pylast-5.2.0.tar.gz", hash = "sha256:bb046804ef56a0c18072c750d61a282d47ac102a3b0b9c44a023eaf5b0934b0a"}, +] + +[package.dependencies] +httpx = "*" + +[package.extras] +tests = ["flaky", "pytest", "pytest-cov", "pytest-random-order", "pyyaml"] + [[package]] name = "pylint" version = "3.0.3" @@ -7327,4 +7389,4 @@ testing = ["coverage (>=5.0.3)", "zope.event", "zope.testing"] [metadata] lock-version = "2.0" python-versions = ">=3.11,<3.13" -content-hash = "eb20087fe00cc1a298f95eaa4d6ca08ba69ab0ff8babb39182d8fbc21592cb29" +content-hash = "c42bc63ed7bf613a8430fe48f0ed6a2ae218fc995618bea29584db33ce8cc46c" diff --git a/pyproject.toml b/pyproject.toml index a65fa6f..4a39b88 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -119,6 +119,7 @@ qrcode = {extras = ["pil"], version = "^7.4.2"} spotdl = "^4.2.4" fuzzywuzzy = "^0.18.0" python-levenshtein = "^0.23.0" +pylast = "^5.2.0" [build-system]