kinolist | ||
.gitignore | ||
docker-compose.yml | ||
docker-entrypoint.sh | ||
Dockerfile | ||
env.example | ||
LICENSE.md | ||
README.md | ||
requirements.txt |
Things you'll have to do once to initialize the project
Do the following in order:
Create an .env file
cp env.example .env
Then edit the .env file to enter a flask secret key, your omdb key and an administrator password for the site.
Initialize the environment
There is a configure.sh file:
sh configure.sh
You can also initialize the environment yourself:
Create a virtual environment
Create an env
folder:
python -m venv env
To enter the (env)
environment:
source env/bin/activate
The keyword (env)
should appear in the beginning of the prompt. If you want to quit the virtual environment, do deactivate
.
If you are not in the virtual environment (the (env)
keyword does not appear in the prompt), do source env/bin/activate
again to go back to the environment.
Install the required python packages
python -m pip install -r requirements.txt
Initialize the database
Warning! This will erase the database. Pro-tip: this will erase the database.
python -m flask --app kinolist init-db
Things to do whenever you want to launch the project locally
Enter the local environment
source env/bin/activate
The keyword (env)
should appear in the beginning of the prompt. If you want to quit the virtual environment, do deactivate
.
If you are not in the virtual environment (the (env)
keyword does not appear in the prompt), do source env/bin/activate
again to go back to the environment.
Launch the Flask server
python -m flask --app kinolist run --port 8000 --debug
You can access the site at the adress localhost:8000
on your web browser. Do Ctrl+C
to stop the server.