Package: drf-compose
DRF Compose is a Python package for defining and quick starting Django
Rest Framework projects. With DRF Compose, you use a JSON or YAML file
to configure your DRF application. Then, with a single command, you get
to generate your DRF project code using all the specified configuration
from your compose file. To learn more about all the features of DRF
Compose, see the list of features below.DRF Compose is aimed at making the process of starting a DRF project
quick and fun - giving you a development head start experience - while also preventing
any frustration caused by the inability to quick start an API.InstallingInstall and update usingpip:$pipinstall-Udrf_composeUsageUsing DRF Compose is basically a two-step process:Define your application in a drf-compose.json file.Run drf-compose and the DRF compose command generates a ready to use
DRF project code.Command options overview and helpYou can also see this information by running drf-compose –help from the command line.Usage:drf-compose[OPTIONS]ThisscriptcomposesaDRFproject.Options:-s,--sourceFILESpecifyanalternatecomposefileassource[default:drf-compose.json]--yamlIndicatesthatthesuppliedsourcefileisaYAMLfile--helpShowthismessageandexit.Optionsname(required): specifies the project name.app_with_model(required): specifies details describing each apps
in the DRF project.app_name(required): specifies the app namemodels: a list of models belonging to the appname(required): specifies the model namemeta: specifies the different model meta options as in theDjango model meta
documentationfields(required): a list of fields belonging to a model.name(required): the name of the field as in theDjango model field documentationtype(required): the field type as specified inDjango model field type reference
documentation.
Basic syntax sugar also supported as shown below:SyntaxField TypecharCharFieldtextTextFieldurlURLFielddatetimeDatetimeFieldfkForeignKeyo2oOneToOneFieldm2mManyToManyFieldoptions: specifies field option as in theDjango model
field
documentation.use_uuid_as_key(boolean): if True, a UUID is used as the
model’s primary key.str: specifies the field to be returned as representation
of the model in__str__.Must be one of the specified
field namesauth_app: specifies details of the authentication application.app_name(required): specifies the app namemodel_name(required): specifies the model name for the custom user modelusername_field: A string describing the name of the field on the user model that is used as the unique identifierDjango USERNAME_FIELD documentation.email_field: A string describing the name of the email field on the User model.Django’s EMAIL_FIELD documentationrequired_fields: A list of the field names that will be prompted for when creating a user via thecreatesuperusermanagement commandDjango’s REQUIRED_FIELDS documentationmeta: specifies the different model meta options as in theDjango model meta
documentationfields: a list of fields belonging to a model.name(required): the name of the field as in theDjango model field documentationtype(required): the field type as specified inDjango model field type reference
documentation.
Basic syntax sugar also supported as shown below:SyntaxField TypecharCharFieldtextTextFieldurlURLFielddatetimeDatetimeFieldfkForeignKeyo2oOneToOneFieldm2mManyToManyFieldoptions: specifies field option as in theDjango model
field
documentation.use_uuid_as_key(boolean): if True, a UUID is used as the
model’s primary key.str: specifies the field to be returned as representation
of the model in__str__.Must be one of the specified
field namesinclude: specifies the addons to be included in the application.simple_jwt(boolean): if True, includesSimple JWTJSON Web Token authentication plugin into the application.COMING SOON!django_filter(boolean)if True, includesDjango-filter, a reusable Django application allowing users to declaratively add dynamic QuerySet filtering from URL parameters.docker(boolean): if True, includes docker setup option into the application.dj-database-url(boolean): if True, includesDJ-Database-URL, a simple Django utility allows you to utilize the 12factor inspired DATABASE_URL environment variable to configure your Django application.LinksDocumentation:https://drf-compose.readthedocs.ioChanges:https://drf-compose.readthedocs.io/changes/PyPI Releases:https://pypi.org/project/drf-compose/Source Code:https://github.com/IamAbbey/drf_composeIssue Tracker:https://github.com/IamAbbey/drf_compose/issuesCreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.