background preloader

Setting up Django with Nginx, Gunicorn, virtualenv, supervisor and PostgreSQL - Michał Karzyński

Setting up Django with Nginx, Gunicorn, virtualenv, supervisor and PostgreSQL - Michał Karzyński
Django is an efficient, versatile and dynamically evolving web application development framework. When Django initially gained popularity, the recommended setup for running Django applications was based around Apache with mod_wsgi. The art of running Django advanced and these days the recommended configuration is more efficient and resilient, but also more complex and includes such tools as: Nginx, Gunicorn, virtualenv, supervisord and PostgreSQL. In this text I will explain how to combine all of these components into a Django server running on Linux. Prerequisites I assume you have a server available on which you have root privileges. If you don’t have a server to play with, I would recommend the inexpensive VPS servers offered by Digital Ocean. I’m also assuming you configured your DNS to point a domain at the server’s IP. Update your system Let’s get started by making sure our system is up to date. $ sudo aptitude update $ sudo aptitude upgrade PostgreSQL Application user Gunicorn Nginx Related:  ProgrammingStuffreads - Techdjango

Setting up an asynchronous task queue for Django using Celery and Redis - Michał Karzyński Celery is a powerful, production-ready asynchronous job queue, which allows you to run time-consuming Python functions in the background. A Celery powered application can respond to user requests quickly, while long-running tasks are passed onto the queue. In this article we will demonstrate how to add Celery to a Django application using Redis. Celery uses a broker to pass messages between your application and Celery worker processes. Prerequisites In this article we will add Celery to a Django application running in a Python virtualenv. This article was tested on a server running Debian 7, so everything should also work on an Ubuntu server or other Debian-based distribution. Update your system Let’s get started by making sure your system is up to date. $ sudo aptitude update $ sudo aptitude upgrade Install Redis The first piece of software we’ll install is Redis. $ sudo aptitude install redis-server $ redis-server --version Redis server version 2.4.14 (00000000:0) $ redis-cli ping PONG

Get A $100,000 Paying Engineering Job At Google By Mastering These 11 Tech Skills » TechWorm Who doesn’t want to work for a top tech company like Google? Not only is Google one of the top-most empathetic company in the world but it also pays it employees handsomely well. However, it is not that easy to get hired by the search giant. And it is no surprise. While interns here start at $70,000 to $90,000 salaries, the software engineers get $118,000 and senior software engineers earn an average of $152,985. You need skills and talent to get a job in Google. Thankfully for would-be Googlers, the Google in Education team has released a list of skills that they want to see in potential engineers. “Having a solid foundation in Computer Science is important in being a successful Software Engineer,” the company says. Here are the skills Google wants its tech talent to master, complete with online resources to get you started: 1. Try and get through an introduction to CS course, like the ones from Coursera or Udacity. 2. 3. 4. Add Java Script, HTML, CSS, and Ruby to the list of your skills.

Introduction | Django Girls Tutorial Deploy Django on Apache with Virtualenv and mod_wsgi | The Code Ship I have recently got into Django and built a small project with it which is this blog. Then came the time for me to deploy the project on an unmanaged VPS, the process went fine yet with a few problems here and there due to the lack of a definitive guide to deployment. So I ended up checking several sources to have everything work the way I wanted. In this post, I'll be sharing the whole process with you in detail and what will hopefully be helpful to the fellow newcomers. Prerequisites In this tutorial we will assume that we have a fresh Ubuntu server installation with Python already installed and nothing else. Installing Pip Pip is a tool for installing and managing Python packages,basically a replacement for easy_install, many Python developers should be already familiar with it and have it already. $ sudo apt-get install python-pip python-dev build-essential Then upgrade to latest version $ sudo pip install --upgrade pip Setting up virtualenv $ pip install virtualenvwrapper Upload files

The Twelve-Factor App Finally, Real-Time Django Is Here: Get Started with Django Channels | Heroku Today, we're thrilled to host Jacob Kaplan-Moss. Jacob's a former Herokai and long-time core contributor to Django, and he's here to share an in-depth look at something that he believes will define the future of the framework. When Django was created, over ten years ago, the web was a less complicated place. The majority of web pages were static. The web circa 2016 is significantly more powerful. In this new world, Django shows its age. This doesn’t work with WebSockets! Thus: Django Channels. As you can see, Channels introduces some new concepts to Django: Channels are essentially task queues: messages get pushed onto the channel by producers, and then given to one of the consumers listening on that channel. Right now, Channels is available as a stand-alone app that works with Django 1.9. I believe that Channels will be an incredible imporant addition to Django: they allow Django to move smoothly into this new age of web development. First steps — it’s still Django Where we’re going 1.

Alex Raichev > Blog > Adding Celery with RabbitMQ to a Django project on Webfaction I recently added Celery with RabbitMQ to one of my Django projects on Webfaction. Along the way, i read lots of documentation, encountered difficulties, and got advice from the helpful staff at Webfaction. What worked for me in the end are the instructions below. May they might work for you too and save you some pain! I'll assume that you've already added Celery with RabbitMQ to your Django project in your development environment (encapsulated within a virtual environment) and have that working as desired. Now, let's add Celery with RabbitMQ to your production environment (encapsulated within a virtual environment) on Webfaction. Preparation Ssh into your Webfaction server. Install and configure Erlang From your Webfaction control panel, create a new application with App category: Custom, App type: Custom app (listening on port). Test Erlang Install and configure RabbitMQ Test RabbitMQ Install and configure Celery Test Celery That's it. Todo

Getting Started with Word2Vec – SocialTrendly Tech Blog Word2vec is a group of related models that are used to produce word embeddings. These models are shallow, two-layer neural networks that are trained to reconstruct linguistic contexts of words. Word2vec takes as its input a large corpus of text and produces a high-dimensional space (typically of several hundred dimensions), with each unique word in the corpusbeing assigned a corresponding vector in the space. Word vectors are positioned in the vector space such that words that share common contexts in the corpus are located in close proximity to one another in the space.[1] — Word2vec was created by a team of researchers led by Tomas Mikolov at Google. I will just give pointers to a few pages that I found really useful and spent good time finding them (and making them work) Getting Started Tutorials Radim Řehůřek has very easy getting started guides here: Continuous Learning She modified her branches since then and it works for rm_online branch only.