Skip to content

Commit

Permalink
✅ Update files
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoinePELAMOURGUES committed Nov 21, 2024
1 parent 82e27eb commit afb7239
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
6 changes: 5 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -10,3 +10,7 @@ [email protected]
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'
19 changes: 14 additions & 5 deletions notebooks/test_Antoine.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
Expand Down

0 comments on commit afb7239

Please sign in to comment.