From afb723981243cecd8b6e72249d8d9ab33616a360 Mon Sep 17 00:00:00 2001 From: AntoinePELAMOURGUES Date: Fri, 22 Nov 2024 00:06:50 +0400 Subject: [PATCH] :white_check_mark: Update files --- .env.example | 6 +++++- notebooks/test_Antoine.ipynb | 19 ++++++++++++++----- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/.env.example b/.env.example index a7216e8..1846fbb 100644 --- a/.env.example +++ b/.env.example @@ -1,6 +1,6 @@ # get a token from https://www.themoviedb.org/settings/api -TMDB_API_TOKEN= +TMDB_API_TOKEN= "Recuperer sur le site de TMDB" # POSTGRES RECO_MOVIES DB POSTGRES_USER=user @@ -10,3 +10,7 @@ PGADMIN_DEFAULT_EMAIL=user@example.com PGADMIN_DEFAULT_PASSWORD=datascientest POSTGRES_HOST=reco_movies_db POSTGRES_PORT=5432 + +# FASTAPI +SECRET_KEY = 'créer une clé au hasard avec chiffres et lettres' +ALGORITHM = 'HS256' \ No newline at end of file diff --git a/notebooks/test_Antoine.ipynb b/notebooks/test_Antoine.ipynb index 9fbbea5..9a44f85 100644 --- a/notebooks/test_Antoine.ipynb +++ b/notebooks/test_Antoine.ipynb @@ -391,9 +391,17 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 3, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "131262\n" + ] + } + ], "source": [ "import psycopg2\n", "\n", @@ -405,9 +413,10 @@ "\n", "cur = conn.cursor()\n", "\n", - "for user, mail, password in zip(username, email, hached_password):\n", - " cur.execute(\"INSERT INTO users (username, email, hached_password) VALUES (%s, %s, %s)\", (user, mail, password))\n", - " conn.commit()\n", + "\n", + "cur.execute(\"SELECT movieId FROM movies ORDER BY movieId DESC LIMIT 1\")\n", + "last_movie_id = cur.fetchone()[0]\n", + "print(last_movie_id)\n", "\n", "cur.close()\n", "conn.close()\n"