{"id":15647723,"url":"https://github.com/nekmo/django-code-generator","last_synced_at":"2025-09-14T05:32:48.697Z","repository":{"id":57419454,"uuid":"188117052","full_name":"Nekmo/django-code-generator","owner":"Nekmo","description":"Generate code from your Django models for faster development","archived":false,"fork":false,"pushed_at":"2024-03-17T06:51:34.000Z","size":71,"stargazers_count":47,"open_issues_count":6,"forks_count":10,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-23T07:34:33.826Z","etag":null,"topics":["code-generation","code-generator","django","django-admin","django-rest-framework"],"latest_commit_sha":null,"homepage":null,"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/Nekmo.png","metadata":{"files":{"readme":"README.rst","changelog":"HISTORY.rst","contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.rst","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-22T21:36:11.000Z","updated_at":"2025-02-07T03:47:35.000Z","dependencies_parsed_at":"2024-10-03T12:21:12.405Z","dependency_job_id":"619cc232-49db-4c7c-b0ec-da276e55c605","html_url":"https://github.com/Nekmo/django-code-generator","commit_stats":{"total_commits":41,"total_committers":1,"mean_commits":41.0,"dds":0.0,"last_synced_commit":"3fd2d5e96d6dfdea2dc7b1a3268ee460a636a623"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nekmo%2Fdjango-code-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nekmo%2Fdjango-code-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nekmo%2Fdjango-code-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nekmo%2Fdjango-code-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nekmo","download_url":"https://codeload.github.com/Nekmo/django-code-generator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248883024,"owners_count":21177137,"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":["code-generation","code-generator","django","django-admin","django-rest-framework"],"created_at":"2024-10-03T12:20:43.394Z","updated_at":"2025-04-14T12:40:54.870Z","avatar_url":"https://github.com/Nekmo.png","language":"Python","readme":"#####################\ndjango-code-generator\n#####################\n\n.. image:: https://img.shields.io/github/workflow/status/Nekmo/django-code-generator/Publish.svg?style=flat-square\u0026maxAge=2592000\n  :target: https://github.com/Nekmo/django-code-generator/actions?query=workflow%3APublish\n  :alt: Latest Publish CI build status\n\n.. image:: https://img.shields.io/pypi/v/django-code-generator.svg?style=flat-square\n    :target: https://pypi.org/project/django-code-generator/\n    :alt: Latest PyPI version\n\n.. image:: https://img.shields.io/pypi/pyversions/django-code-generator.svg?style=flat-square\n    :target: https://pypi.org/project/django-code-generator/\n    :alt: Python versions\n\n.. image:: https://img.shields.io/codeclimate/maintainability/Nekmo/django-code-generator.svg?style=flat-square\n    :target: https://codeclimate.com/github/Nekmo/django-code-generator\n    :alt: Code Climate\n\n.. image:: https://img.shields.io/codecov/c/github/Nekmo/django-code-generator/master.svg?style=flat-square\n    :target: https://codecov.io/github/Nekmo/django-code-generator\n    :alt: Test coverage\n\n.. image:: https://img.shields.io/requires/github/Nekmo/django-code-generator.svg?style=flat-square\n    :target: https://requires.io/github/Nekmo/django-code-generator/requirements/?branch=master\n    :alt: Requirements Status\n\n\nGenerate code from Django models for faster development. This project can generate a Django Rest Framework API\nor an admin for your app. You can also **create your own templates** so you can generate code for whatever you want.\n\n\nTo install django-code-generator, run this command in your terminal:\n\n.. code-block:: console\n\n    $ sudo pip install django-code-generator\n\nThis is the preferred method to install django-code-generator, as it will always install the most recent stable release.\n`More info in the documentation \u003chttps://docs.nekmo.org/django-code-generator/installation.html\u003e`_\n\nThen add it to your ``INSTALLED_APPS``:\n\n.. code-block:: python\n\n    INSTALLED_APPS = [\n        # ...\n        'django_code_generator',\n    ]\n\n\n\nUsage\n=====\nGenerating code is as easy as::\n\n    $ python manage.py generator \u003ctemplate\u003e \u003cproject app\u003e\n\nThis project includes two default templates: ``admin`` and ``api``. For example::\n\n    $ python manage.py generator admin myapp\n\n`Read the documentation \u003chttps://docs.nekmo.org/django-code-generator/readme.html#usage\u003e`_ for more info.\n\n\nCreate templates\n================\nA template is a directory with files that will be copied to the final path in your app.\nTemplate files can use `Django Templates Syntax \u003chttps://docs.djangoproject.com/en/dev/topics/templates/\u003e`_. When\ntemplates are generated, the app models are available to be used with the django template syntax.\n\nFor example if you create the template *mytemplate* you can use it for your app *myapp* with the command::\n\n    $ python manage.py generate mytemplate myapp\n\nA template file example:\n\n.. code-block:: django\n\n    {% load code_generator_tags %}from django.contrib import admin\n    {% from_module_import app.name|add:'.models' models %}{% comment %}\n    {% endcomment %}\n    {% for model in models %}\n\n    @admin.register({{ model.name }})\n    class {{ model.name }}Admin(admin.ModelAdmin):\n        \"\"\"\n        \"\"\"\n        list_display = (\n            {% indent_items model.filter_field_names 8 quote='simple' %}\n        )\n        search_fields = (\n            {% indent_items model.char_field_names 8 quote='simple' %}\n        )\n        {% if model.foreign_field_names %}autocomplete_fields = (\n            {% indent_items model.foreign_field_names 8 quote='simple' %}\n        ){% endif %}{% endfor %}\n\nFor more information see `the docs \u003chttps://docs.nekmo.org/django-code-generator/templates.html\u003e`_.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnekmo%2Fdjango-code-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnekmo%2Fdjango-code-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnekmo%2Fdjango-code-generator/lists"}