Giter Site home page Giter Site logo

online_store's Introduction

Online_store REST API

Для создания REST API использовались:

Требуемые библиотеки находятся в файле requirements.txt

Команды для запуска приложения на сервере linux

Настройка PostgreSQL

1. sudo apt-get install postgresql
2. sudo apt-get install postgresql-server-dev-all
3. sudo -u postgres psql postgres
    a. \password postgres
    b. Ввод пароля: secret
    c. Создание пользователя online_store
        create user online_store with password 'secret';
        alter role online_store set client_encoding to 'utf8';
        alter role online_store set default_transaction_isolation to 'read committed';
        alter role online_store set timezone to 'UTC';
    d. create database online_store_db owner online_store;
    e. Выйти из postgres (\q)   

Клонирование репозитория

1. sudo apt install git
2. mkdir project && cd project
3. git clone https://github.com/Borutia/online_store.git
Проект теперь находится в ~/project/online_store
4. cd online_store/

Установка python и venv

1. sudo apt-get install python3
2. sudo apt-get install python3-venv
3. python3 -m venv venv
4. Из папки проекта: source ./venv/bin/activate
5. pip install -r requirements.txt

Настройка проекта

1. python manage.py makemigrations
2. python manage.py migrate

Развёртывание сайта

1. pip install gunicorn   
2. gunicorn -b :8080 online_store.wsgi 

Запуск тестов

1. sudo -u postgres psql postgres
2. ALTER USER online_store CREATEDB;
3. Самописные тесты запускаются командой: python manage.py test
4. Ручное тестировать можно проводить с помощью Postman

online_store's People

Contributors

borutia avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.