This project is an enterprise management system (SGE) developed in Django, featuring JWT authentication, permission control, registration and management of products, brands, categories, suppliers, stock inflows and outflows, as well as reports and metrics.
- Registration and management of Products, Brands, Categories, and Suppliers
- Control of Stock Inflows and Outflows
- Sales and movement reports and metrics
- Detailed permissions by user and group
- RESTful API with JWT authentication (via Django REST Framework)
- Administrative interface via Django Admin
- Filters, pagination, and search
- Python 3.12+
- Django 5.2
- Django REST Framework
- SimpleJWT
- Bootstrap 5 (frontend)
- SQLite (default, can be changed to other databases)
See below some screenshots of the SGE system in action:
Login screen
Dashboard
Product List
-
Clone the repository:
git clone https://github.com/Janfrancisco/sge.git cd sge -
Create and activate a virtual environment:
python -m venv venv venv\Scripts\activate # Windows # or source venv/bin/activate # Linux/Mac
-
Install the dependencies:
pip install -r requirements.txt
-
Apply the migrations:
python manage.py migrate
-
Create a superuser:
python manage.py createsuperuser
-
(Optional) Populate the database with mock data:
See the section below aboutseed_data.py. -
Run the server:
python manage.py runserver
This project includes a script called seed_data.py to populate the database with mock categories, brands, suppliers, products, inflows, and outflows, making testing and demonstrations easier.
-
Apply the migrations before running the script:
python manage.py migrate
-
Open the Django shell:
python manage.py shell
-
Run the seed script:
from seed_data import run run()
-
Done!
- The database will be populated with sample data for all main entities of the system.
Tip:
The script can be run as many times as you want, but it may generate duplicate records if run multiple times without cleaning the database.
- Access the system at http://localhost:8000/
- Access the admin at http://localhost:8000/admin/
- Access the API at http://localhost:8000/api/v1/
- Use the
/api/token/endpoint to obtain a JWT token. - Send the token in the header
Authorization: Bearer <your_token>in protected requests.
- The system uses Django's default permissions (
add,change,delete,view) and can be customized. - In Django Admin, assign permissions to users or groups as needed.
brands: Product brandscategories: Product categoriesproducts: Productssuppliers: Suppliersinflows: Stock inflowsoutflows: Stock outflowsauthentication: Authentication and users
This project is distributed under the MIT license.


