How CSG Decreased Audit Times by 80% Through Automation

When it comes to audits, many organizations face a dilemma: how to decrease the time and effort spent while improving results? In preparation for an annual PCI audit, Carter McHugh, Executive Director of Agile Architecture at CSG International, decided to partner with Chef Software to automate their audit processes. As a result, CSG reduced audit time by 80% while improving their compliance with PCI requirements.

Like all enterprises, CSG has many snowflake servers in their environments. These snowflakes had deviated and their state was unknown, but there was no way to stop the business and do the clean up of server builds. With the audit looming, Carter wanted to leverage Chef’s continuous compliance capabilities while:

  • Giving CSG’s multi-disciplinary management the visuals to see their audits running in production
  • Grouping results by different characteristics
  • Taking stock on what CSG had in place today
  • Building a maintainable database of information that anyone – technical or not – could easily access

The creation of ACT

Carter set out to build the Asset Compliance Tracker (“ACT”). While Chef Automate continuously measured nodes for compliance to CSG’s audit specifications, ACT could take the aggregated compliance data from the Chef Automate platform and combine it with their business logic for actionable reports, like:

  • An executive score card
  • PCI compliance over time
  • Application specific spread
  • PCI score per area director
  • Top offenders

This tool now provides extra reporting for CSG management teams. ACT augments Chef Automate, tags information and allows the end user to filter by owner, group, server, etc., and provides end users the visibility and data filters needed to complete their audits. (Watch Carter’s ChefConf 2018 presentation: Bid Farewell to “Compliance Theater” and Welcome Continuous Compliance)

Improve quality, reduce overhead

If you want to improve your audit quality and reduce your audit overhead, use Chef Automate to detect noncompliance, identify and prioritize issues, then quickly apply remediation across your entire fleet.

And now that CSG is open sourcing their tool, you can also connect Chef Automate’s compliance data to your business logic using ACT. Which directors have the most violations? Who are the top offenders over the past 24 hours? How does Chef Automate’s compliance data relate to your asset classifications? Go to GitHub and download ACT to find out! You can find the CSG ACT Tool at: http://bit.ly/csg-act

Learn more about Chef Automate for compliance audits: https://www.chef.io/solutions/compliance-audits/

Source

Best 10 Video Players for Linux

Many of us love to watch movies, music, TV series, etc. to take short break from daily routine work. Apart from that multimedia such as video can be used for information sharing about business, product ads, and many other works where digital media is at the heart of business marketing.

Ever wondered what could be a best video player for Linux which can match all your requirements, from playing decade old videos effortlessly to playing latest high definition videos in best available resolution? Well, I have got you all covered today, as I am going to enlighten you guys about the best 10 video players you can use on Ubuntu and other Linux distros.

On some occasions we face difficulty in playing videos shot on some mobile phones or tablet, but the video players listed below are tested with videos shot on different devices and in various video file formats. So let’s begin the in-depth analysis of best video players for Ubuntu.

When it comes to watching TV series, movies or any online content there is only one name comes to my mind i.e. VLC Media Player. Because it is the best and most popular video player available across number of platforms such as Windows, Linux, Android, iOS and many other operating system platforms.

Reason behind so much popularity of VLC is that it supports variety of audio and video formats which is not the case with other video players. For Linux, VLC supports playing content from DVD media and also it supports video file formats such as HVC, HEVC, MPEG and many other files supported on Linux.

Notable features in VLC includes, it supports playing .iso files that means you can play files from disk image directly. Also VLC provides plugin and add-on for popular web browsers such as Mozilla Firefox and Google Chrome.

Pros

  • Open Source
  • Highly Customizable
  • Built-in plugin to support subtitle download
  • VLM (VideoLAN Manager)

Cons

  • Not a music player (i.e. you can’t manage music libraries)

$ sudo add-apt-repository ppa:videolan/master-daily
$ sudo apt-get update
$ sudo apt-get install vlc qtwayland5

2. MPV Player

