company-portfolio-package
A company/group site package for the Core boilerplate: a
single Company profile (name, tagline, description, logo, contact info)
plus its Members — each member is a Core User with their own public page
(job title, department, tenure) whose bio/headline/skills/education/
certifications/social links come from the portfolio package, not a second
copy of the same content here. It depends on core-package for
auth, RBAC, and the shared User model, and on portfolio-package for that
profile content — it never defines its own user/account model or
duplicates portfolio's fields.
This package models one company/group (a singleton Company row,
created automatically on first read — see services.get_company()), not a
multi-tenant directory of many companies. If you need the latter, this
package's Member model (drop its implicit "the one company" assumption and
add a company FK) is the natural starting point, not a rewrite.
Company.tagline/description and Member.title are translatable via
apps.core.models.TranslatableModel — a single translations JSON field
per row, not a tagline_en/tagline_fa column per language. Add a language
by calling PUT /translations/{language} or
PUT /members/{id}/translations/{language}, no migration required.
Downloadable CVs
Both the company/group and each member expose GET .../cv:
- If an admin (or, for a member, whoever has upload rights) has uploaded a
CV file (
Company.cv_file/Member.cv_file), it's served as-is. - Otherwise a CV is generated on the fly as a PDF (
company/pdf.py, viareportlab) from the structured data already on hand: for a member, theirMemberfields plus theirportfolioProfile/Skill/Education/Certification/SocialLinkrows; for the company, theCompanyrow plus a directory of its active members. This always succeeds — there's no "no CV available" state — and stays in sync with profile edits without anyone re-uploading a file.
reportlab was chosen specifically because it's pure Python (no system
libraries like Pango/Cairo that e.g. WeasyPrint needs), so this package
installs the same way on every machine.
See Core's AGENT.md §10 ("Package architecture") for the full contract this
package follows.
Install
pip install company-portfolio-package
Requires Python 3.10+ and Django 5.2 (via core-package). This also installs
portfolio-package and blog-package.
Local development
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
pytest
Installing into a Core-based project
- Install it into the host project's venv:
pip install company-portfolio-package
This also pulls incore-package,portfolio-packageand, transitively,blog-packageautomatically. You still need to do steps 2-4 forcompanyitself (and, if not already done, forportfolio/blogtoo) — Core's "no auto-discovery, explicit wiring" convention (§10) means the pip install is automatic, butINSTALLED_APPS/ router-mounting/migrateare not. - Add it to
INSTALLED_APPSin the host'sconfig/settings/base.py, under the# site packagescomment (afterportfolio, since this package importsportfolio.modelsdirectly):# site packages "blog", "portfolio", "company",
- Mount its router in the host's
config/api.py:from company.api import router as company_router ... api.add_router("/company", company_router)
- Migrate:
python manage.py migrate
- Optional — add a nav entry under
UNFOLD["SIDEBAR"]["navigation"]in the host'sconfig/settings/base.pyforCompany/Member.
Endpoints
Mounted at whatever prefix the host chooses (/company in the example
above). Reads are public; all writes are admin-only
(require_role("admin"), from Core).
GET /— the company/group profile (public), optional?lang=GET /content— the whole landing-page document (public): brand, hero, about, services, projects, steps, stats, team, contact, socials, clients, testimonial, FAQ, values, timeline, posts, categories. Every text is{fa, en}(languages fromCOMPANY_CONTENT_LANGUAGES, defaultfa+en); services/projects come fromportfolio, posts fromblog, team fromMember. Point the Puzzllium site'sNEXT_PUBLIC_API_URLat.../company.GET /contentis public unlessCOMPANY_CONTENT_API_KEYis set in the host's settings; then it needs anX-API-Key: <key>header (401 otherwise).GET /cv— download the company/group CV (public): the uploaded file if one exists, else an auto-generated PDFGET /members— paginated list of active members (public), optional?lang=GET /members/{member_id}— a member's public page (public), optional?lang=— mergesMemberwith theirportfolioProfileGET /members/{member_id}/cv— download that member's CV (public): the uploaded file if one exists, else an auto-generated PDFPATCH /,PUT /translations/{language}— update the company profile / its translationsPOST /logo,POST /cv— upload the company logo / CV file (multipart)POST /members,PATCH /members/{member_id},DELETE /members/{member_id}— manage membership (links an existinguser_id; does not create or delete theUseritself)PUT /members/{member_id}/translations/{language}— set a member's translatedtitlePOST /members/{member_id}/cv— upload a member's CV file (multipart)
Seeding the landing-page content
python manage.py import_site_content puzzllium-content.json --owner-email you@example.com
Loads a site-content JSON into Company, the content blocks (steps, stats,
values, timeline, FAQ, categories, socials, testimonial) and the owner's
portfolio services/projects and blog posts (English in the base columns,
other languages in translations). Team members are real accounts and are
not created — add them as Members (with a name) and fill their portfolio
Profile/skills. Images are uploaded in the admin. Requires blog in
INSTALLED_APPS next to portfolio and company.
Admin panel backend (company.panel, optional)
A second Django app shipped in this package (app label panel) that backs
the frontend admin panel. It adds to the company router:
- Panel login —
POST /auth/loginissues a panel token (a JWT signed with Core's key,aud="panel");PUT /auth/credentialschanges your own email/password. Roles come from the user row on every request: superuser =owner, staff =editor. - Panel users (owner only) —
GET/POST/DELETE /users. Removing a user only revokes staff access; the last owner can't be demoted or removed. - Contact-form messages — public
POST /messages(throttled), andGET /messages,PATCH/DELETE /messages/{id}for the panel. - Site content, write side —
PUT /content(saves the document fromGET /contentback to the models),GET/POST /content/history(list / restore snapshots; restore is owner-only) andPOST /upload(images, 8 MB max).
Errors use {"error": "<code>"}, the codes the panel maps to text.
# settings.py
INSTALLED_APPS = [..., "blog", "portfolio", "company", "company.panel"]
MIDDLEWARE = [
"django.middleware.security.SecurityMiddleware",
"corsheaders.middleware.CorsMiddleware",
"company.panel.middleware.PanelAuthMiddleware",
...,
]
COMPANY_CONTENT_API_KEY = os.environ["COMPANY_CONTENT_API_KEY"] # required here: empty = content API is public
CONTENT_HISTORY_DIR = BASE_DIR / "content_history" # optional (default); keep it out of MEDIA_ROOT
CONTENT_HISTORY_LIMIT = 50 # optional
# api
from company.panel import api as panel_api
panel_api.register(company_router) # before api.add_router("/company", company_router)
PanelAuthMiddleware turns Authorization: Bearer <token> — the
COMPANY_CONTENT_API_KEY itself (owner, no user) or a panel login token —
into request.panel_role / request.panel_user, and sets X-API-Key so
ContentApiKeyAuth admits the request.
Metadata
Release files for company-portfolio-package 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| company_portfolio_package-0.2.1.tar.gz | 37.2 kB | With provenance | Details for company_portfolio_package-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| company_portfolio_package-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for company_portfolio_package-0.2.1-py3-none-any.whl |
Total release size: 78.6 kB
Release files / company_portfolio_package-0.2.1.tar.gz
| Download URL | company_portfolio_package-0.2.1.tar.gz |
|---|---|
| Size | 37.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d4a232d2f5e24956213ceec42b5aebad635a846d2ca5acbaa38805b458cf5527
|
|
BLAKE2b-256 checksum How to use checksums |
3e71c01ae0a0363d93310273cf67fa54c61c7daa236064fc8cb9e2fda38e7116
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.
Transparency logRelease files / company_portfolio_package-0.2.1-py3-none-any.whl
| Download URL | company_portfolio_package-0.2.1-py3-none-any.whl |
|---|---|
| Size | 41.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2537d5a131a6c001beb7f41d587ad09cbdc102fd87fbf480333439ce884be410
|
|
BLAKE2b-256 checksum How to use checksums |
8ebefb9f283124f392a85e8c29bf1cc048623b88f3cdb10ad07a157051f3ac96
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.
Transparency logSecurity for company-portfolio-package 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for company_portfolio_package-0.2.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.