Sanitized private enterprise implementation
PythonDjangoGunicornLinuxNginxPostgreSQLLDAPSTLSGitHub Actionssystemd

Executive summary

A web application can work perfectly on a developer’s workstation and still be unfit for enterprise users. In operation, it becomes dependent on identity, persistence, networking, certificates, updates, logs, and a demonstrable recovery procedure.

This case study covers the preparation of a private Django application for a managed Linux environment. The work moved from an initial SQLite-based staging runtime toward a WSGI service, independent PostgreSQL persistence, corporate authentication, layered HTTPS proxies, and automated delivery subject to human authorization.

The most important outcome is not a go-live announcement: technical code deployment and basic identity flows were validated, but the operational pilot remained blocked by security, backup/restore, data, and operational acceptance gates in the reference report. That distinction is part of the engineering result.

The real application, code, and infrastructure are private. System names, addresses, internal rules, credentials, specific topology, and business data are intentionally excluded.

Starting point: development is not operations

The prototype already had domain rules and tests, but its original runtime could not answer several essential IT questions:

  • Will the service start and recover after a reboot?
  • Are corporate users authenticated over a secure channel and authorized per action?
  • Does the database use separate credentials for application queries and schema changes?
  • Can a release be identified, promoted, and rolled back without editing deployed files manually?
  • Can data be restored without affecting neighboring applications?

Rather than trying to answer those questions informally during first use, I treated them as deployment gates.

Constraints shaping the design

The application had to remain reachable only from authorized corporate access paths. IT would manage servers, certificates, database, and releases; code changes would go through repository review. The runtime should never inherit broad administrative privileges merely for convenience.

Persistence introduced another boundary. A central PostgreSQL instance can host multiple services, but their databases must not share one application trust boundary. Each service needs its own database, roles, and privileges. A full VM backup also does not automatically provide the ability to restore one database without rolling back the others.

Sanitized architecture

The technical baseline can be described without publishing private topology:

Django deployment trust boundaries
01 Corporate userAuthorized client entering the service.
02 Entry reverse proxyTerminates the external TLS connection and applies the access boundary.
03 Application-local proxyVerifies the backend certificate and routes only authorized traffic.
04 DjangoApplication code executes behind a local process boundary.
05A · Data PostgreSQL databaseDedicated database, application roles, and validated TLS.
05B · Identity Corporate directoryAuthentication via LDAPS; access governed by directory membership.

The entry proxy concentrates authorized access; the local proxy creates an additional boundary around the WSGI process. Gunicorn is not directly exposed to workstations. Network-separated hops use certificate-validated TLS; the local connection to WSGI stays within the application host.

A dedicated application VM simplifies dependencies, updates, and ownership boundaries. Persistence lives in separate database infrastructure with authenticated connectivity. This split is not high availability by itself.

PostgreSQL: runtime is not migrator

One of the most useful decisions was to separate the identity that executes business queries from the identity allowed to modify the schema.

Conceptual rolePurposeBoundary
Non-login ownerOwn database objectsNot used as the service credential
RuntimeRead and change permitted business dataNo general DDL privileges
MigratorApply approved versioned migrationsNot the permanent application identity

The application database was created and its initial schema applied through migrations. Negative checks demonstrated that the runtime account could not perform out-of-scope operations and that PostgreSQL connections required TLS.

That does not prove that the definitive business-data load was approved, or that every future schema change will be reversible. The operating rule remains to treat code, schema, and data as one compatibility set.

Every code review should consider incoming migrations, destructive operations, and the backup evidence required before applying them.

Identity: login eligibility is not authorization

Authentication and authorization were designed as separate layers.

The corporate directory is consulted through LDAPS, and membership in an approved group controls login eligibility. Application profiles and permissions determine which functions users may execute. Eligibility to enter does not automatically grant sensitive permissions.

The baseline validated a real login, denial of access without permissions, group-removal behavior, and an IT-controlled local break-glass administrator. But revocation coverage still requires distinct scenarios for existing sessions, disabled accounts, password changes, and directory unavailability.

