在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:OriginProtocol/origin-website开源软件地址:https://github.com/OriginProtocol/origin-website开源编程语言:HTML 57.2%开源软件介绍:Head to https://www.originprotocol.com/developers to learn more about what we're building and how to get involved. originprotocol.comOfficial website for Origin Protocol This is a Flask app with the source code for www.originprotocol.com. The code is all InstallingClone
Setup and activate a Python virtualenv
Install
Rename the file
Run it!
Open browser to view
Problems? Hit us up in the Run the TestsThroughout the development process and before committing or deploying, run: pytest Run individual test files simply as: pytest path/to/test.py Run a single test case, or an individual test, using: pytest path/to/test.py::test_case_name Running locally with CeleryWe use Celery for running background tasks (mostly just sending emails). To get this working on your local machine, you'll want to make sure:
Celery Flower is useful for monitoring tasks: Running locally with Docker ComposeYou can run the website in combination with a local PostgreSQL, Redis and Celery using Docker Compose. Remove the cd origin-website
docker-compose up Note: you can login to the container running the app with the following command: docker exec -ti origin-website /bin/bash Running cron jobs locallySome scripts use Heroku cron jobs. Use the following command to test them locally PYTHONPATH=$(pwd) PROJECTPATH=$(pwd) python ./logic/scripts/update_token_insight.py When running on docker, a container named docker exec -it -e PYTHONPATH=/app -e PROJECTPATH=/app origin-website python ./logic/scripts/update_token_insight.py Running cron jobs on Production/StagingRunning token_stats on Staging: heroku run -a staging-originprotocol-com PROJECTPATH=/app python ./logic/scripts/token_stats.py Running token_stats on Production: heroku run -a originprotocol-com PROJECTPATH=/app python ./logic/scripts/token_stats.py System Requirements
Getting Started
When this completes you should be able to access the website at LocalizationSee translations directory. Database changesSet FLASK_APP env variable to point to the executable... e.g.: export FLASK_APP=~/projects/origin-website/main.py We use Flask Migrate to handle database revisions. If you make changes to the database, use Heroku DeployTo deploy a development copy of the site on Heroku, just choose which branch you would like to use and follow the instructions:
Heroku will prompt you to set config variables. At a minium, you must set these two:
See sample.env for a full list of other optional config variables. You can get Recaptcha keys from Google. We use both the python and the nginx buildpacks:
Deployment DependenciesTo update the deployment dependencies, update
This will include any installed deps, and the deps defined in Connect to Heroku instanceIn order to run Celery jobs manually you can ssh into Heroku staging with:
or into Heroku production
ContributingWe'd love to have you join us and contribute to this project. Please join our #engineering channel on Discord and read our guidelines on contributing to get started. ShoutoutsSpecial thanks to the following companies for their support: |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论