MCPcopy
hub / github.com/reflex-dev/reflex / export

Function export

reflex/reflex.py:560–600  ·  view source on GitHub ↗

Export the app to a zip file.

(
    zip: bool,
    frontend_only: bool,
    backend_only: bool,
    zip_dest_dir: str,
    upload_db_file: bool,
    env: LITERAL_ENV,
    backend_excluded_dirs: tuple[Path, ...] = (),
    ssr: bool = True,
)

Source from the content-addressed store, hash-verified

558 help="Whether to enable server side rendering for the frontend.",
559)
560def export(
561 zip: bool,
562 frontend_only: bool,
563 backend_only: bool,
564 zip_dest_dir: str,
565 upload_db_file: bool,
566 env: LITERAL_ENV,
567 backend_excluded_dirs: tuple[Path, ...] = (),
568 ssr: bool = True,
569):
570 """Export the app to a zip file."""
571 from reflex.utils import export as export_utils
572 from reflex.utils import prerequisites
573
574 if not environment.REFLEX_SSR.is_set():
575 environment.REFLEX_SSR.set(ssr)
576 elif environment.REFLEX_SSR.get() != ssr:
577 ssr = environment.REFLEX_SSR.get()
578
579 environment.REFLEX_COMPILE_CONTEXT.set(constants.CompileContext.EXPORT)
580
581 running_mode = prerequisites.check_running_mode(frontend_only, backend_only)
582
583 config = get_config()
584
585 prerequisites.assert_in_reflex_dir()
586
587 if running_mode.has_frontend() and prerequisites.needs_reinit():
588 _init(name=config.app_name)
589
590 export_utils.export(
591 zipping=zip,
592 frontend=running_mode.has_frontend(),
593 backend=running_mode.has_backend(),
594 zip_dest_dir=zip_dest_dir,
595 upload_db_file=upload_db_file,
596 env=constants.Env.DEV if env == constants.Env.DEV else constants.Env.PROD,
597 loglevel=config.loglevel.subprocess_level(),
598 backend_excluded_dirs=backend_excluded_dirs,
599 prerender_routes=ssr,
600 )
601
602
603@cli.command()

Callers

nothing calls this directly

Calls 8

get_configFunction · 0.90
_initFunction · 0.85
is_setMethod · 0.80
has_frontendMethod · 0.80
has_backendMethod · 0.80
subprocess_levelMethod · 0.80
setMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected