News search API developed for the purposes of the ColdCase Project.

Overview

Saxion - Cold Case - News Search API

Setup


Local – Linux/MacOS

  1. Make sure you have python 3.9 and pip 21 installed.
  2. This project uses a MySQL database, if you want to connect to a local MySQL database, make sure you have MySQL server installed https://dev.mysql.com/doc/mysql-installation-excerpt/5.7/en/
  3. A SQL script is provided in the repository with the database articles used for testing.
  4. Clone the Git repository to your local system.
  5. Make sure you have virtualenv installed:
sudo pip3 install virtualenv
  1. Create a virtual environment with the name of the project:
virtualenv coldcaseenv
  1. Activate the virtual environment:
source coldcaseenv/bin/activate
  1. Go inside the project folder, and copy the .env.example file, and make the name of the new file “.env”: cp .env.example .env
  2. Fill this file with your own environment variables. The variables that need to be filled are already there.
  3. Install the required packages:
pip install -r requirements.txt
  1. Now, migrate the database tables into the database with the following command:
python manage.py migrate
  1. It is time to start the server, which you can do with the following command:
python manage.py runserver

Local- Windows

The setup for Windows is very similar to the one on Linux. These are the differences: Installing Python and pip:

  1. As a windows user, you can get Python, including pip, from here: https://www.python.org/downloads/
  2. Next, to install a virtual environment tool:
pip3 install virtualenvwrapper-win 
  1. Then, to start the virual environment, this is the command:
mkvirtualenv coldcaseenv
  1. The environment is activated automatically, so, now we can go on with step 8 (Linux/MacOS Setup (above))

AWS

To install this project on an AWS server, the steps are very similar to the ones for the local machine. This is what needs to be done.

  1. First, create an amazon EC2 instance, with SSH access to yourself, and http inbound requests for everyone.
  2. SSH into this instance, with the keys you got during the setup of this instance.
  3. Install the necessary packages:
