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

Linux Today – Ubuntu 19.04 “Disco Dingo” Daily Build ISOs Now Available to Download

Nov 02, 2018, 08:00

Dubbed the “Disco Dingo,” Ubuntu 19.04 will be released next year on April 18, 2019, and will be supported for nine months, until July 2020. Its development cycle started on October 25, 2018, with the toolchain upload, and the first daily build ISO images are already available to testers. Of course, these are based on the previous release, Ubuntu 18.10 (Cosmic Cuttlefish), which was released earlier last month on October 18, so don’t expect them to have any new features or enhancements, nor to look any different than the Ubuntu 18.10 live images.

Source

Download TurnKey Drupal 8 Live CD 15.2

TurnKey Drupal 8 Live CD is a freely distributed and open source operating system based on the highly acclaimed Debian GNU/Linux distribution and built around the powerful Drupal 8 software. It is designed from the ground up to act as an appliance for deploying dedicated Drupal servers.

Drupal is a highly modular opensource content management platform that can support a variety of websites ranging from personal blogs, corporate brochures and large community-driven websites. The appliance comes with all of the upstream Drupal configurations, which are installed in /var/www/drupal8.

This special TurnKey edition includes a wide range of popular Drupal 7 modules and dependencies, which are installed by default in /var/www/drupal7/sites/all/modules. Among them, we can mention Panels, Date, Backup and Migrate, Link, Devel, Email, Drush, Token, Ckeditor, as well as Jquery_ui.

Furthermore, the Imce, Rules, Recaptcha, Advanced_help, PathAuto, Google Analytics, GlobalRedirect, Lightbox2, FiveStar, Tagadelic, Webform, Admin menu, and Logintoboggan modules are also included in this TurnKey Drupal appliance.

In addition, it features out-of-the-box support for secure connections using the latest SSL implementation, the phpMyAdmin software for easy management of MySQL databases, a Postfix mail transfer agent for sending emails to users, and Webmin modules for configuring Postfix, Apache, PHP and MySQL.

Users can download this special Drupal 8 appliance as Live CD ISO images, supporting both 32- and 64-bit architectures, as well as ready-to-use virtual machine images for the OpenStack, OpenNode, OpenVZ, OVF and Xen virtualization technologies.

While the default username for the Webmin, MySQL, phpMyAdmin and SSH components is root, the default Drupal 7 username is admin. During the first boot configuration process, users will be able to add new passwords to these pre-defined accounts.

Don’t forget to note the IP addresses and ports of the active services (SSH, SFTP, Webmin, phpMyAdmin and Web Shell). A Drupal 6 Live CD appliance is also available for download on Softpedia.

Source

How to Use Ubuntu Snap Packages

When running Linux, snap is one of the most powerful features you can enjoy. It allows running the same app over multiple platforms without needing to change the code of the program the slightest bit. That’s why you can also call snap packages as universal apps for the Linux platform. Ubuntu is one of the most popular Linux distros for its simplicity and usability. Let’s check out on using snap packages on Ubuntu.

Snap packages are managed by the snap core, a powerful app manager with tons of powerful features. It allows running any snap package on any platform. There are tons of apps available as snap packages. Snap also makes the work of developers a lot easier. The devs only have to develop the snap packages and forget about making the app inter-compatible. Managing snap packages is also very easy. Just run a simple command to install/uninstall apps. No need to worry about updating the app as the “core” will always keep everything up-to-date.

Source

Download Bitnami AbanteCart Stack Linux 1.2.13-1

Bitnami AbanteCart Stack is a multiplatform and freely distributed software project that has been designed from the ground up to help users who know nothing about installing a database or web server, with the installation and hosting of the AbanteCart shopping cart web-based application on desktop computers and laptops.

What is AbanteCart?

AbanteCart is an open source e-commerce, shopping cart system that allows you to create a powerful website for selling products online in minutes, without too much effort. Key features include support for both tangible and digital products, SEO-friendly URLs, product ratings, product reviews, support for multiple currencies, support for multiple languages, flexible layouts, support for a wide range of payment gateways, as well as support for mobile phones and tablets.

Installing Bitnami AbanteCart Stack

Bitnami AbanteCart Stack is distributed mainly as native installers, which have been tested on both 32-bit and 64-bit (recommended) hardware platforms, designed with BitRock’s cross-platform installer tool.

To install AbanteCart on your personal computer, you will have to download the package that corresponds to your computer’s hardware architecture, run it and follow the instructions displayed on the screen.

