Django backend API service for all Hellow Lab products
- Features
- Requirements
- Installation
- Configuration
- Sub-Prjects
- Usage
- API Endpoints
- Running Tests
- Contributing
- License
- User authentication for all HellowLab products
- Backend API for DblFeature app
- Python 3.11.4
- Django 5.0.2
- Use requirements.txt for all other requirements
-
Clone the repository:
Clone the repository.
-
Create and activate a virtual environment:
python -m venv venv
venv/Scripts/activate- Install dependencies:
pip install -r requirements.txt- Run migrations:
cd HellowLab
python manage.py makemigrations
python manage.py migrate- Create a superuser:
python manage.py createsuperuser- Run the development server:
python manage.py runserver 0.0.0.0:8000- Environment Variables: You can configure environment variables by creating a
.envfile in./HellowLab/HellowLab/.env. Common variables include:
DEBUG=True
SECRET_KEY=your_secret_key
DATABASE_URL=postgres://user:password@localhost:5432/dbname- Settings: Modify
settings.pyfor any additional settings such as installed apps, middleware, or custom configurations.
-
HellowLab
HellowLab is the core module of our system, providing essential laboratory functionalities such as data analysis, result processing, and experiment management. This sub-project is designed to streamline lab operations by integrating various tools and resources necessary for scientific research and development.
-
Authentication
The Authentication sub-project handles all user-related security features, including user registration, login, password management, and access control. It ensures that only authorized users can access specific parts of the application by implementing robust authentication and authorization mechanisms using industry-standard practices.
-
DblFeature
DblFeature is the API interface for our application named DblFeature. This sub-project is responsible for managing the API endpoints that interact with the core application, providing data access and manipulation capabilities. It serves as the bridge between the front-end and back-end, ensuring smooth and efficient communication across the system.
Once the server is running, you can access the API at http://127.0.0.1:8000/.
The admin service can be accessed at http://127.0.0.1:8000/admin.
-
Authentication:
- POST /api/auth/login/ - Log in a user.
- POST /api/auth/logout/ - Log out a user.
- POST /api/auth/register/ - Register a new user.
-
User:
- GET /api/users/ - Get all users.
- GET /api/users// - Get user by ID.
- PUT /api/users// - Update user by ID.
- DELETE /api/users// - Delete user by ID.
To run tests, use the following command:
python manage.py test
If you would like to contribute, please follow these steps:
- Fork the repository.
- Create a new branch (git checkout -b feature-branch).
- Make your changes.
- Commit your changes (git commit -m 'Add new feature').
- Push to the branch (git push origin feature-branch).
- Create a Pull Request.
This project is licensed under the MIT License. See the LICENSE file for details.