MPV Player is a drag and drop multimedia player for Linux as there is no option to add files within the players interface, you just need to drag and drop audio or video files to play them. Although you can access options such as Open With by just right clicking on title bar or by clicking on MPV Logo on the top left corner of the player window.

One thing I liked about this video player is that it handles all the video files really well doesn’t matter what file format you through at it and also plays 4K videos better as compared to other video players available for Linux.

Video output in MPV Player is based on OpenGL which ensures video scaling with popular high-quality algorithms, color management, HDR, frame timing and many more.

Pros

  • Open source
  • On screen control (with mouse movement)
  • Minimal user interface
  • Video integration with Firefox
  • YouTube integration

Cons

  • Player configuration is not as user friendly as it should be.

$ sudo add-apt-repository ppa:mc3man/mpv-tests
$ sudo apt-get update
$ sudo apt-get install –y mpv

3. Kodi Media Center

Formerly known as Xbox Media Center (XBMC), Kodi is an open-source and cross-platform media player. It is one of the most popular and most used media players after VLC on Ubuntu and other Linux distros. Kodi was initially developed for first generation of Xbox gaming console and then slowly ported to personal computers running various operating system platforms such as Windows, Android and Linux.

Kodi is not only for playing video but you can also play music, podcasts and video games in both online and offline modes on it. During my usage, I tested Kodi with audio file formats such as MP3, MP2 and MIDI while video file formats such as HEVC, HVC, and MPEG and I have to admit all the files were played effortlessly.

Pros

  • Open Source
  • Flexible
  • Slick User Interface
  • Unlimited support for add-ons and extensions
  • Live TV support

Cons

  • Lags a bit on systems with minimal hardware resources.

$ sudo add-apt-repository ppa:team-xbmc/ppa
$ sudo apt-get update
$ sudo apt-get install –y kodi

4. SM Player

SM Player is an open-source and cross-platform video player which is also available for Ubuntu and other Linux distros with full fledge support. Basically SM Player is a graphical front-end to MPlayer and its forks which come bundled with many Linux distros.

Just like VLC, it also supports playing YouTube videos directly from its player thanks to its dedicated codec for YouTube. Apart from this, SM player supports majority video file formats which includes AVI, MP4, MKV, MPEG, H.264 and other widely used video and audio formats. I have tried playing a 4K video, it was not as smooth as I would have liked.

This player also offers some advanced features such as video and audio features, video equalizer, audio adjustment and many more.

Pros

  • Easy to use user interface
  • Highly customizable
  • Chromecast support (via web interface)
  • Several skins and icon themes
  • Support for subtitle download

Cons

  • No 4K video support

$ sudo add-apt-repository ppa:rvm/smplayer
$ sudo apt-get update
$ sudo apt-get install smplayer smplayer-themes smplayer-skins

5. Banshee Media Player

Known as Sonance until 2005, Banshee is an open-source and cross-platform media player which is available for Windows, Mac OS, Ubuntu and other Linux distros. Banshee supports almost all the modern world audio and video formats.

It is a feature rich media player with features on offers such as purchase music from Amazon, smart shuffle, podcasts, sync mobile phones, multimedia key support, audio equalizer, iPod manager and many others.

Pros

  • Intuitive user interface
  • Library management
  • Support for add-ons and extensions
  • fm support

Cons

  • Stability issue
  • Struggles handling large libraries

$ sudo add-apt-repository ppa:banshee-team/ppa
$ sudo apt-get update
$ sudo apt-get install –y banshee

6. ExMPlayer

ExMPlayer is another fork and graphical front-end of MPlayer featuring in this article. This players is not only meant to playing video files but with its advanced features you can download videos, convert audio files, extract audio from video files and cut audio and video files without compromising there quality.

ExMPlayer is lightweight media player but offers handful of features such as 3D video playback, seekview for thumbnails, audio and video filters, video equalizer, volume booster, movie animator and many more. Apart from this it supports almost all the audio and video formats.