Host AbanteCart in the cloud

In addition to install AbanteCart on your personal computer, you can also host it in the cloud, thanks to Bitnami’s pre-built cloud images for the Amazon EC2 and Windows Azure cloud hosting providers.

AbanteCart virtual appliance and Docker container

Besides the pre-build cloud images and native installers, Bitnami also offers a virtual appliance for the AbanteCart application, allowing the user to virtualize it on the VMware ESX, ESXi and Oracle VirtualBox virtualization software. A AbanteCart Docker container will also be available for download on the project’s homepage.

The Bitnami AbanteCart Module

Users who have the Bitnami LAMP, MAMP or WAMP stacks installed can skip this project and download the Bitnami AbanteCart Module software, which allows them to deploy the AbanteCart application on their PCs without having to install its runtime dependencies.

Source

Install Visual Studio Code on Ubuntu

A code editor is one of the most important tools a developer has to keep in hand all the time. There are tons of available code editors on the internet. Visual Studio Code is an open-source code editor from Microsoft with tons of advanced and powerful features. Visual Studio Code is a lightweight yet extremely powerful source code editor. It’s available on all the major platforms – Windows, macOS, and Linux. By default, the editor comes up with support for JavaScript, Noje.js, and TypeScript. There are a number of available extensions to enable support for other popular programming languages like C++, C#, Python, Java, PHP, Go etc. Are you thinking to start programming, or looking for an advanced code editor? Let’s get started with Visual Studio Code!

The app is very simple to install. For Ubuntu platform, it’s even easier to enjoy Visual Studio Code.

  • DEB package

Get the latest DEB package of Visual Studio Code.

After the download is complete, run the following commands in a terminal –

sudo dpkg -i code_1.28.2-1539735992_amd64.deb
sudo apt install -f

  • Snap package

Visual Studio Code is also available as a snap package. Check out Visual Studio Code on Snapcraft store.

Run the following command in a terminal –

sudo snap install vscode –classic

Using Visual Studio Code

Once the installation is complete, it’s time to code with Visual Studio Code!

Here’s a demo code from HTML5 Test Page on GitHub.

The interface is dark with charming code highlighting.

Do you need additional extensions? Go to File >> Preferences >> Extensions or press the shortcut “Ctrl + Shift + X”.

For example, here’s the C/C++ extension. Simply click the “Install” button.

Voila! The extension is installed!

Need to change the view? Don’t worry! Visual Studio Code comes up with a number of available color themes. Go to File >> Preferences >> Color Theme or use the shortcut “Ctrl + K + T”.

Enjoy your coding with Visual Studio Code!

Source

Programming puzzle game God is a Cube: Programming Robot Cubes is now in Early Access, win a copy

God is a Cube: Programming Robot Cubes [Steam] is a programming puzzle game currently in Early Access with Linux support, it’s actually quite good and we have a few copies to give away.

Inspired by the likes of SpaceChem, Lightbot, Human Resource Machine and the Redstone from Minecraft it’s made mostly by one developer, Marc Kruzik, who emailed in to let us know about the recent EA release.

About:

God is a Cube: Programming Robot Cubes is a programming puzzle game, where you control robot cubes with Artificial Intelligence made of simple symbols. You start with just one robot cube, then you learn how to manage conditions, then get access to tens of robots to build bridges and space pyramids.

Current Features:

  • 100 levels with open ended solutions
  • 10 chapters with their own difficulty curve – if you are stuck, just start another chapter and discover something new!
  • Secret solutions for every level and a whole secret campaign
  • 20 creative mini cutscenes and several big cutscenes to show you the world
  • A complete level editor, with image cards to share your levels

You can find it right now on Steam I think it’s well worth a look with some really interesting puzzles already.

Also, we have five copies of the base game and the “Advanced Features” DLC pack. If you want to try your luck, here’s what you have to do:

  • Draw your best picture of a scary Cube (Halloween theme)
  • Post it in the comments after uploading to your favourite image host
  • Wait until Friday 2nd November where the competition closes at 8PM UTC

Source

Download Bitnami Akeneo Stack Linux 2.3.13-0

Bitnami Akeneo Stack is a freely distributed and multiplatform graphical installer that greatly simplifies the installation and hosting of the Akeneo web-based application on desktop computers and laptops. It is distributed as native installers for GNU/Linux and Mac OS X systems, as well as cloud images, a virtual appliance, and a Docker container.

What is Akeneo?