sudo apt-get install python3-pip apache2 libapache2-mod-wsgi-py3
  1. This project uses a MySQL database, if you want to connect to a local MySQL database, make sure you have MySQL server installed ( https://dev.mysql.com/doc/mysql-installation-excerpt/5.7/en/ )
  2. A SQL script is provided in the repository with the database articles used for testing.
  3. Clone the Git repository to your local system.
  4. Make sure you have virtualenv installed:
  1. Create a virtual environment with the name of the project:
virtualenv coldcaseenv
  1. Activate the virtual environment:
source coldcaseenv/bin/activate
  1. Go inside the project folder, and copy the .env.example file, and make the name of the new file “.env”:
cp .env.example .env
  1. Fill this file with your own environment variables. The variables that need to be filled are already there.
  2. Install the required packages:
pip install -r requirements.txt
  1. Now, migrate the database tables into the database with the following command:
python manage.py migrate
  1. Get out of the local instance with the following command: deactivate
  2. Go to the root directory of the EC2 instance with: cd
  3. Go to the directory where the Apache configuration file is located, and edit it:
sudo vi /etc/apache2/sites-available/000-default.conf
  1. Replace the file with the following config:
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /home/ubuntu/django/coldcasefind/ColdCaseFind
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

<Directory /home/ubuntu/django/coldcasefind/ColdCaseFind/ColdCaseFind>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
WSGIDaemonProcess ColdCaseFind python-path=/home/ubuntu/django/coldcasefind/ColdCaseFind python-home=/home/ubuntu/django/coldcasefindenv
WSGIProcessGroup ColdCaseFind
WSGIScriptAlias / /home/ubuntu/django/coldcasefind/ColdCaseFind/ColdCaseFind/wsgi.py
</VirtualHost>
  1. Edit this config in order to make the routes correct for your configuration.
  2. Restart Apache with:
sudo service apache2 restart

This deployment guide is inspired by: https://medium.com/saarthi-ai/ec2apachedjango-838e3f6014ab

Credits

Version: 0.0.3
Date: 29.06.2021
Project: Hot and Cold Case Project
Аssignor: Saxion University of Applied Sciences (Advanced Forensic Technology) | Jaap Knotter
Project Manager: Tatjana Kuznecova
Software Consultant: Dimitar Rangelov | SDP
Software Developer: Luuk Cloosterman


SDP
Saxion

Owner
Dimitar Rangelov
Electrical and Electronics student
Dimitar Rangelov
Pretty tornado wrapper for making lightweight REST API services

CleanAPI Pretty tornado wrapper for making lightweight REST API services Installation: pip install cleanapi Example: Project folders structure: . ├──

Vladimir Kirievskiy 26 Sep 11, 2022
Appier is an object-oriented Python web framework built for super fast app development.

Joyful Python Web App development Appier is an object-oriented Python web framework built for super fast app development. It's as lightweight as possi

Hive Solutions 122 Dec 22, 2022
Asynchronous HTTP client/server framework for asyncio and Python

Async http client/server framework Key Features Supports both client and server side of HTTP protocol. Supports both client and server Web-Sockets out

aio-libs 13.2k Jan 05, 2023
🔥 Fire up your API with this flamethrower

🔥 Fire up your API. Documentation: https://flama.perdy.io Flama Flama aims to bring a layer on top of Starlette to provide an easy to learn and fast

José Antonio Perdiguero 216 Dec 26, 2022
A very simple asynchronous wrapper that allows you to get access to the Oracle database in asyncio programs.

cx_Oracle_async A very simple asynchronous wrapper that allows you to get access to the Oracle database in asyncio programs. Easy to use , buy may not

36 Dec 21, 2022
Web framework based on type hint。

Hint API 中文 | English 基于 Type hint 的 Web 框架 hintapi 文档 hintapi 实现了 WSGI 接口,并使用 Radix Tree 进行路由查找。是最快的 Python web 框架之一。一切特性都服务于快速开发高性能的 Web 服务。 大量正确的类型

Aber 19 Dec 02, 2022
Sanic integration with Webargs

webargs-sanic Sanic integration with Webargs. Parsing and validating request arguments: headers, arguments, cookies, files, json, etc. IMPORTANT: From

Endurant Devs 13 Aug 31, 2022
News search API developed for the purposes of the ColdCase Project.

Saxion - Cold Case - News Search API Setup Local – Linux/MacOS Make sure you have python 3.9 and pip 21 installed. This project uses a MySQL database,

Dimitar Rangelov 3 Jul 01, 2021
Django Ninja - Fast Django REST Framework

Django Ninja is a web framework for building APIs with Django and Python 3.6+ type hints.

Vitaliy Kucheryaviy 3.8k Jan 02, 2023
The core of a service layer that integrates with the Pyramid Web Framework.

pyramid_services The core of a service layer that integrates with the Pyramid Web Framework. pyramid_services defines a pattern and helper methods for

Michael Merickel 78 Apr 15, 2022
A high-level framework for building GitHub applications in Python.

A high-level framework for building GitHub applications in Python. Core Features Async Proper ratelimit handling Handles interactions for you (

Vish M 3 Apr 12, 2022
The little ASGI framework that shines. ?

✨ The little ASGI framework that shines. ✨ Documentation: https://www.starlette.io/ Community: https://discuss.encode.io/c/starlette Starlette Starlet

Encode 7.7k Jan 01, 2023
Klein - A micro-framework for developing production-ready web services with Python

Klein, a Web Micro-Framework Klein is a micro-framework for developing production-ready web services with Python. It is 'micro' in that it has an incr

Twisted Matrix Labs 814 Jan 08, 2023
Ape is a framework for Web3 Python applications and smart contracts, with advanced functionality for testing, deployment, and on-chain interactions.

Ape Framework Ape is a framework for Web3 Python applications and smart contracts, with advanced functionality for testing, deployment, and on-chain i

ApeWorX Ltd. 552 Dec 30, 2022
The Python micro framework for building web applications.

Flask Flask is a lightweight WSGI web application framework. It is designed to make getting started quick and easy, with the ability to scale up to co

The Pallets Projects 61.5k Jan 06, 2023
A Flask API REST to access words' definition

A Flask API to access words' definitions

Pablo Emídio S.S 9 Jul 22, 2022
Bablyon 🐍 A small ASGI web framework

A small ASGI web framework that you can make asynchronous web applications using uvicorn with using few lines of code

xArty 8 Dec 07, 2021
A minimal, extensible, fast and productive API framework for Python 3.

molten A minimal, extensible, fast and productive API framework for Python 3. Changelog: https://moltenframework.com/changelog.html Community: https:/

Bogdan Popa 980 Nov 28, 2022
Asita is a web application framework for python.

What is Asita ? Asita is a web application framework for python. It is designed to be easy to use and be more easy for javascript users to use python

Mattéo 4 Nov 16, 2021
Pyramid - A Python web framework

Pyramid Pyramid is a small, fast, down-to-earth, open source Python web framework. It makes real-world web application development and deployment more

Pylons Project 3.7k Dec 30, 2022