Pros

  • Lightweight user interface
  • Highly configurable
  • Thumbnail seeking
  • Subtitle search

Cons

  • Stability issues

$ sudo add-apt-repository ppa:exmplayer-dev/exmplayer
$ sudo apt-get update
$ sudo apt-get install exmplayer

7. Bomi Media Player

Based on MPV Player, Bomi is another highly configurable video player on my list. Bomi (Formerly known as CMPlayer) is an easy-to-use but powerful multimedia player. It comes with simple user interface and you can configure it using preferences menu.

Bomi can play audio and video files in majority of file formats available today and it offers various features such as unlimited playback history, automatic playlist generation, enhanced subtitle handling, hardware acceleration, and many other features to boost overall user experience.

If you’re running Linux on minimum hardware resources then Bomi is the perfect media player for you as it works smoothly on systems running on minimal hardware resources.

Pros

  • Easy-to-use user interface
  • Lightweight

Cons

  • Lags a bit while playing some high quality videos.

$ sudo add-apt-repository ppa:darklin20/bomi
$ sudo apt-get update
$ sudo apt-get install bomi

8. GNOME MPlayer

MPlayer is a cross-platform media player from GNOME which available for various operating system platforms such as Windows, Mac OS, Ubuntu and other Linux distros. MPlayer ships-in as a default media player with various Linux distros and supports various audio and video file formats such as MPEG, H.263, MKV, MJPEG, MP3, etc.

MPlayer is a lightweight media player but offers some really decent features such as X video extension, support for DVD and MKV, framebuffer, VESA, DirectX, and many more.

Pros

  • Easy-to-use user interface
  • Keyboard shortcuts

Cons

  • Not reliable

$ sudo add-apt-repository ppa:gilir/lubuntu
$ sudo apt-get update
$ sudo apt-get install gnome-mplayer

9. Deepin Movie

Deepin Movie is a lightweight and easy-to-use video player developed by Deepin Technology. It is available for Ubuntu and various Linux distros such as Arch Linux, LinuxMint, etc.

It is a simple video player with various features such as minimalist user interface with black and white themes, several playback modes with full customization support, channel switch, track selection, smart match, subtitle sync, burst screenshot and freeze frame.

Pros

  • Easy-to-use user interface
  • Lightweight

Cons

  • Lack of support for some video file formats.

$ sudo apt-add-repository ppa:noobslab/deepin-sc
$ sudo apt-get update
$ sudo apt-get install deepin-media-player

10. Dragon Player

Dragon Player is a simple multimedia player from KDE, it focuses more on simplicity rather than features. So it could be great media player for user having minimal hardware resources and less storage space. It has a simple user interface which lets you play all your media effortlessly.

Still it offers some features such as video resume capability, automatic subtitle sync, and support for CDs and DVDs, various video and audio file format support, etc.

Pros

  • User friendly
  • Subtitle sync

Cons

  • Struggles handling high quality video files.

$ sudo apt-get install dragonplayer

So these are the best 10 video players you should try on Ubuntu and other Linux distros. All the video players listed here are tested on Ubuntu 18.04 and they will work well on other Linux distros also. If you have anything to share or have some queries then feel free to reach us at @LinuxHint and @SwapTirthakar.

Source

oOo: Ascension, a very unique puzzle racing game adds Linux support and it’s very cool

oOo: Ascension from Kenny Creanor and Extra Mile Studios is one of the more unique indie games I’ve tested recently and it’s rather good. They provided me a copy to test and after putting some time into it, I’ve really quite enjoyed it.

After chatting to the developer, helping them figure out an issue in the Linux build it has arrived officially today. It’s also lovely to see a special mention—very cool and “Enjoy the rage, Linux users!”, you devil! It’s a strange game, it’s equal parts a puzzle as it is a racing game. Each level gives you a new maze, which you race through to find the finish as quickly as you can.

