Django project starter on steroids: quickly create a Django app AND generate source code for data models + REST/GraphQL APIs (the generated code is auto-linted and has 100% test coverage).
We're a Django project starter on steroids!
One-line command to create a Django app with all the dependencies auto-installed
AND
Easy config (alpha release) to generate Django code for:
npm install -g imagine && imagine create -f django -n myapp
If you don't have npm
installed, you'll need to install this first.
$ npm install -g imagine && imagine create -f django -n myapp
changed 214 packages, and audited 215 packages in 5s
....
found 0 vulnerabilities
32 files written
You have successfully created a new project!
Now you can run "cd myapp && imagine run" to install the dependencies and open a web server running at
http://127.0.0.1:8000/
Run cd myapp && imagine run
to run your new Django app, and open http://127.0.0.1:8000/ to see that the install worked successfully.
Congrats! Your Django app is up and running!
Now that you've created your new app, check out the myapp.im
in your app directory - using this you can:
Continue reading to learn more, or check out www.imagine.ai.
Our one-line command allows your to get started with your Django app immediately, without worrying about installing dependencies - we take care of those, so you can focusing on writing business logic.
Our default settings when we create your Django app are as follows:
These aren't the exact settings you want? No sweat, you can always change the settings as per your preferences - read on to see how to do this.
If you want to change any of the above defaults for your app, its a piece of cake.
Go to the myapp.im file in your directory, your should see the basic default settings here:
settings
app:
# your application name
name: myapp
# choose one: [django, node]
framework: django
django:
# choose one: [pipenv, poetry, virtualenv]
package-manager: pipenv
# choose one: [gunicorn, uwsgi, dev]
server: dev
layout:
# choose one: [single-file, separate-files]
models: single-file
# name of the project settings directory:
project-dir: microservice
api:
# choose one: [rest, graphql]
format: rest
end settings
# database <database-name> <database type: [sqlite, mysql, posgresql]>
database myapp-db sqlite3
imagine compile myapp.im
in your terminal. Your app will be updated with the new settings.Not only can you change your app settings easily, you can also generated production-ready code using the myapp.im
file.
Use Imagine's simple syntax to generate code for data models and CRUD APIs to your Django app.
Run imagine compile myapp.im
to see the generated code.
PS - all our generated code has:
PPS - in this repository, we have included an example to-do app that we created and generated using the todoapp.im
file. You can check out the todoapp.im
file that we used to create the Django app and express the specifications for the data models and APIs, as well as all the Django code files that are generated when you run imagine compile todoapp.im
.
Have fun! 💛