reflex/reflex/constants/config.py
Khaleel Al-Adhami f39e8c9667
move all environment variables to the same place (#4192)
* move all environment variables to the same place

* reorder things around

* move more variables to environment

* remove cyclical imports

* forgot default value for field

* for some reason type hints aren't being interpreted

* put the field type *before* not after

* make it get

* move a bit more

* add more fields

* move reflex dir

* add return

* put things somewhere else

* add custom error
2024-10-21 13:28:55 -07:00

61 lines
1.4 KiB
Python

"""Config constants."""
from pathlib import Path
from types import SimpleNamespace
from reflex.constants.base import Dirs, Reflex
from .compiler import Ext
# Alembic migrations
ALEMBIC_CONFIG = "alembic.ini"
class Config(SimpleNamespace):
"""Config constants."""
# The name of the reflex config module.
MODULE = "rxconfig"
# The python config file.
FILE = Path(f"{MODULE}{Ext.PY}")
class Expiration(SimpleNamespace):
"""Expiration constants."""
# Token expiration time in seconds
TOKEN = 60 * 60
# Maximum time in milliseconds that a state can be locked for exclusive access.
LOCK = 10000
# The PING timeout
PING = 120
class GitIgnore(SimpleNamespace):
"""Gitignore constants."""
# The gitignore file.
FILE = Path(".gitignore")
# Files to gitignore.
DEFAULTS = {Dirs.WEB, "*.db", "__pycache__/", "*.py[cod]", "assets/external/"}
class RequirementsTxt(SimpleNamespace):
"""Requirements.txt constants."""
# The requirements.txt file.
FILE = "requirements.txt"
# The partial text used to form requirement that pins a reflex version
DEFAULTS_STUB = f"{Reflex.MODULE_NAME}=="
class DefaultPorts(SimpleNamespace):
"""Default port constants."""
FRONTEND_PORT = 3000
BACKEND_PORT = 8000
# The deployment URL.
PRODUCTION_BACKEND_URL = "https://{username}-{app_name}.api.pynecone.app"