|
@@ -137,9 +137,11 @@ def run(
|
|
|
if backend and processes.is_process_on_port(backend_port):
|
|
|
backend_port = processes.change_or_terminate_port(backend_port, "backend")
|
|
|
|
|
|
- # Get the app module.
|
|
|
console.rule("[bold]Starting Reflex App")
|
|
|
- app = prerequisites.get_app()
|
|
|
+
|
|
|
+ if frontend:
|
|
|
+ # Get the app module.
|
|
|
+ prerequisites.get_app()
|
|
|
|
|
|
# Warn if schema is not up to date.
|
|
|
prerequisites.check_schema_up_to_date()
|
|
@@ -172,10 +174,10 @@ def run(
|
|
|
setup_frontend(Path.cwd())
|
|
|
commands.append((frontend_cmd, Path.cwd(), frontend_port))
|
|
|
if backend and env == constants.Env.PROD:
|
|
|
- commands.append((backend_cmd, app.__name__, backend_host, backend_port))
|
|
|
+ commands.append((backend_cmd, backend_host, backend_port))
|
|
|
with processes.run_concurrently_context(*commands):
|
|
|
if env == constants.Env.DEV:
|
|
|
- backend_cmd(app.__name__, backend_host, int(backend_port))
|
|
|
+ backend_cmd(backend_host, int(backend_port))
|
|
|
|
|
|
|
|
|
@cli.command()
|
|
@@ -268,6 +270,11 @@ def export(
|
|
|
db_cli = typer.Typer()
|
|
|
|
|
|
|
|
|
+def _skip_compile():
|
|
|
+ """Skip the compile step."""
|
|
|
+ os.environ[constants.SKIP_COMPILE_ENV_VAR] = "yes"
|
|
|
+
|
|
|
+
|
|
|
@db_cli.command(name="init")
|
|
|
def db_init():
|
|
|
"""Create database schema and migration configuration."""
|
|
@@ -287,6 +294,7 @@ def db_init():
|
|
|
return
|
|
|
|
|
|
# Initialize the database.
|
|
|
+ _skip_compile()
|
|
|
prerequisites.get_app()
|
|
|
model.Model.alembic_init()
|
|
|
model.Model.migrate(autogenerate=True)
|
|
@@ -295,6 +303,7 @@ def db_init():
|
|
|
@db_cli.command()
|
|
|
def migrate():
|
|
|
"""Create or update database schema from migration scripts."""
|
|
|
+ _skip_compile()
|
|
|
prerequisites.get_app()
|
|
|
if not prerequisites.check_db_initialized():
|
|
|
return
|
|
@@ -309,6 +318,7 @@ def makemigrations(
|
|
|
),
|
|
|
):
|
|
|
"""Create autogenerated alembic migration scripts."""
|
|
|
+ _skip_compile()
|
|
|
prerequisites.get_app()
|
|
|
if not prerequisites.check_db_initialized():
|
|
|
return
|