Django provides default setting for SQLite3. If you decide to use a different database, please refer to this documentation for configuration details.
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": BASE_DIR / "db.sqlite3",
}
}
python manage.py migrate
To access the Django admin panel, you need to create a superuser account. If you want to know how to create a super user, refer to this Documentation.
python manage.py createsuperuser
When the server starts, you can access the Django admin panel by simply adding '/admin' to the base URL,
resulting in http://127.0.0.1:8000/admin.
Once you are Logged in navigate to "GROUP" section, and create 2 groups.
admin with all permission.
client with only Transaction view permission.
Note: This permission is specific to the Transaction app, playing a crucial role in displaying the Transaction app for new clients. You also have the flexibility to create and assign custom permissions to the 'client' group as needed.
After creating the group mentioned earlier, navigate to the Users section in the admin
panel, and assign the admin group to the superuser.
client group.
CRUD app, run the following command.
python manage.py loaddata transactions-list.json
If you prefer not to use seed data, you can remove the 'fixtures' folder from the 'transactions' app.
datadump.json:
Follow the instructions outlined in steps 1 to 2 under the Integrate Manually section. Subsequently, execute the provided command to import data into a different database or a new SQLite database.
python manage.py loaddata datadump.json
NOTE: Sneat already provides datadump.json file under
full-version/datadump.json. Though if you want to export your data, use command
python3 manage.py dumpdata > datadump.json to Dump data from SQLite.
Migrating a Django application from SQLite to PostgreSQL involves a few steps. Here's a general guide to help you with the process:
psycopg2: Update your Django project's requirements to include the
psycopg2 package, which is a PostgreSQL adapter for Python. Install it using:
pip install psycopg2
config/settings.py file to use
PostgreSQL. Modify the DATABASES setting:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'your_db_name',
'USER': 'your_db_user',
'PASSWORD': 'your_db_password',
'HOST': 'localhost',
'PORT': '5432',
}
}
Replace your_db_name, your_db_user, and your_db_password with
your PostgreSQL database name, user, and password.
python manage.py migrate
python manage.py loaddata datadump.json
NOTE: Sneat already provides datadump.json file under
full-version/datadump.json.