Source code for Profile REST API

Overview

PROJECT PROFILE REST API

Creating local development server:

We will create a local development server that can run and test our API as we build it. We are going to be creating a development server using a tool called Vagrant. Vagrant allows you to define the type of server you need for the project as a vagrant file and store this file with the source code of our project. You can create a new vagrant file by using the vagrant CLI tool.

vagrant init ubuntu/bionic64

It initializes our project with a new vagrant file and it bases it on the ubuntu bionic 64 base image. These images are publicly available in the vagrant catalog box.

vagrant up

what this will do is it will download the base image that we've specified in our vagrant file and then it will use VirtualBox to create a new virtual machine and then run our provisioning script when it starts the machine.

vagrant ssh

once the vagrant box has been started we can then connect to the vagrant server by using the vagrant SSH command. Since our box is a completely different isolated box on our machine so it's a guest operating system, we need to connect to it using SSH.

exit

To disconnect from the machine simply type exit and this will take you outside of the machine back onto your local machine.

when you connect to the machine and any command that you run in the terminal while you're connected to the machine will be ran on the guest operating system or the development server instead of your local machine.

Synchronizing the development server with project directory:

For Synchronizing the development server with project directory you need to first connect to vagrant server. Once you connect to vagrant server type:

cd /Vagrant

This will switch you to vagrant directory on our server. Now everything in this vagrant directory is synchronized with everything in our project folder. This synchronization works both ways from the server to our host and form our host to the server.

Python virtual enviroment:

To create a python virtual environment go to the vagrant directory and use python venv command:

python -m venv ~/env

using ~ will create python virtual environment in the home directory of the your vagrant server (which is not synchronized with local machine) opposed to the vagrant folder which is synchronized with our local machine. The way virtual environment works you need to activate and deactivate them. So when you're activated on a virtual environment all of the dependencies that you run in the python application will be pulled from the virtual environment instead of the base operating system. To activate virtual environment:

source ~/env/bin/activate

To switch off from virtual environment type:

deactivate

Installing required packages:

To install the required packages which is django and djangorestframework for our project first create requirements.txt file and then edit the file as follow: django== djangorestframework== save the file.

touch requirements.txt

To install the requirements make sure that you are in vagrant directory and virtual environment is activated. Now type:

pip install -r requirements.txt

-r stands for requirements.

Creating Django project and application:

To create a django project we will use django command line tool - django-admin.

django-admin.py startproject profiles_project .

To create a django application

python manage.py startapp profiles_api

Enabling the application:

You need to go to settings file for your django project and find "INSTALLED_APPS" block, this is where we need to list all of the apps that you need to use for your project. These are the following apps you need to add:

'rest_framework',
'rest_framework.authtoken',
'porfiles_api',

Start Django development web server for testing:

You can start the django development server, first make sure you are using vagrant box and inside the vagrant directory and virtual enviroment is turned on. Now use:

python manage.py runserver 0.0.0.0:8000

"python manage.py" It asks the django to start running development web server and this "0.0.0.0" means make it available on all network adapters on our development server and this ":8000" says start it in port 8000 so we can access it via port 8000. Now go to browser and type in search bar 127.0.0.1:8000 to check the that the server is up and running.

A program that automates the boring parts of completing the Daily accounting spreadsheet at Taos Ski Valley

TSV_Daily_App A program that automates the boring parts of completing the Daily accounting spreadsheet at my old job. To see how it works you will nee

Devin Beck 2 Jan 01, 2022
Análise de dados abertos do programa Taxigov.

Análise de dados do Taxigov Este repositório contém os cadernos Jupyter usados no projeto de análise de dados do Taxigov. Conjunto de dados O conjunto

Augusto Herrmann 1 Jan 10, 2022
Just another Shiny and Greninja-ash killing preventor for Myuu

Myuu-Anti-Shiny-Discord-Bot Why I made it? Since, I was legit fed up of NebbyBot's lag (not criticising it), I decided to make my own but in python an

5 Nov 12, 2022
asyncio client for Deta Cloud

aiodeta Unofficial client for Deta Clound Install pip install aiodeta Supported functionality Deta Base Deta Drive Decorator for cron tasks Examples i

