Reading the repo
Reading the repo
Assembly instructions
Online webapp that scrapes news from different new portals of Nepal and worldwide. Hosted at heroku.
Saved setup from 3 h ago
Will it work on macOS?
Heads-upIt also needs PostgreSQL.
Then run bash setup.sh. It stops at the first error and is safe to run again. Servers and tests aren't started; it lists them at the end. Read it first.
Needs Git: xcode-select --install
git clone https://github.com/hemanta212/Nepali-news-portal-kbd.git cd Nepali-news-portal-kbd
Python ^3.6
brew install python@3.6 pipx install poetry
Needs: PostgreSQL (no compose file — install locally or run via Docker)
poetry install
poetry run python manage.py migrate
poetry run python manage.py runserver
poetry run pytest
$ git clone https://github.com/hemanta212/nepali-news-portal-kbd
$ poetry install
$ python -m pip install -r requirements.txt
You can setup any database supported here. This doc covers setting up sqlite and postgres db.
Populate the following as your environment variables
SECRET_KEY="<your secret key here (random string sequence)"
SQLALCHEMY_DATABASE_URI="sqlite:///site.db"
MAIL_USERNAME="your email", //optional
MAIL_PASSWORD="your password" //optional
optional: only required for 'forgot/reset password' functionality to work If you use gmail and 2 factor-auth, you can use app passwords without compromising to low security.
To enable the international news section get an api key from News API and set environment variable 'NEWS_API_KEY' to that value.
Alternatively, you can populate these detail in 'template_secrets.json' file and rename it to secrets.json.
The details of installing, configuring a postgres database is detailed here.
Once you have setup the db and have its URI, just set it as the value of 'SQLALCHEMY_DATABASE_URI' in above SQLite section and continue following this doc.
To upgrade the newly created database to the project's structure use
$ python manage.py db upgrade
Similarly, if you need to start fresh, delete the migrations folder and now run,
$ python manage.py db init # create the migrations folder
$ python manage.py db migrate # create sql commands for the required db construction
$ python manage.py db upgrade # executes those changes in the db
python run.py // production environment (default)
python run.py debug // for debug environment
NOTE: Running in Prod mode is unsupported with secrets.json file and will fallback to Debug.
Gunicorn is a production WSGI server that is essential for running flask project in production environments like with Procfile in Heroku.
After installing, you just provide the application instance of project to gunicorn.
eg.
gunicorn run:app // prod env
gunicorn run:app debug
Gunicorn is not supported in windows operating system. However, you can run it using WSL.
No reports for macOS yet.
Opens a chat with this manual already filled in, for macOS. It uses your own account; gitmanual sends nothing.