It’s a real test of your reflexes at times, with some sections being really quite tricky. Not just because you need to swing yourself around corners but some of them offer up unique challenges like moving walls to crush you. There’s 90 levels too, so it will keep you going for quite a while.

Initially, I thought “Hey! I can do this, no problem. Moving walls? Not an issue!” and then it quickly evolves into “Why are there spinning blades? Oh no the walls are closing in and something’s chasing me oh hell!” and panic quickly sets in. The challenge certainly does increase as you progress through it. Some of the sections made me really sit at the edge of my seat and give it my absolute focus. The level design is really quite slick and it does look awesome travelling across a sphere.

It has a local multiplayer mode to race with or against people, online leaderboards to see how much you suck and all this wrapped up in a pleasing neon visual style make it great overall. The leaderboards feature was a bit confusing, which the developer cleared up for me. You get to see a leaderboard when you finish each sector (a set of levels), instead of it having a leaderboard for each level which Steam apparently wouldn’t allow. If you want to view them outside the game, you can do so here.

For those who don’t have people to race against, when you go back to previous levels you get to race against your own ghost, so there’s quite a bit on offer. It works perfectly with the Steam Controller too, so another tick for it.

Find it on Steam.

Source

CPod: An Open Source, Cross-platform Podcast App

Last updated November 5, 2018 By John Paul Leave a Comment

 

Podcasts are a great way to be entertained and informed. In fact, I listen to about ten different podcasts covering technology, mysteries, history, and comedy. Of course, Linux podcasts are also on this list.

Today, we will take a look at a simple cross-platform application for handling your podcasts.


Recommended podcasts and podcast search

The Application

CPod is the creation of Zack Guard (z————-). It is an Election app, which gives it the ability to run on the largest operating systems (Linux, Windows, Mac OS).

Trivia: CPod was originally named Cumulonimbus.

The majority of the application is taken up by two large panels to display content and options. A small bar along the left side of the screen gives you access to the different parts of the application. The different sections of CPod include Home, Queue, Subscriptions, Explore and Settings.

cpod settingsSettings

Features of CPod

Here is a list of features that CPod has to offer:

  • Simple, clean design
  • Available on the top computer platforms
  • Available as a Snap
  • Search iTunes’ podcast directory
  • Download and play episodes without downloading
  • View podcast information and episode
  • Search for an individual episode of a podcast
  • Dark mode
  • Change playback speed
  • Keyboard shortcuts
  • Sync your podcast subscriptions with gpodder.net
  • Import and export subscriptions
  • Sort subscriptions based on length, date, download status, and play progress
  • Auto-fetch new episodes on application startup
  • Multiple language support

search option in cpod applicationSearching for ZFS episode

Experiencing CPod on Linux

I ended up installing CPod on two systems: ArchLabs and Windows. There are two versions of CPod in the Arch User Repository. However, they are both out of date, one is version 1.14.0 and the other was 1.22.6. The most recent version of CPod is 1.27.0. Because of the version difference between ArchLabs and Windows, I had to different experiences. For this article, I will focus on 1.27.0, since that is the most current and has the most features.

Right out of the gate, I was able to find most of my favorite podcasts. I was able to add the ones that were not on the iTunes’ list by pasting in the URL for the RSS feed.

It was also very easy to find a particular episode of a podcast. for example, I was recently looking for an episode of Late Night Linux where they were talking about ZFS. I clicked on the podcast, typed “ZFS” in the search box and found it.

I quickly discovered that the easiest way to play a bunch of podcast episodes was to add them to the queue. Once they are in the queue, you can either stream them or download them. You can also reorder them by dragging and dropping. As each episode played, it displayed a visualization of the sound wave, along with the episode summary.

Installating CPod

On GitHub, you can download an AppImage or Deb file for Linux, a .exe file for Windows or a .dmg file for Mac OS.

You can also install CPod as a Snap. All you need to do is use the following command:

sudo snap install cpod

Like I said earlier, the Arch User Repository version of CPod is old. I already messaged one of the packagers. If you use Arch (or an Arch-based distro), I would recommend doing the same.

