Skip to content

SethSterling22/Flora-Virtual-Admin

Repository files navigation

Setting up the environment

1. Install Python

sudo apt update && apt upgrade -y

Use Python 3.13.2

2. install all dependencies

pip install --upgrade pip

pip install -r requirements.txt

3. Make migrations

This is to create the database schema. Migrate will apply the changes to the database.

python manage.py makemigrations
python manage.py migrate

4. Create a superuser

This is to access the admin panel

python manage.py createsuperuser

5. Create a .env file

This is to store the environment variables

cp .env_example .env

7. Load the data

python manage.py backup_db

8. Run the server

Server will be running on http://localhost:8000 with the following command

python manage.py runserver 0.0.0.0:8000
gunicorn --bind 0.0.0.0:8000 --workers 4 --timeout 120 --access-logfile - --error-logfile - flora_admin.wsgi:application

9. Create a model based on the previous database

python manage.py inspectdb > [APP_NAME]/models.py

10. Create a backup of the database without the Django models can conflict

python manage.py dumpdata --exclude auth.permission --exclude contenttypes --exclude sessions --exclude admin --output dump_flora_[DATE].JSON

11. Dump a specific table in the database and load its data (if it's necessary)

python manage.py dumpdata myapp.Familia

python manage.py loaddata myapp.json --include='myapp.Familia'

12. Load data from JSON to database

python manage.py loaddata data.json

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors