OKX TradeView is a cryptocurrency trading management platform built on Django 5.0, integrating multiple functional modules, including user authentication, data presentation, card management, vending machine payments, etc. The core module Cryptoforward of the project handles functions related to cryptocurrency trading.
For Chinese readme, visit here
The project is designed in a modular fashion according to its functions, with each module responsible for different business logic. The following are the main modules in the project:
The Cryptoforward
module is the core functionality of the project, responsible for data processing and presentation related to cryptocurrency trading. Its features include:
- Message Formatting: Format encrypted trading data through
formatMsg.py
for analysis and presentation. - Transaction Data Processing: Manage and store transaction-related data through
models.py
. - View Presentation: Implement the presentation and data update of transaction-related pages through
views.py
. - URL Routing: Define and handle routes related to transactions through
urls.py
.
- Authentication: Provides user login, registration, password recovery, and other features.
- Dashboards: Present data analysis dashboards to help users intuitively understand trading data and system status.
- Cards: Manage card data, providing UI display in card styles.
- VendingMachine: Provide vending machine-related functions, including product display and payment.
- UI & Layouts: Provide a rich set of UI components and layout templates to enhance user experience.
The project depends on the following main Python packages, which can be viewed in the requirements.txt
file:
asgiref==3.7.2
Django==5.0
gunicorn==21.2.0
packaging==23.1
python-dotenv==1.0.0
sqlparse==0.4.4
typing_extensions==4.7.1
whitenoise==6.5.0
django_q==1.3.9
redis==4.5.3
-
The project manages environment variables through
python-dotenv
, requiring the creation of a.env
file and configuration of the corresponding environment variables.Example
.env
file:SECRET_KEY=your-secret-key DEBUG=True DJANGO_ENVIRONMENT=local DATABASE_NAME=OKXTradeView DATABASE_USER=OKXTradeView DATABASE_PASSWORD=your-db-password
-
Ensure that PostgreSQL database is installed locally and connection information is properly configured.
The following are the steps for project deployment:
git clone https://github.com/mowanying123/OKX-tradeview.git
cd OKX-tradeview
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
Ensure that the PostgreSQL database is running and the database connection is correctly configured in config/settings.py
. Execute the following command for database migration:
python manage.py migrate
Run the following command to start the local development server:
python manage.py runserver
For the production environment, it is recommended to use gunicorn
as the WSGI server. You can start the production server with the following command:
gunicorn --config gunicorn-cfg.py config.wsgi
At this point, the project should be successfully launched and running.
The project uses Django Q
and Redis to handle asynchronous tasks. Deploy Redis and start the task queue with the following command:
python manage.py qcluster
Issues and Pull Requests are welcome. If you have any questions or suggestions, please contact the project maintainer.