A django extension for creating sqlite3, postgresql based on settings.py
Project description
Django CreateDB
This is a library that allows you to create databases based on settings.py DATABASES configurations.
Currently supported databases are:
- sqlite3
- postgresql
- mysql
it is equivalent to sequelize's sequelize-cli db:create
Installation
pip install django-createdb
Usage
- Add INSTALLED_APPS in settings.py
INSTALLED_APPS = [
...
createdb
...
]
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": BASE_DIR / "db.sqlite3",
},
"postgresql": {
"ENGINE": "django.db.backends.postgresql",
"NAME": env("POSTGRESQL_NAME"),
"HOST": env("POSTGRESQL_HOST"),
"USER": env("POSTGRESQL_USER"),
"PASSWORD": env("POSTGRESQL_PASSWORD"),
},
"mysql": {
"ENGINE": "django.db.backends.mysql",
"NAME": env("MYSQL_NAME"),
"HOST": env("MYSQL_HOST"),
"USER": env("MYSQL_USER"),
"PASSWORD": env("MYSQL_PASSWORD"),
"PORT": 3306,
},
}
-
python manage.py createdbThis will create a database based on the "default" database settingsYou can specify which configuration to use by providing the
--dbargumentpython manage.py createdb --db postgresql
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django-createdb-0.2.0.tar.gz.
File metadata
- Download URL: django-createdb-0.2.0.tar.gz
- Upload date:
- Size: 7.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d0a1742c466b7fd1f27a4d71d12ac78362bc14b23c7e7225800adc1f13f10ae5
|
|
| MD5 |
045077804fcf1bbc4d746af273d2023a
|
|
| BLAKE2b-256 |
84dd220939cc692b4c3eda156627b06c88b2f45a3cfb5580c6e032194aee1913
|
File details
Details for the file django_createdb-0.2.0-py3-none-any.whl.
File metadata
- Download URL: django_createdb-0.2.0-py3-none-any.whl
- Upload date:
- Size: 9.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f292ec8f7ce710a96dd81531eb1988e9c89dc253f32c676d4ecfcf61d6310b64
|
|
| MD5 |
be225899eb0c228f0322367fbcb65cdd
|
|
| BLAKE2b-256 |
c838184db187af868c938dce9ce0bbbf91f22ba7798de8cde50a232f9c8a78e9
|