This project is a Django-based study project aimed at developing a server for a store application. It includes features such as product management, user authentication, and background task processing.
- Python: Programming language used for the project.
- Django: Web framework for building the server-side application.
- PostgreSQL: Relational database management system used for data storage.
- Redis: In-memory data structure store used for caching and task queue.
- User Authentication: Secure user login and registration.
- Product Management: CRUD operations for products.
- Background Tasks: Asynchronous task processing with Celery.
- Caching: Efficient data retrieval with Redis caching.
To set up the project locally, follow these steps:
Create and activate a virtual environment to manage project dependencies:
python -m venv .venv
source .venv/bin/activate
Upgrade pip
and install the required packages:
pip install --upgrade pip
pip install -r requirements.txt
Run migrations to set up the database schema:
./manage.py migrate
Load initial data into the database (replace <path_to_fixture_files>
with the path to your fixture files):
./manage.py loaddata <path_to_fixture_files>
Start the Django development server:
./manage.py runserver
Start the Redis server for caching and background task management:
redis-server
Start the Celery worker for processing background tasks:
celery -A store worker --loglevel=INFO
The configuration of the project is located in store/settings.py
. Here you can adjust database settings, secret keys, and other project-specific configurations.
Ensure the following environment variables are set:
DATABASE_URL
: URL for PostgreSQL database connection.REDIS_URL
: URL for Redis server connection.SECRET_KEY
: Django secret key for cryptographic operations.
Fixture files are located in the store/fixtures/
directory. These files are used to load initial data into the database.
To run tests, use the following command:
./manage.py test
Ensure all tests pass before deploying changes.
For deploying the project to a production environment, follow the deployment instructions in the DEPLOYMENT.md
file.
Contributions are welcome! Please follow the standard pull request workflow:
- Fork the repository.
- Create a new branch for your changes.
- Commit your changes with descriptive messages.
- Push your branch to your forked repository.
- Create a pull request to merge your changes into the main repository.
This project is licensed under the MIT License - see the LICENSE file for details.
Feel free to adjust or expand upon these sections based on the specifics of your project and any additional details you want to include.