Akeneo is an open source web-based application that has been designed from the offset to perform as a Product Information Management (PIM) system, the perfect tool for retailers who are looking for profitable solutions to their multichannel needs.

Installing Bitnami Akeneo Stack

Users will be able to install the Akeneo software on their personal computers using the pre-built binary packages provided by Bitnami in the .run file format. Both 32-bit and 64-bit hardware architectures are supported at this time.

To install Akeneo on your GNU/Linux distribution, download the package that corresponds to your computer’s hardware arch, make the file executable, double click it and follow the instructions displayed on the screen.

Run Akeneo in the cloud

Thanks to Bitnami, users can run the Akeneo application in the cloud with their own hosting providers or by using the pre-built cloud images designed for either the Amazon EC2 or Windows Azure cloud hosting providers.

Virtualize Akeneo or run the Docker container

In addition to installing Akeneo on personal computers or run it in the cloud, users will be able to virtualize it, as Bitnami provides a virtual appliance based on the latest LTS release of the Ubuntu Linux distribution and designed for the VMware ESX, ESXi and Orracle VirtualBox virtualization software. An Akeneo Docker container will also be available for download on the project’s homepage.

The Bitnami Akeneo Module

Besides the Bitnami Akeneo Stack product reviewed here, Bitnami offers a simpler solution of deploying the Akeneo application on personal computers, on top of an existing LAMP or MAMP stack. Bitnami Akeneo Stack is available for download for free on Softpedia!

Source

Linux, KDE Plasma 5, Qt and Nomad Desktop

Icon

Nitrux is a Linux distribution based on Ubuntu suitable for laptops and desktop computers. Nitrux provides all the benefits of the Ubuntu operating system combined with a focus on portable, redistributable application formats like AppImages. Nitrux uses the LTS branch of Ubuntu as a basis using only the core system and then slowly building up to ensure a clean user experience. Nitrux is suitable for newcomers to Linux as well as *nix experienced users. Nitrux uses KDE Plasma 5 and KDE Applications; we also use our in-house software suite Nomad Desktop adding to the user experience. This sounds very similar to Elementary OS, but instead of Gnome and Gtk+-oriented, it’s built around Qt and KDE technologies. I like distributions that try to do something more interesting than being just another random Gnome or KDE distribution, and I especially like how the open source Linux community seems to be focusing more and more on polish, design, and simplicity lately. Very welcome additions to the Linux world.

Source

Download Bitnami Artifactory Stack Linux 6.5.2-0

Bitnami Artifactory Stack a freely distributed and cross-platform software project that offers an easy-to-install and easy-to-use distribution of the Artifactory binary repository manager application, as well as of its runtime dependencies, on GNU/Linux operating systems.

What is Artifactory?

Artifactory is an open source, free, platform-independent and enterprise-ready binary repository manager for Ivy, Maven, Gradle modules, etc., supporting remote proxying and hosting of artifacts.

Installing Bitnami Artifactory Stack

Bitnami’s native installers were built using the BitRock InstallBuilder tool and are available for download on the GNU/Linux, Microsoft Windows and Mac OS X operating systems, supporting 32-bit and 64-bit hardware platforms.

To install the Artifactory application and all of its runtime dependencies on your desktop computer or laptop, you will have to download the package that corresponds to your PC’s arch (32-bit or 64-bit), run it and follow the instructions displayed on the screen.

Host Artifactory in the cloud

Thanks to Bitnami, you’ll be able to host the Artifactory application in the cloud with your own hosting platform or by using a pre-built cloud image for the Windows Azure and Amazon EC2 cloud hosting providers.

Virtualize Artifactory on VirtualBox and VMware

In addition to installing Artifactory on your personal computer or run it in the cloud, you can virtualize it, thanks to Bitnami virtual appliance based on the latest LTS (Long Term Support) release of Ubuntu Linux and designed to be deployed on the VMware ESX, ESXi or VirtualBox virtualization software.

The Bitnami Artifactory Module and Docker container

For those of you who have a Bitnami LAMP (Linux, Apache, MySQL and PHP) Stack, Bitnami MAMP (Mac, Apache, MySQL and PHP) Stack or Bitnami WAMP (Windows, Apache, MySQL or PHP) Stack, you can download the Bitnami Artifactory Module product from Softpedia, free of charge. Additionally, an Artifactory Docker container will also be available for download on the project’s website.

Source

WP2Social Auto Publish Powered By : XYZScripts.com