{"id":22711352,"url":"https://github.com/lordsarcastic/djangoer","last_synced_at":"2025-04-13T15:12:35.854Z","repository":{"id":86716847,"uuid":"595358840","full_name":"lordsarcastic/djangoer","owner":"lordsarcastic","description":"A production-ready template for Django applications","archived":false,"fork":false,"pushed_at":"2024-01-24T15:29:08.000Z","size":104,"stargazers_count":22,"open_issues_count":4,"forks_count":10,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-13T15:12:31.631Z","etag":null,"topics":["backend","django","django-project","django-rest-framework","template-repository"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lordsarcastic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-01-30T23:06:30.000Z","updated_at":"2024-11-12T01:07:51.000Z","dependencies_parsed_at":"2023-08-10T04:26:42.028Z","dependency_job_id":null,"html_url":"https://github.com/lordsarcastic/djangoer","commit_stats":null,"previous_names":["lordsarcastic/djangoer"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lordsarcastic%2Fdjangoer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lordsarcastic%2Fdjangoer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lordsarcastic%2Fdjangoer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lordsarcastic%2Fdjangoer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lordsarcastic","download_url":"https://codeload.github.com/lordsarcastic/djangoer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248732487,"owners_count":21152852,"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":["backend","django","django-project","django-rest-framework","template-repository"],"created_at":"2024-12-10T12:16:03.176Z","updated_at":"2025-04-13T15:12:35.832Z","avatar_url":"https://github.com/lordsarcastic.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# djangoer\nA production-ready template for Django applications\n\n## Introduction\nThis Django template was created out of a need for consistent structure for projects with a setup that's easy to understand and use with as minimal additional setup as possible.\n\n### How to use\nThree commands and you're good to go:\n- `cp .env.example .env`\n- `make build`\n- `make up`\n\nA much detailed explanation is in the [How to use (fleshed-out)](#how-to-use-fleshed-out) section.\n\n## Features\n- Uses standard Django application structure. No folder complexities to be navigated through.\n- Drop-in template, two commands and you have all the features at your fingertips: `make build \u0026\u0026 make up`\n- Built-in simple Docker set up that just works!\n- Support for .env files and typed environmental variables using Pydantic. Try running your application without needed environment variables and it crashes immediately, fail-fast without future tears.\n- First class support for Postgres. Just add `DATABASE_URL` in your `.env` file.\n- Uses lightning fast Ruff for both formatting and linting. Drop-in replacement for Black and Isort and 10 - 100x faster too!\n- Easy way to run commands using `make`. Run migrations with `make migrate`, start application with `make up`. No need to memorize verses of commands.\n- Included GitHub workflow for running tests\n- Environment based settings file\n- Everything you need to start implementing your first API.\n\n### What is hoped to be achieved\n- Simplicity; no need for bloated classes and huge utils that you'll likely never use. Everything here should be very much needed in most projects\n- Low barrier for entry; a template that is easy to start with and does not seem too advanced for beginners to use\n- Production-ready; the above does not remove the important fact that this should be always production-ready without obvious faults\n- Consistency; a smell for codebases is you not having a 'knowing' of where certain code is located. A wanted structure is one that's easy to navigate\n\n### What is not hoped to be achieved\n- Utility dump; this template will not be where all sorts of utilities are dumped because, 'why not?'.\n- I'm out of points, sorry. This kind of stuff should be like 3 points or so, but then...\n\n## How to use (Fleshed out)\n### Requirements:\n- Make, Docker and Docker Compose\n\n### Running the application with Docker (recommended)\n- Clone the repo\n- `cd` into the repo\n- Duplicate the file named \".env.example\", rename the new copy to \".env\".\n- Edit the content of the `.env` file as you want. At this point you'll also want to edit the\n`environment` section of the `postgres` service in the `docker-compose.yml` file to\nreflect your choice of database. Ensure you correlate this change with the content\nof the `.env` file.\n- Perform migrations with `make migrate`\n- Create your superuser account with `make createsuperuser`. Fill in required details. Note that your password won't display on the screen. Type blindly and trust everything to work.\n- To start the server, run `make up`\n- You can start making requests by visiting [http://127.0.0.1:8000](http://127.0.0.1:8000)\n- Edit the template as you want for your app\n\n### Running the application outside of Docker (not recommended, not even remotely)\n- Create a database with Postgres through the `psql` command. Can't remember\nthe whole steps and I'm too tired to google it, it's why I said you should\nuse Docker.\n- Duplicate the file named \".env.example\", rename the new copy to \".env\".\n- Edit the content of the `.env` file as you want, especially to\nreflect your choice of database. Ensure you correlate this change with the results of\nof the first step\n- Perform migrations with `python manage.py migrate`. You still don't want to use Docker?!\n- To start the server, run `gunicorn --bind 0.0.0.0:8000 config.wsgi:application`.\nLol, I told you to use Docker.\n- You can start making requests by visiting [http://127.0.0.1:8000](http://127.0.0.1:8000)\n- Edit the template as you want for your app (switch to Docker)\n\n## Glossary\nThis section contains a list of commonly needed helps while working on this project.\n\nMajority of the commands you'll need are in the Makefile and can be run as:\n```\nmake \u003ccommand\u003e\n```\n\n### All needed commands currently in the Makefile\n- up: start up the containers\n- bash: starts a bash shell for the application\n- build: builds the containers only\n- build-up: builds and starts the containers\n- createsuperuser: spawns the Django app to create a superuser\n- down: stops the containers\n- format: runs isort and black on the codebase to make it fine\n- flush-db: empties the database and begins the DB from scratch\n- install: installs all dependencies in a virtual env locally\n- lint: runs ruff to sort import and format the code\n- migrations: creates migrations based on DB schema\n- migrate: runs the created migrations\n- resetdb: resets the database, deletes everything including the database itself\n- run-command: runs a command in the Django app context. For example, `make run-command command=\"python manage.py test\"`\n- shell: spawns a shell within the Django app context. The same as `manage.py shell`.\n- test: runs the test suite using pytest\n- testcase: runs a single test case. For example, `make testcase testcase=\"tests/test_models.py::TestUserModel::test_user_can_be_created\"`\n- up-d: starts up the container without logs\n\n### How do I run commands in Docker?\nFirst check the list above if the command you need is there. If it is, you can run it as `make \u003ccommand\u003e`. For example, to run tests, I can do: `make test`. If it isn't, continue reading.\n\nIdeally, you should be using `make run-command command=\"\u003ccommand\u003e\"`. For example, to run tests, I can do: `make run-command command=\"python manage.py test\"`.\n\nHowever, if you're not using make, you can run commands in Docker using the syntax: `docker compose run \u003cname-of-container-volume\u003e \u003ccommand\u003e`. For example, to run tests, I can do: `docker compose run web python manage.py test`.\n\n### How do I enable auto-imports for libraries on VSCode\n- Outside of docker, run `make install`\n- Start a virtual environment in the root folder by running `pipenv shell`\n- On your VSCode, at the bottom right corner, you'll see a Python version, click on it and select the Python interpreter created from your virtual environment.\nYou can continue your work inside docker.\n\n## Change Log\n### 31-01-2023\n- Initial release\n- Added support for Postgres\n- Added support for .env files\n- Added support for typed environmental variables using Pydantic\n- Added Docker support\n\n### 20-02-2023\n- Added Make command for formatting and linting\n\n### 13-01-2024\n- Added auto removal of containers when running one-off commands\n\n### 24-01-2024\n- Trim down Dockerfile to reduce needless steps and upgrade python version\n- Added extensions for resetting db\n- Added command to run any command on app shell\n- Replaced test runner with pytest\n- Renamed `makemigrations` command to `migrations`\n- Removed black and ruff\n- Upgraded pydantic\n- Replaced linter and formatter with ruff\n- Bumped Python version to 3.12\n- Added environment based settings file\n- Added changelog\n\n\n\n## Got problems?\nRaise an issue.\n\n## FAQs\n1.\n    Q: Why do you insist I use Docker?\n\n    A: It is actually easier to use and setup\n    than the alternative. You can also easily\n    switch to the alternative if you want to.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flordsarcastic%2Fdjangoer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flordsarcastic%2Fdjangoer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flordsarcastic%2Fdjangoer/lists"}