The intended policy is therefore deny by default and evidence-based validation, not a claim that every possible authentication scenario has already been accepted. The local administrator is a controlled, auditable contingency, not an alternate login path for regular users.

Certificates, trust boundaries, and partial failures

The project adopted HTTPS at the entry point and on network-separated backend traffic, as well as certificate verification for PostgreSQL connections.

That requires more than seeing a padlock in a browser. Certificate names, trust chains, rotation, headers, proxy configuration, and actual network access rules must be verified. A listening socket or working page is not proof that the service is inaccessible from unauthorized locations.

Django provides python manage.py check --deploy to identify relevant security settings. It is useful evidence, but it does not replace network tests, permission review, or application-level checks. The official Django deployment checklist informed the process; it does not automatically certify the installation.

CI/CD: automate delivery, not authorization

The release process separates what passed testing from what IT has approved for installation.

Changes are reviewed through PRs. CI checks code, dependencies, and artifact conditions. Technical publication uses an explicit operator trigger, constrained execution identity, authenticated transport, and a protected destination-side executor.

A push or merge does not automatically deploy. Nor does it authorize migrations to be applied silently. The positive path for releasing code without pending schema migrations was validated in a real pipeline run, including executor acknowledgment and the workflow’s defined health check.

A controlled manual code rollback was also demonstrated. This is not equivalent to an adverse automatic-rollback drill, a database restore, or recovery after reboot. Schema-changing releases require gates distinct from code-only deployment.

What was proven, and what was not

The evidence is most useful when separated by scope:

ControlState at the technical checkpoint
WSGI service, proxies, reachable applicationImplemented and observed
PostgreSQL and separated privilegesConfigured and tested in defined scenarios
LDAPS, group-based admission, basic permission denialTested
Authorized delivery pipeline without pending migrationsSuccessfully exercised
Complete recovery of data and uploaded filesRestore evidence pending
Network isolation and revocation under all scenariosAdditional validation pending
Alerting and continuity across failures/rebootAdditional operational evidence pending
Initial data, confidentiality, and business acceptanceGates still open
Pilot with operational usersNO-GO in the reference report

These entries reflect a documented checkpoint, not a claim about the current deployed version. Code in open PRs must not be confused with production outcomes.

Why backups are a real blocker

On shared PostgreSQL infrastructure, restoring the entire database VM can undo legitimate writes made by unrelated services. Likewise, rolling back Django code cannot recover missing database changes or user-uploaded files.

Before a pilot, the plan needs application-level RPO/RTO, protected copies of persistent artifacts, and a tested isolated restore that preserves neighboring databases. The procedure must record code version, migration state, and the required consistency between files and tables.

An existing backup without a restore exercise is not the same control.

Engineering lessons

Three distinctions shaped the outcome:

  1. Reachable is not authorized. Successful HTTPS and login must coexist with negative network, identity, and permission checks.
  2. Repeatable deployment is not proven recovery. A functioning release executor does not validate backup restoration, migrations, or service recovery after faults.
  3. Green CI is not operational GO. Automated tests protect code. Giving real users access requires evidence about data, continuity, and controls in the deployed environment.

A Django service is operationally mature when its dependencies are explicit, its failure behavior is predictable, and its recovery path has been demonstrated. Being able to say “not approved yet” with objective criteria is part of that maturity.

Next steps and limitations

The remaining work is to close adverse security scenarios, demonstrate restoration, establish actionable alerts, verify post-reboot behavior, and run functional tests with controlled accounts and data. Only then can the pilot receive an evidence-based GO decision.

No percentages for productivity, availability, or recovery time are published because those measurements have not been prepared for public release.

Confidentiality statement

This case study describes infrastructure patterns and decisions from a private application. It does not publish the organization, restricted repository, business rules, addresses, hosts, accounts, internal permissions, secrets, data, real network diagrams, or proprietary source code.