Andrii Leitsius 19 Feb 14, 2022
A discord self bot that replies to messages using cleverbot

cleverbot-discord-self A discord self bot that replies to messages using cleverbot Bot will respond to DMs and channels in the channels list. Need to

0 Jan 11, 2022
A python api to get info on covid-19

A python api to get info on covid-19

roof 2 Sep 18, 2022
Twitter for Python!

Tweepy: Twitter for Python! Installation The easiest way to install the latest version from PyPI is by using pip: pip install tweepy You can also use

9.4k Jan 07, 2023
One version package to rule them all, One version package to find them, One version package to bring them all, and in the darkness bind them.

AwesomeVersion One version package to rule them all, One version package to find them, One version package to bring them all, and in the darkness bind

Joakim Sørensen 39 Dec 31, 2022
Fastest Pancakeswap Sniper BOT TORNADO CASH 2022-V1 (MAC WINDOWS ANDROID LINUX)

Fastest Pancakeswap Sniper BOT TORNADO CASH 2022-V1 (MAC WINDOWS ANDROID LINUX) ⭐️ AUTO BUY TOKEN ON LAUNCH AFTER ADD LIQUIDITY ⭐️ ⭐️ Support Uniswap

Crypto Trader 7 Jan 31, 2022
Using a Gameboy emulator and making it into a DIscord bot !

Gameboy-Discord Using a Gameboy emulator and making it into a Discord bot ! Im not the best at doing this, and i suck at coding so its completely unde

7 Oct 18, 2022
A Discord bot made by QwertyIsCoding

QwertyBot QwertyBot A Discord bot made by QwertyIsCoding Explore the docs » View Demo . Report Bug . Request Feature About The Project This Discord bo

4 Oct 08, 2022
Simple Telegram Bot for generating BalckPearl BBCode Templates

blackpearl-bbcode-bot Simple Telegram Bot for generating BlackPearl BBCode Templates Written in Pyrogram Features - 🎉 IMDB Info fetching from files -

D. Luffy 5 Oct 19, 2022
A Really Simple and Advanced Google Colab NoteBook to Setup and start using Rclone on Google Colab easily.

Rclone on Google Colab (Advanced!) 🔥 1.Setup and Start using Rclone on Google Colab and Create/Edit/View and delete your Rclone config file and keep

Dr.Caduceus 14 May 24, 2022
Go-cqhttp Plugin for EFB QQ Slave.

efb-qq-plugin-go-cqhttp efb-qq-plugin-go-cqhttp 是 efb-qq-slave 的插件,需要配合 efb-qq-slave 使用,使用前请先阅读 efb-qq-slave 的文档。

XYenon 26 Dec 11, 2022
Robocord is a bot created for the Pycord community.

Robocord is a bot created for the community of the Pycord Server. Just a bot created for Pycord Server. You can start pull requests, I will check it and if its good I will add it to the bot. 👍

Bruce 7 Jun 26, 2022
AutomaTik is an automation system for MikroTik devices with simplicity and security in mind.

AutomaTik Installation AutomaTik is an automation system for MikroTik devices with simplicity and security in mind. Winbox is the main tool for MikroT

Osman Kazdal 4 Dec 05, 2022
This bot can stream audio or video files and urls in telegram voice chats :)

Voice Chat Streamer This bot can stream audio or video files and urls in telegram voice chats :) 🎯 Follow me and star this repo for more telegram bot

Anjana Madu 63 Dec 25, 2022
Una herramienta para transmitir mensajes automáticamente a múltiples grupos de chat

chat-broadcast Una herramienta para transmitir mensajes automáticamente a múltiples grupos de chat Setup Librerías Necesitas Python 3 con la librería

Seguimos 2 Jan 09, 2022
=>|<= the MsgRoom bot for Windows 96

=|= bot A MsgRoom bot in Python 3 for Windows96.net. The bot joins as =|=, if parameter name_lasts is not true and default_name is =|=. The full

Larry Holst 2 Jun 07, 2022
A telegram mirror bot with an integrated RSS feed reader.

About What is this repo? This is a slightly modified fork which includes some extra features & memes added to my liking. How's this different from the

11 May 15, 2022