Skip to main content

Posts

Showing posts from May, 2019

How to Install MongoDB on Debian 9 and enable remort access and authentication

MongoDB is a free and open-source NoSQL document database with the scalability and flexibility with the querying and indexing. This post will assist you with the installation process of MongoDB, manage its service, enable remote access and securing MongoDB. Note: Platform Support MongoDB only provides packages for 64-bit builds of Debian 8 and 9. See Supported Platforms for more information.The mongodb-org package is officially maintained and supported by MongoDB Inc. and kept up-to-date with the most recent MongoDB releases. This installation procedure uses the mongodb-org package a.k.a the official MongoDB repo. Step 1 — Installing MongoD make sure the curl command is installed so that we can use it to add the MongoDB signing key if you don't have curl installed, install it by running the following command:- apt install curl Import the public key used by the package management system. curl https://www.mongodb.org/static/pgp/server-4.0.asc | apt-key add -

How to Install Latest Nodejs, NPM & Yarn on Debian

Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine.Node is designed to build scalable network applications. Latest version node.js ppa is maintaining on its official website.In this post, I'll work you through on how to get started with Node.js on a Debian 9 server. Step 1 – Add Node.js PPA ( personal package archive ) To work with a more recent version of Node.js, you can add the PPA   maintained by NodeSource. This will have more up-to-date versions of Node.js than the official Debian repositories, We first need to install the curl if not installed already, which you will use to access the PPA    apt install curl Step 2 – Install Node.js on Debian Now that the pre request is out of our way , let's install the PPA in order to get access to its contents. Let's use curl to retrieve the installation script for your preferred version, note that Latest LTS Version: 10.16.0 (includes npm 6.9.0) is recommended for most users, while th

Publishing your Django project to github

On this post I will work you through the process of  deploying you app! to the  external service we'll be using  GitHub which is a code hosting service. Deploying is the process of publishing your application on the Internet so people can finally go and see your app. :) Git is a very popular "version control system" used by a lot of programmers. This software can track changes to files over time so that you can recall specific versions later. A bit like the "track changes" feature in word processor programs (e.g., Microsoft Word or LibreOffice Writer), but much more powerful.   Installing Git: Debian  apt install git Git tracks changes to a particular set of files in what's called a code repository (or "repo" for short). Let's start one for our project. Open up your console and run these commands, to make sure your on the project-level directory. find out your current working directory pwd        #find out your current w

django user authentication how to login, logout and Register

This post will demonstrate the necessary step's that you will need to follow when you want to build  authentication system with you Django framework using the built-in user authentication system . You can get the code of this project on github Start with clean work space where Django app is going to live  mkdir news-wire cd news-wire Time to setup virtual eviroment, install django and kickoff the project python3 -m venv venv source venv/bin/activate pip3 install Django django-admin startproject news_art House keeping mv news_art/manage.py ./ mv news_art/news_art/* news_art/ rm -r news_art/news_art/ nano news_art/settings.py ALLOWED_HOSTS = [ '*' ] ---------- We want to acsses our app from anywhere Django automatically installs the auth app when a new project is created. This can be reveled in the settings.py under INSTALLED_APPS and you can see auth is one of several built-in apps Django has installed. INSTALLED_APPS = [     'd

How to Install PostgreSQL on debian stretch in oder to use it with your Django application and allow remote connection

In this guide, we'll demonstrate how to install and configure PostgreSQL to use with your Django applications. We will install the necessary software, create database credentials for our application, and then start and configure a Django project to use this backend. We will start by  install the database software and the associated libraries required to interact with them. This guide assumes that you allready have a working Django project. Step 1 – Prerequsities apt-get install python3-pip python3-dev libpq-dev postgresql postgresql-contrib Step 2 – Connect to PostgreSQL After installing the PostgreSQL database server by default, it creates a user ‘postgres’ with role ‘postgres’. It also creates a system account with the same name ‘postgres’. So to connect to postgres server, login to your system as user postgres and connect database. su - postgres You should now be in a shell session for the postgres user. Log into a Postgres session by typing: 

How to connect django project with Mysql database

This article will guide you through the set up process of the Django project  with connections to a MySQL database.So that app's installed on this project they can use MySQL database instead of the default sqlite3 database. Prerequisites:   You must have python installed within you environment,  MySQL must be installed and running With the prerequisites taken care off and our Django development environment set up, we can move on to integration/inner-workings. Step 1 You will need to navigate to where you want your django project to live cd  django mkdir django_projects cd django_projects python3 -m venv venv     # create Python virtual environment source venv/bin/activate  #  activate your Python virtual environment pip3 install Django #  install Django within the virtual environment django-admin startproject news_art # creates the project Note: Since Django creates extra directory I usually like to clean things up a bit, this is not necessary but