cpod for Linux pidcastsPlaying one of my favorite podcasts

Final Thoughts

Overall, I liked CPod. It was nice looking and simple to use. In fact, I like the original name (Cumulonimbus) better, but it is a bit of a mouthful.

I just had two problems with the application. First, I wish that the ratings were available for each podcast. Second, the menus that allow you to sort episodes based on length, date, download status, and play progress don’t work when the dork mode is turned on.

Have you ever used CPod? If not, what is your favorite podcast app? What are some of your favorite podcasts? Let us know in the comments below.

Source

Amazon WorkMail Introduces Outbound Mail Flow Rules

You can now add outbound mail flow rules for your Amazon WorkMail organization. Outbound mail flow rules allow you to perform simple control actions like blocking sending of a message or routing messages to a custom appliance via the SMTP protocol. This adds extensibility to the WorkMail product by allowing you to control sending or delegate handling of outbound e-mail to 3rd party or custom appliances. For example, you can now route to appliances for data leak protection, email encryption, IP reputation management, and archiving. Furthermore, you can specify conditions for each outbound mail flow rule based on the domain and email addresses of the message sender and recipients. The rule will then only run when the sender and recipients match the rule’s condition. This way you can route traffic differently depending on who is sending and who they are sending to. This control is especially useful if you are routing to appliances with a per-user cost model, so you can route to only the users who need it. Finally, this feature complements Amazon WorkMail’s interoperability with Microsoft Exchange by enabling customers who are transitioning from Exchange to WorkMail to route outbound email through their existing on-premises Exchange setup.

Like inbound mail flow rules, setting up outbound mail flow rules is easy with just a few quick steps in the Amazon WorkMail console. To get started, go to your Amazon WorkMail organization and click on Organization Settings. You can specify rules with the drop, bounce, or the SMTP routing actions, together with which sender and recipient email addresses or domains the rule should apply to.

Outbound mail flow rules are available today for Amazon WorkMail in all AWS Regions where Amazon WorkMail is offered. To learn more about Amazon WorkMail, or to start your trial, please visit Amazon WorkMail.

Source

How to Draw Arrows in GIMP

Drawing Arrows in GIMP used to be very easy. You were able to head to the plugin site and download a script that could handle all your arrow-based needs without an issue.

Recently, however, the GIMP registry has gone down, and trying to access the link now only results in a blank page. Unfortunately, a lot of tutorials are now linking directly to a dead website as a solution! If you have the need to draw arrows, never fear – there are other ways to achieve this goal.

Grabbing the Plugin via Mirrors

Thankfully, the original plugin is still available at other sources. It’s a very useful plugin, so it’s worth hunting down to solve your arrow-based problems. There’s a forum post that has the file — you need to click the download link at the bottom of the post instead of the top one to get it. Alternatively, you can download a copy of the arrow.scm file from our Dropbox folder.

If you’ve never installed a GIMP plugin, it can be a little confusing as to what to do with the .scm file. It’s very easy to install. First, head to your GIMP folder. On Windows, this is typically in Program Files; for Mac, it can be found in Applications; Linux users may need to do some hunting, but it can typically be found in your home catalogue folder. Once you find it, go to the “lib” folder, then “gimp,” then the folder with the current GIMP version number as the name, and then plug-ins. Drop the .scm file in here to install the plugin.

gimp-arrows-directory

If you’re having issues finding the folder, you can see where GIMP keeps its plugins in the software itself. Open GIMP, then click Edit, then Preferences. Scroll down to the category Folders, expand it if it’s not already expanded, and click Plug-ins to see where GIMP keeps them.

gimp-arrows-paths

To use the tool, first make a path. This is done by clicking the Path icon in the toolbox, then clicking on two spots on the canvas.

gimp-arrows-path

A path will be formed between them. Click on Tools, then the arrow plugin name.

gimp-arrows-tool

