Skip to content

Веб-сайт для уроков астрономии. Демонстрирует фото\видео дня из открытого NASA API, позволяет ученикам публиковать посты и рассылает письма со статистикой просмотров.

Notifications You must be signed in to change notification settings

u-shev/space-app

Repository files navigation

Tests&Coverage Linter check Maintainability Test Coverage

Space app is a web site for astronomy classes. Link here.

On a main page added a picture of the day - NASA API project, which shows every day a picture (or video) and an explanation.

image

Also added posts, 4 on each page.

image

Pupils can register, login and add posts

image

with one added picture which is used as preview on a main page. Pupils can edit or delete their posts (only author can see links). Every post got views counter.

image

Pages got pagination

image

Pupils cannot change or delete their profiles, that's up to teaher. Every Monday at 8.30 each of those who added posts get statistic of views sent to email.

Installation

Prerequisites

Python

Before installing the package make sure you have Python version 3.8 or higher installed:

python --version

Poetry

The project uses the Poetry dependency manager. To install Poetry use its official instruction.

PostgreSQL

PostgreSQL is used as the main database management system. You have to install it first. It can be downloaded from official website

Application

Clone the project

git clone git@github.com:u-shev/space-app.git
cd space-app

Create virtual environment

python -m venv /path/to/new/virtual/environment

Create .env file in the root folder and add following variables

DATABASE_URL=postgresql://{username}:{password}@{host}:{port}/{databasename}  
SECRET_KEY='{your secret key}'
EMAIL_HOST_USER='{your email adress, if you use different from mail.ru post, you should change EMAIL_HOST, EMAIL_PORT, EMAIL_USE_TLS, EMAIL_USE_SSL varaibles in settings.py}'
EMAIL_HOST_PASSWORD='{it's not your post password! you shoul get special password for application in settings of your post operator}'

To create the necessary tables in the database, start the migration process

make migrate

Usage

Start the Uviicorn Web-server by running:

make start

By default, the server will be available at http://0.0.0.0:8000.

It is also possible to start it local in development mode using:

make run

The dev server will be at http://127.0.0.1:8000.

To use Celery you should open different terminals for:

  • (global env) Redis with command
    redis-server
    
  • (virtual env) Celery worker with command
    make worker
    
  • (virtual env) Celery beat with command
    make beat
    

Additional makefile commands

make lint

starts linter check

make test

starts tests

About

Веб-сайт для уроков астрономии. Демонстрирует фото\видео дня из открытого NASA API, позволяет ученикам публиковать посты и рассылает письма со статистикой просмотров.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published