This is a Flask server that performs data conversion between JSON and XML formats using Celery for asynchronous task processing and SQLAlchemy for interacting with the PostgreSQL database.
- Clone the repository to your local machine:
git clone [email protected]:alexandrLes/flask_server.git
- Install the dependencies:
pip install requirements.txt
- Set up and configure PostgreSQL and Redis servers.
- Create a configuration file
config.py
and specify the connection parameters to your PostgreSQL and Redis servers.
# config.py
class Config:
SQLALCHEMY_DATABASE_URI = 'postgresql+psycopg2://admin:123@localhost:5432/main_db'
CELERY_BROKER_URL = 'redis://localhost:6379/0'
CELERY_RESULT_BACKEND = 'redis://localhost:6379/0'
TESTING = False
## Running
redis-server
celery -A tasks worker --loglevel=info
python app.py
## Testing
python test_requests.py