A lot of options will pop up. You can tweak the length of the arrow wings and the brush thickness here. “Use first path point as arrow head?” will place the head where you first clicked. If you want the arrow to be pointing toward the second point you clicked, untick this box. You can even make a double-headed arrow here if you like! Once you’re done, click OK.

gimp-arrows-settings

The arrow will be drawn as per your parameters.

gimp-arrows-result

Using Arrow Brushes

If you’re not a fan of fiddling with paths and settings, you can use brushes instead. These use the paintbrush tool and are “painted on” as a static image. Arrow brushes usually come in one of two styles: a single arrow head with multiple directions or a variety of arrows that all point one way and need to be manually rotated. You can find brushes anywhere, but GimpHelp and Softpedia have some pretty good ones.

In your GIMP folder go to Share, gimp, the version number, then brushes. Take the folder the brushes came in (or make a new one if it didn’t come in one), and place it here among the other folders.

In GIMP select the paintbrush tool. On the right pane in the brushes panel, select the arrow you want to use.

gimp-arrows-brushes

Click once on the canvas, as if you were using a stamp. This will paint an arrow onto the canvas. You can tweak its color by changing the brush color and clicking on the canvas again.

Make Your Own Brush

If you can draw a good arrow but don’t want to keep redrawing it every time you want a new one, why not make it a brush? Once it’s made into a brush, you can then stamp it wherever you’d like by following the above instructions.

First, start by drawing your perfect arrow. Crop the image so it’s as close to the arrow as possible. You can do this by drawing a selection box around it, then clicking “Image -> Crop to Selection.” Once cropped, click File, Export As, then export it as a .gbr file. You may need to manually add “.gbr” if you can’t find the option in the export images dropdown box.

gimp-arrows-save

Once you’ve exported your .gbr file, you can install and use your new arrow just like a regular brush as covered above.

Keep on the Straight and Arrow

With the GIMP registry going away, a lot of tutorials on how to draw arrows in GIMP are now pointing to dead links. Thankfully, there are other ways to get the tool back, as well as alternate means of drawing arrows.

Which one works for you? Let us know below!

Is this article useful?

Source

Microsoft working on Sysinternals for Linux

Windows Subsystem for Linux is one of Microsoft’s success stories and has allowed developers to complete tasks using their Linux tools as easily from Windows as from a Linux desktop.

Microsoft is, however, also looking to make it easy for those used to Windows tools to be productive in the Linux environment and to help that cause Microsoft is porting their Sysinternals tools to Linux, starting with ProcDump for Linux, as revealed by Microsoft developer David Fowler.

ProcDump is a Linux reimagining of the classic ProcDump tool from the Sysinternals suite of tools for Windows. ProcDump provides a convenient way for Linux developers to create core dumps of their application based on performance triggers.

ProcDump in use

The tool currently supports Red Hat Enterprise Linux / CentOS 7, Fedora 26, Mageia 6 and Ubuntu 14.04 LTS, with other versions being tested.

Microsoft is currently working on ProcMon, according to Mario Hewardt is a Principal Developer Premier Field Engineer at Microsoft and author of Advanced Windows Debugging and Advanced .NET Debugging.

Check out ProcDump at Github here.

Via WalkingCat

Source

Amazon Rekognition Announces More Accurate Object and Scene Detection, Can Now Locate Objects in Your Images

Posted On: Nov 2, 2018

Amazon Rekognition is a deep learning-based image and video analysis service that can identify objects, people, text, scenes, and activities, as well as detect unsafe content. Today we are announcing a major update to object and scene detection, also known as label detection. Label detection identifies objects and scenes in images. Until now, Amazon Rekognition could identify the presence of an object in an image, but couldn’t find where the object is within the image. Amazon Rekognition can now specify the location of common objects such as dogs, people and cars in an image by returning object bounding boxes, and comes with significantly improved accuracy for all existing object and scene labels across a variety of use cases. In addition, customers can use the bounding box information to infer how many of each object (“3 dogs”) occur in the image, and the relationship between objects (“dog on a couch”). These new enhancements all come at no additional cost.

