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

You might also like...
Fully featured framework for fast, easy and documented API development with Flask

Flask RestPlus IMPORTANT NOTICE: This project has been forked to Flask-RESTX and will be maintained by by the python-restx organization. Flask-RESTPlu

Flask-Potion is a RESTful API framework for Flask and SQLAlchemy, Peewee or MongoEngine

Flask-Potion Description Flask-Potion is a powerful Flask extension for building RESTful JSON APIs. Potion features include validation, model resource

A Flask API REST to access words' definition
A Flask API REST to access words' definition

A Flask API to access words' definitions

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: . ├──

 Lemon is an async and lightweight API framework for python
Lemon is an async and lightweight API framework for python

Lemon is an async and lightweight API framework for python . Inspired by Koa and Sanic .

Endpoints is a lightweight REST api framework written in python and used in multiple production systems that handle millions of requests daily.

Endpoints Quickest API builder in the West! Endpoints is a lightweight REST api framework written in python and used in multiple production systems th

APIFlask is a lightweight Python web API framework based on Flask and marshmallow-code projects
APIFlask is a lightweight Python web API framework based on Flask and marshmallow-code projects

APIFlask APIFlask is a lightweight Python web API framework based on Flask and marshmallow-code projects. It's easy to use, highly customizable, ORM/O

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:/

A public API written in Python using the Flask web framework to determine the direction of a road sign using AI
A public API written in Python using the Flask web framework to determine the direction of a road sign using AI

python-public-API This repository is a public API for solving the problem of the final of the AIIJC competition. The task is to create an AI for the c

Owner
Dimitar Rangelov
Electrical and Electronics student
Dimitar Rangelov
A boilerplate Flask API for a Fullstack Project with some additional packages and configuration prebuilt. ⚙

Flask Boilerplate to quickly get started with production grade flask application with some additional packages and configuration prebuilt.

Yasser Tahiri 32 Dec 24, 2022
The source code to the Midnight project

MidnightSniper Started: 24/08/2021 Ended: 24/10/2021 What? This is the source code to a project developed to snipe minecraft names Why release? The ad

Kami 2 Dec 3, 2021
REST API framework designed for human beings

Eve Eve is an open source Python REST API framework designed for human beings. It allows to effortlessly build and deploy highly customizable, fully f

eve 6.6k Jan 7, 2023
Python AsyncIO data API to manage billions of resources

Introduction Please read the detailed docs This is the working project of the next generation Guillotina server based on asyncio. Dependencies Python

Plone Foundation 183 Nov 15, 2022
Restful API framework wrapped around MongoEngine

Flask-MongoRest A Restful API framework wrapped around MongoEngine. Setup from flask import Flask from flask_mongoengine import MongoEngine from flask

Close 525 Jan 1, 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
Fully featured framework for fast, easy and documented API development with Flask

Flask RestPlus IMPORTANT NOTICE: This project has been forked to Flask-RESTX and will be maintained by by the python-restx organization. Flask-RESTPlu

Axel H. 2.7k Jan 4, 2023
Flask-Potion is a RESTful API framework for Flask and SQLAlchemy, Peewee or MongoEngine

Flask-Potion Description Flask-Potion is a powerful Flask extension for building RESTful JSON APIs. Potion features include validation, model resource

DTU Biosustain 491 Dec 8, 2022
Restful API framework wrapped around MongoEngine

Flask-MongoRest A Restful API framework wrapped around MongoEngine. Setup from flask import Flask from flask_mongoengine import MongoEngine from flask

Close 505 Feb 11, 2021
REST API framework designed for human beings

Eve Eve is an open source Python REST API framework designed for human beings. It allows to effortlessly build and deploy highly customizable, fully f

eve 6.3k Feb 17, 2021