The Pokédex Web App’s configuration is defined directly in source code rather than through environment variables or a separate settings file. This page documents every configurable value, the file it lives in, its default, and how to change it safely — especially before deploying to a production environment.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Navi-27/Proyecto-UPC/llms.txt
Use this file to discover all available pages before exploring further.
Configuration Values
application.secret_key
Signs and verifies Flask session cookies. Any change to this value invalidates all existing sessions.
| Property | Detail |
|---|---|
| File | application.py |
| Default | "pokesecretkey123" |
| Purpose | Cryptographically signs Flask session cookies using HMAC-SHA1. If an attacker knows the key they can forge sessions and impersonate any user. |
DB_PATH
Filesystem path to the SQLite database file. Resolved relative to
models/database.py.| Property | Detail |
|---|---|
| File | models/database.py |
| Default | os.path.join(os.path.dirname(__file__), '..', 'pokedex.db') |
| Resolved path | Proyecto-UPC/pokedex.db |
| Purpose | Tells sqlite3.connect() where to create or open the database file. |
DB_PATH variable at the top of models/database.py:
The directory containing the database file must already exist and be writable by the process running the app. SQLite will not create intermediate directories.
PokeAPI.BASE_URL
Root URL for all PokéAPI HTTP requests. Changing this allows you to point the app at a self-hosted mirror of PokéAPI.
| Property | Detail |
|---|---|
| File | services/poke_api.py |
| Default | "https://pokeapi.co/api/v2" |
| Purpose | Base URL prepended to every endpoint path when fetching Pokémon data. |
services/poke_api.py:
PokéAPI is a free, public API with no authentication requirement. The local
cache_pokemon table means the live API is only called once (on first startup or after the cache is cleared), so rate-limiting is not a practical concern for normal use.Equipo.MAX_POKEMONES
Maximum number of Pokémon a single user may have in their team at one time. Enforced in application logic, not at the database level.
| Property | Detail |
|---|---|
| File | models/equipo.py |
| Default | 6 |
| Purpose | Guards the /equipo/agregar/ route. Equipo.agregar_pokemon() returns (False, message) if the team is already full. |
models/equipo.py:
The value
6 mirrors the team-size limit in the mainline Pokémon video games. Increasing it is technically supported but will diverge from standard Pokémon rules and may affect how team display templates render.Debug Mode
Enables Flask’s interactive debugger and auto-reloader. Only active when
application.py is run directly (not via Gunicorn).| Property | Detail |
|---|---|
| File | application.py (bottom of file) |
| Default | debug=True |
| Scope | Only executed when the file is run as __main__ — i.e., python application.py. Gunicorn ignores this block entirely. |
debug=True. If you run the app directly in a shared environment, set it to False:
Gunicorn (Production Server)
| Property | Detail |
|---|---|
| File | Procfile |
| Command | web: gunicorn application:application |
| Module | application (the file application.py) |
| WSGI callable | application (the Flask(__name__) instance) |
Procfile is used by platforms such as Heroku and other PaaS providers. Running locally with Gunicorn:
Set the number of workers
Gunicorn defaults to 1 worker. A common rule of thumb is
(2 × CPU cores) + 1:SQLite is not designed for high-concurrency write workloads. For a deployment with many simultaneous users, consider migrating to PostgreSQL or MySQL and updating
models/database.py accordingly.Configuration at a Glance
Secret Key
File:
Default:
Load from
application.pyDefault:
"pokesecretkey123"Load from
SECRET_KEY environment variable in production.Database Path
File:
Default:
Set
models/database.pyDefault:
../pokedex.db (relative to models/)Set
DB_PATH to an absolute path for predictable behavior.PokéAPI Base URL
File:
Default:
Point to a mirror by changing
services/poke_api.pyDefault:
https://pokeapi.co/api/v2Point to a mirror by changing
PokeAPI.BASE_URL.Team Size Limit
File:
Default:
Change
models/equipo.pyDefault:
6Change
Equipo.MAX_POKEMONES to any positive integer.There is no
.env file or 12-factor configuration system in this project. All configuration is defined in-code. For a production deployment, refactor sensitive values (secret key, database path) to be loaded from environment variables so they are never committed to version control.