Customers in news, sports, and social media companies all face rapidly growing image libraries. They are looking for ways to quickly search and filter such content. Human-provided metadata works to a degree for such applications, but that approach has limited accuracy and scalability. With Amazon Rekognition object and scene detection, customers can automatically index vast image libraries to make them searchable.

“GuruShots connects and inspires millions of photo enthusiasts around the world, reinventing the way people interact with their photos to make the experience more fun, exciting and rewarding. Previously, our end users were manually tagging images to get better insights. To provide a better customer experience, we’ve been looking for scalable ways to automatically tag uploaded images for further analysis. Using Amazon Rekognition, we now tag each user uploaded image and use the generated metadata to detect trends, improve search results, and adjust content to suit user preferences. This new streamlined process resulted in a 40% increase in user retention and a 50% increase in engagement.” – Eran Hazout, Founder and CTO, GuruShots

Now with object bounding boxes, customers can count how many of each object appears in an image (“3 dogs”), and can also determine which objects are prominent or important compared to others by using the position coordinates and bounding box size relative to image dimensions. This information can be used to make decisions on user preferences. For example, someone who has lot of photos where ‘Car’ is prominent is likely to be an automotive enthusiast. Some customers will also use bounding boxes to further process their images, for example to blur certain objects like weapons. Bounding box information can be further used to search for specific types of images (images with multiple dogs, or prominent dogs, versus one dog in the background). To make asset search even more powerful, Amazon Rekognition now returns parent labels in a hierarchical list, for example, the label ‘Dog’ has the parents ‘Mammal’, ‘Canine’ and ‘Animal’. This metadata allows customers to group labels related by parent-child relationships to improve categorization and filtering.

Bounding boxes, hierarchical metadata, and improved label detection accuracy are available today in all regions where Amazon Rekognition Image is offered. Label improvements for Amazon Rekognition Video are coming soon. You can get started today via the Rekognition Console or by downloading the latest AWS SDK. For more information please refer to the documentation.

Source

How to Install Django on CentOS 7

Django is a free and open source high-level Python web framework designed to help developers build secure, scalable and maintainable web applications.

There are different methods to install Django, depending on your needs. It can be installed system-wide or in a Python virtual environment using pip. Django packages are also included in the CentOS repositories and can be installed using the yum package manager but they are outdated.

In this tutorial, we will be installing and configuring the latest stable version of Django on a CentOS 7 machine inside a Python virtual environment.

The main purpose of Python virtual environments is to create an isolated environment for different Python projects. This way you can have multiple different Django environments on a single computer and install a specific version of a module on a per project basis without worrying that it will affect your other Django installations. If you install Django into the global environment then you can install only one Django version on your computer.

Installing Django on CentOS 7

The following sections provide a step by step instructions about how to install Django in a Python virtual environment on CentOS 7.

1. Installing Python 3

We’ll be installing Python 3.6 from the Software Collections (SCL) repositories.

CentOS 7 ships with Python 2.7.5 which is a critical part of the CentOS base system. SCL will allow you to install newer versions of python 3.x alongside the default python v2.7.5 so that system tools such as yum will continue to work properly.

Start by enabling SCL by installing the CentOS SCL release file which is included in the CentOS extras repository:

sudo yum install centos-release-scl

Once the repository is enabled install Python 3.6 with the following command:

sudo yum install rh-python36

Once Python 3.6 is installed we are ready to create a virtual environment for our Django application.

2. Creating Virtual Environment

Starting from Python 3.6, the recommended way to create a virtual environment is to use the venv module.

Navigate to the directory where you would like to store your Python 3 virtual environments. It can be your home directory or any other directory where your user has read and write permissions.

Create a new directory for your Django application and cd into it:

mkdir my_django_app
cd my_django_app

To access Python 3.6 you need to launch a new shell instance using the scl tool:

scl enable rh-python36 bash

Run the following command to create a new virtual environment:

