{"id":20977320,"url":"https://github.com/unfoldadmin/formula","last_synced_at":"2025-04-07T08:16:59.532Z","repository":{"id":193657852,"uuid":"689070737","full_name":"unfoldadmin/formula","owner":"unfoldadmin","description":"Unfold Django admin theme demo repository for demonstration purposes implemening various admin possibilities","archived":false,"fork":false,"pushed_at":"2025-03-19T14:29:12.000Z","size":1280,"stargazers_count":70,"open_issues_count":7,"forks_count":24,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-31T07:04:51.164Z","etag":null,"topics":["admin","dashboard","django","django-unfold","tailwindcss","theme","ui"],"latest_commit_sha":null,"homepage":"https://unfoldadmin.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/unfoldadmin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-08T18:18:44.000Z","updated_at":"2025-03-27T11:01:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"e8fb92ce-e584-42a3-aa88-16cd15a79d5b","html_url":"https://github.com/unfoldadmin/formula","commit_stats":null,"previous_names":["unfoldadmin/formula"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unfoldadmin%2Fformula","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unfoldadmin%2Fformula/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unfoldadmin%2Fformula/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unfoldadmin%2Fformula/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unfoldadmin","download_url":"https://codeload.github.com/unfoldadmin/formula/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247615382,"owners_count":20967184,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["admin","dashboard","django","django-unfold","tailwindcss","theme","ui"],"created_at":"2024-11-19T04:58:20.532Z","updated_at":"2025-04-07T08:16:59.516Z","avatar_url":"https://github.com/unfoldadmin.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Formula - Django Unfold Admin Demo \u003c!-- omit from toc --\u003e\n\nThe Formula repository contains a sample project build upon the Unfold theme for Django. It includes the best practices when it comes to Unfold but keep in mind that it does not incorporate any more in-depth business logic. Everything is composed just for demonstration purposes.\n\n- [Unfold](https://github.com/unfoldadmin/django-unfold) - Admin theme for Django\n- [Turbo](https://github.com/unfoldadmin/turbo) - Django \u0026 Next.js starter kit including Unfold\n\n## Table of contents \u003c!-- omit from toc --\u003e\n\n- [Installation](#installation)\n- [Loading sample data](#loading-sample-data)\n- [Custom Dashboard](#custom-dashboard)\n- [Compiling Styles](#compiling-styles)\n\n## Installation\n\nFirst of all, it is required to create new `.env` file containing environment variables for the project. In this case, there are just two most important variables needed to be configured. If you are on local machine, set `DEBUG=1` to enable debug mode for further development. Second variable is `SECRET_KEY` which needs to be configured with some random long and secure string. Project is quite simple and it should be possible to run it without Docker at all. Make sure Python 3.13 is installed together with Poetry and follow the commands below to install all required dependencies and run migrations.\n\n```bash\ngit clone git@github.com:unfoldadmin/formula.git\n```\n\nRun these commands inside `formula` directory, to install all dependencies and to run all migrations.\n\n```bash\ndocker compose up\n```\n\nCreate the admin user or you can't access to the instance.\n\n```bash\ndocker compose exec web python manage.py createsuperuser\n```\n\nRun the command below to start the local development server.\n\n## Loading sample data\n\nAfter successful installation, database will be empty and there will be no data to observe through the admin area. Unfold provides some sample data available under `formula/fixtures`. These data can be loaded via commands below. It is important to run this command against empty database so primary keys will match.\n\n```bash\ndocker compose exec web python manage.py loaddata formula/fixtures/*\n```\n\n## Custom Dashboard\n\nThe Formula demonstration project includes a custom dashboard. All components available in the dashboard are custom-made just for showcase and are not a part of Unfold. It means that any real data are used there and in case that real data are involved it is necessary to pass additional data into the template from the database.\n\nAll custom widgets used in Formula are located inside `formula/templates/admin/components/`. The main layout for the dashboard is created by overriding `index.html` and the content can be found here `formula/templates/admin/index.html`. For more information check official Unfold documentation.\n\n## Compiling Styles\n\nWhen creating a custom admin dashboard, you are going to locate all your HTML code with Tailwind classes in your project, so newly added dashboard styles are not compiled. To do so, the first thing which is needed is to edit `UNFOLD` variable in `settings.py` and add `STYLES` key pointing at the new CSS stylesheet containing all new styles.\n\n```python\n# settings.py\nfrom django.templatetags.static import static\n\n\nUNFOLD = {\n    \"STYLES\": [\n        lambda request: static(\"css/styles.css\"),\n    ],\n}\n```\n\nTo compile new styles, run one of the commands below depending on your needs. To see what exactly the commands are doing and how the files are linked check `scripts` section inside `package.json`.\n\n```bash\nnpm run tailwind:build  # one-time build\nnpm run tailwind:watch  # watch all files for changes\n```\n\nBefore compiling the styles it is important to install all node dependencies as well which in our case contain just TailwindCSS and its typography plugin for styling formatted blocks of texts inside the WYSIWYG editor.\n\n```bash\nnpm install\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funfoldadmin%2Fformula","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funfoldadmin%2Fformula","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funfoldadmin%2Fformula/lists"}