The command above creates a directory called venv, which contains a copy of the Python binary, the Pip package manager, the standard Python library and other supporting files. You can use any name you want for the virtual environment.

To start using this virtual environment, you need to activate it by running the activate script:

Once activated, the virtual environment’s bin directory will be added at the beginning of the $PATH variable. Also your shell’s prompt will change and it will show the name of the virtual environment you’re currently using. In our case that is venv:

3. Installing Django

Now that the virtual environment is activated, you can use the Python package manager pip to install Django:

Within the virtual environment, you can use the command pip instead of pip3 and python instead of python3.

To verify the installation use the following command which will print the Django version:

python -m django –version

At the time of writing this article the latest official Django version is 2.1.2

Your Django version may differ from the version shown here.

4. Creating a Django Project

To create a new django project named mydjangoapp use the django-admin command-line utility:

django-admin startproject mydjangoapp

The command above will create a mydjangoapp directory in your current directory.

mydjangoapp/
|– manage.py
`– mydjangoapp
|– __init__.py
|– settings.py
|– urls.py
`– wsgi.py

Inside that directory you will find the main script for managing projects named manage.py and another directory including database configuration, and django and application-specific settings.

Let’s migrate the database and create an administrative user.

Start by navigating to the mydjangoapp directory:

By default Django uses SQLite database. For production applications, you can use PostgreSQL, MariaDB, Oracle or MySQL Database.

Run the following command to migrate the database:

The output will look something like the following:

Operations to perform:
Apply all migrations: admin, auth, contenttypes, sessions
Running migrations:
Applying contenttypes.0001_initial… OK
Applying auth.0001_initial… OK
Applying admin.0001_initial… OK
Applying admin.0002_logentry_remove_auto_add… OK
Applying admin.0003_logentry_add_action_flag_choices… OK
Applying contenttypes.0002_remove_content_type_name… OK
Applying auth.0002_alter_permission_name_max_length… OK
Applying auth.0003_alter_user_email_max_length… OK
Applying auth.0004_alter_user_username_opts… OK
Applying auth.0005_alter_user_last_login_null… OK
Applying auth.0006_require_contenttypes_0002… OK
Applying auth.0007_alter_validators_add_error_messages… OK
Applying auth.0008_alter_user_username_max_length… OK
Applying auth.0009_alter_user_last_name_max_length… OK
Applying sessions.0001_initial… OK

Once the database is migrated, create an administrative user so that you can use the Django admin interface:

python manage.py createsuperuser

The command will prompt you for a username, an email address, and a password for your administrative user.

Username (leave blank to use ‘linuxize’): admin
Email address: [email protected]
Password:
Password (again):
Superuser created successfully.

5. Testing the Development Server

Start the development web server using the manage.py script followed by the runserver option:

python manage.py runserver

You’ll see the following output:

Performing system checks…

System check identified no issues (0 silenced).
October 20, 2018 – 11:16:28
Django version 2.1.2, using settings ‘mydjangoapp.settings’
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

If you installed Django on a virtual machine and you want to access Django development server then you’ll need to edit the settings.py file add the server IP address inside the ALLOWED_HOSTS list.

Open http://127.0.0.1:8000 in your web browser and you will be presented with the default Django landing page:

You can access the Django admin interface, by adding /admin/ to the end of the URL (http://127.0.0.1:8000/admin/). This will take you to the admin login screen:

Enter your username and password and you will be redirected to the Django admin page:

To stop the development server type CTRL-C in your terminal.

6. Deactivating the Virtual Environment

Once you are done with your work, deactivate the environment, by typing deactivate and you will return to your normal shell.

Conclusion

You have learned how to create a Python virtual environment and install Django on your CentOS 7 machine. To create additional Django development environments repeat the steps we outlined in this tutorial.

If you are new to Django, visit the Django documentation page and learn how to develop your first Django app.

If you are facing any problem, feel free to leave a comment.

Source

WP2Social Auto Publish Powered By : XYZScripts.com