fabiochiu/medium-articles huggingface dataset:
Setup Django with Postgres.app on macOS for Django tutorials
By: Garrett Sweeney
Tags: Postgres, Tutorial, Postgresql, Django, Macos

Prerequisite: Python3 installed. Open up your terminal and verify that python is installed:

$ python --version Python 3.7.8

If python is not recognized, install python from python.org.

Install django like so:

python -m pip install Django

Start a basic django project:

django-admin startproject mysite

Or, if django-admin doesn’t work, you can use:

python -m django startproject mysite

Next I’m going to install postgres on macos — https://www.postgresql.org/download/macosx/ there are a few options, but today I’m installing Postgres.app.

Download PostgresApp from https://postgresapp.com/downloads.html:

Drop it into your applications:

Open the app:

Click “Initialize” and view the databases — I’m going to use the garrettsweeney database below:

Configure path to use the command line tools:

sudo mkdir -p /etc/paths.d &&

echo /Applications/Postgres.app/Contents/Versions/latest/bin | sudo tee /etc/paths.d/postgresapp

Head over to your mysite/settings.py and find the # Database section. Update it to look like this, but update name and user to match your db:

DATABASES = {

'default': {

'ENGINE': 'django.db.backends.postgresql',

'NAME': 'garrettsweeney',

'USER': 'garrettsweeney',

'PASSWORD': '',

'HOST': 'localhost'

}

}

Note! You’ll probably want to move these secret values out of the settings.py when you configure to an actual backend.

Make sure you have postgres installed (I installed with brew install postgres) and then install psycopg2:

pip install psycopg2-binary

Now you should be able to migrate:

python manage.py migrate

And it should be successful, output something like this:

Garretts-MacBook-Pro:mysite garrettsweeney$ python manage.py migrate

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 auth.0010_alter_group_name_max_length... OK

Applying auth.0011_update_proxy_permissions... OK

Applying auth.0012_alter_user_first_name_max_length... OK

Applying sessions.0001_initial... OK

Head back over to the postgres app and double click your db.

A terminal should open. Running \dt will list the newly created relations!

And you’re set! Continue on with the terminal — https://docs.djangoproject.com/en/3.1/intro/tutorial02/.
Simple Honeypot For Django Admin. I think first it’s better to figure it…
By: Farzin Haque
Tags: Security, Honeypot, Django, Django Security, Django Admin

I think first it’s better to figure it out: what is Honeypot?

In simple words honeypot is a kind of trap to detect people who attempts at unauthorized access of some important part of our Information system like Admin panel.A Honeypot usually consists of data that appears to be a legitimate or important part of the site that seems to contain information or a resource of value to attackers, but actually, it is isolated and monitored and enables blocking or analyzing the attackers, like a copy of login admin panel that seems like a real Django Login Admin Panel but it’s not, and that is what we want to do here.

For this I’m going to use django-admin-honeypot library and for sending email to admins I’m using Mailtrap, you can use your Gmail too.

Initiating Django project:

python3 -m venv venv

source venv/bin/activate

pip install django

django-admin startproject myHoneypot

2. Installing django-admin-honeypot and migrate create superuser

pip install django-admin-honeypot

python manage.py migrate

python manage.py createsuperuser

3. Add admin_honeypot to INSTALLED_APPS in settings.py:

INSTALLED_APPS = [

...

'admin_honeypot',

...

]

4. Update urls.py :

from django.contrib import admin

from django.urls import path, include urlpatterns = [

path(‘admin-panel/’, admin.site.urls),

path(‘admin/’, include(‘admin_honeypot.urls’, namespace=’admin_honeypot’)),

]

Now my real admin panel path changed to admin-panel/ and admin/ is my honeypot path.

5. You can config your Django settings to send an email to admins for every unauthorized access for this purpose, this module use mail_admins() method.

For sending Email we need an email service you can use your Gmail but I’m going to use Mailtrap.

In settings.py :

# Admin's name and email to send email to them

ADMINS = (

(‘Farzin’, ‘myemail@gmail.com’),

) # You need this variable to be able to send email

EMAIL_BACKEND = ‘django.core.mail.backends.smtp.EmailBackend’ # Mailtrap, Gmail or your service email config

EMAIL_HOST = ‘smtp.mailtrap.io’

EMAIL_HOST_USER = ‘123234234asd’

EMAIL_HOST_PASSWORD = ‘1232343545asd’

EMAIL_PORT = ‘2525’

Mailtrap option Django email config

You can find Mailtrap configs for Django by opening Demo inbox im mail trap account and choosing Django from Integrations dropdown item.

5. run:

python manage.py runserver

and go to:

12.0.0.1:8000/admin

you will see admin login panel try to log in you will see something like this:

Notice: even if you try to login with super user, you will get this error, it’s because of security purpose.

now go to:

12.0.0.1:8000/admin-panel

and try to login in your panel you can see a new item like below:

If you click on Login attempts you can see all unauthorized attempts and for each of them you have this informations:

6. Now you can check your Mailtrap inbox and you have a surprise!

And that’s it.

Stay safe and secure & enjoy coding :)
Docker em projetos Django
By: Nélzio Sitoe
Tags: Mozambique, Docker Compose, Dockerfiles, Django, Docker

How To Install and Use Docker CE in Linux Mint 20

Docker is a platform that uses containers to create, manage and use applications. And what is a container? It can be…
Deploy a Production Django App With Elastic Beanstalk (Part 2)
By: Zack Petersen
Tags: Programming, Database, Django, AWS, Python

Setting up S3 — Static and Media Storage

Up to this point, we have a working Django app deployed on Elastic Beanstalk Amazon Linux 2. Congratulations! However, we still need to set up S3 so the site shows styles and we can upload images — which would be nice, considering it’s an image of the day app!

Create a group and user

First things first: We need to create an IAM user with programmatic access so our application can access the S3 bucket we’re creating next. Best practice here is to create a group with the appropriate policies attached and add a new user to the group. Note: I highly recommend creating a new user for the application’s S3 access. Using an admin user opens all kinds of security risks.

In the AWS services search bar, look for IAM. Navigate to IAM → Groups → Create New Group. Set the group name to something like “S3FullAccess” and go to the next step. Here, search for “S3” and select AmazonS3FullAccess . Click on the next step and create the group.

Now, we’ll navigate to “Users” and add a new user. Name the user whatever you want, I’ll go with “iotd-s3-access” and select “Programmatic Access.”

Click to permissions and add this user to the group we created. Click through and create the user.

After the user is created, you will get a success notification and be able to save the Access key ID and Secret access key. Important: if you don’t save these credentials here, you will not be able to see them again. You will have to delete this user and create a new one to get credentials again.

Download the .csv file with the credentials in it and head back over to the iotd project settings file. Add two new settings at the end of iotd/settings.py — we’re not going to add the keys, but instead references to them:

if 'AWS_ACCESS_KEY_ID' in os.environ:

AWS_ACCESS_KEY_ID = os.environ['AWS_ACCESS_KEY_ID']

AWS_SECRET_ACCESS_KEY = os.environ['AWS_SECRET_ACCESS_KEY']

Committing the actual keys in your settings file is a dangerous idea. It poses a security vulnerability if anyone were to gain access to your project’s code (GitHub or otherwise). Instead of keeping them in the settings file, we’re going to add them as environment variables and pull them into the settings file securely. Docs here.

Create a bucket

Before we get into environment variables, navigate to S3, and create a new bucket. Make sure to turn off the block public access. We’ll need the images stored here to be public to show them in the API and have access to them later on. Name your bucket whatever you want. I usually recommend enabling versioning, but this is optional. Click “Create Bucket” and we’re all set.
Django — Basic Page Setup. Django is a fantastic web framework…
Tags: Python Programming, Coding, Web Development, Django, Python

Django is a fantastic web framework that allows you to create an entire back-end with little limit to the size and complexity of the database involved.

The setup process is very straight-forward and can be implemented using the official guide here.

This small guide below will help you to understand the basics behind rendering a functional webpage (having the necessary components ‘click’ in the back-end).

You will need to have open the following to complete this:

urls.py (from main project directory) urls.py (which you will create in the app directory) views.py (app directory)

As part of the setup it is good practice to open the settings.py file and under ‘installed apps’ insert the name of your application here.
How to setup Apache with Gunicorn
By: Antonis Christofides
Tags: Gunicorn, Django, Apache

Many people seem to think that it’s either Apache+mod_wsgi or nginx+Gunicorn. However, Apache+gunicorn makes a great combination, and it’s usually much easier to configure than mod_wsgi.

All you need is to setup Gunicorn as explained in the Django documentation, enable Apache’s proxying with a2enmod proxy_http , and add this to your Apache VirtualHost block:



ProxyPass /media/ !

ProxyPass / ProxyPass /static/ !ProxyPass /media/ !ProxyPass / http://localhost:8000/

(You still need to specify Alias and <Directory> for the static and media files, in addition to the above.)

Apparently people are worried because of this warning in the Gunicorn documentation:

Although there are many HTTP proxies available, we strongly advise that you use Nginx. If you choose another proxy server you need to make sure that it buffers slow clients when you use default Gunicorn workers. Without this buffering Gunicorn will be easily susceptible to denial-of-service attacks.

This is not a problem with Apache; like nginx, it buffers slow clients alright.

In simplicity terms, the only upside of mod_wsgi is that Apache itself starts the WSGI server, whereas with Gunicorn you need to do this yourself. However, I find it easier to set up systemd or supervisor to automatically start Gunicorn than to configure mod_wsgi.

Related:
Ubuntu上使用Gunicorn + Nginx + SSL部署Django+Vue專案
By: 周子堯 Victor.Chou
Tags: Nginx, Ubuntu, Django, Gunicorn, Vuejs

套用SSL(HTTPS)

本篇採用 Let’s Encrypt 做為免費的簽證。

如何申請跟獲得簽證請參考 這篇教學，就不再多敘述。

P.S 需要注意的是，發送domain給 Let’s Encrypt 取得憑證失敗5次要等 1hr，當初一直失敗被鎖後等個一小時回來就成功了，不要問我為什麼我也不知道..

當你完成申請憑證後，以「Cancell 抗癌好夥伴」為例，我們希望使用者永遠都是連到具有https且去除www的網址，實際情況範例:

這時候竟可以透過Nginx來實現~ 開啟<projectname>.conf

sudo vim /etc/nginx/sites-available/<projectname>.conf 或是 sudo nano /etc/nginx/sites-available/<projectname>.conf

修改配置

# <projectname>.conf 配置

# 監聽port 80，並作轉網址

listen 80 default_server;

listen [::]:80 default_server;

server_name _;

return 301

} server {# 監聽port 80，並作轉網址listen 80 default_server;listen [::]:80 default_server;server_name _;return 301 https://cancell.tw$request_uri; server {

# 監聽port 443

listen 443 ssl http2 default_server;

listen [::]:443 ssl http2 default_server;

include snippets/ssl-cancell.tw.conf;

include snippets/ssl-params.conf;



location = /favicon.ico { access_log off; log_not_found off; } location /static/ {

# 指向django靜態資源

alias /home/ubuntu/<專案目錄>/static/;

} location /media/ {

# 指向django媒體資源

alias /home/ubuntu/<專案目錄>/media/;

}

include proxy_params;

proxy_pass

} location / {include proxy_params;proxy_pass http://unix:/run/gunicorn.sock; # 為了讓nginx可以讓外面連的到隱藏檔來完成認證

location ~ /\.well-known\/acme-challenge {

root /var/www/html;

allow all;

}

}

執行上面所提的 清除所有程序 與 重啟程序，恭喜你！！大功告成啦。

分享這麼多看似簡單，實際上當初與跟團隊大概花了兩周時間不斷嘗試才突破難關，今天把整個流程詳細紀錄，希望可以幫到有需要的人。
How Django static files work in production
By: Antonis Christofides
Tags: Django, Apache, Nginx

If you have trouble understanding STATIC_ROOT , STATIC_URL , collectstatic , and the web server’s configuration, it’s because some things are better said with pictures than with text. Here are the pictures. If you want them in PDF format, you can get them at the end of the post. Media files work similar, except that there is no collectstatic ; Django saves them directly in MEDIA_ROOT and the web server serves them from there.
Django จริงๆ แล้วทำงานยังไง? Part 1
By: Peerachai Deesongkram
Tags: Django, Python

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
แบ่งงานใหญ่ให้เป็นงานเล็ก ด้วย Python Celery
By: Peerachai Deesongkram
Tags: Django, Python, Celery

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
[번역][Django]Django Rest FrameWork는 무엇이며 왜 배워야 하는가
By: Iov Somnium
Tags: Django, Translate, Django Rest Framework

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
how to use Django
Tags: Python Programming, Django, Django Rest Framework

how to use django

Introduction :-

this blog introduces Python programmers to build websites using the Django library. You will build online websites using Django and those working websites are graded throughout courses . This blog is excellent preparation for using Django to build websites.

Why Django ?

With Django, you can take web applications from concept to launch in a matter of hours. Django takes care of much of the hassle of web development, so you can focus on writing your app without needing to update the wheel. It is a free and open source.

LEARN MORE ABOUT APPLYING FOR DJANGO

Amazing flexibility.

Companies, organizations and governments have used it to build all sorts of things — from content management systems to social media to computer science platforms.

for more about this article :- click here
Django’da Dinamik ModelForm Kullanımı
By: Furkan Zerman
Tags: Django, Forms, Development

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
INCOGNITO
Tags: Security, JavaScript, Js, Django, Machine Learning

JS + DJANGO + ML

We are using the VANILLA-JS, TESSERACT-JS, JAVASCRIPT , HTML , CSS , BOOTSTRAP on the front end .for fetching the image and text . We are converting image text by the help of TESSERACT , after that we use django for the backend . in which we call the machine learning algorithms . and NLP , NLTK , OpenCV , KERAS on the backend . in this we created our own DATASET and we take one dataset from the kaggle.

wesite link : https://incognito-ninja.herokuapp.com/

github code: https://github.com/savagecarol/incognito
I have used a lot Django and FastAPI for real-world projects in production and I really love both…
By: Eric Pascual
Tags: Python Programming, Fastapi, Orm, Django

I have used a lot Django and FastAPI for real-world projects in production and I really love both of them.

But I would mitigate your analysis when it comes to databases. Managing persisted models with SQLAlchemy is not as lean as with Django, especially with respect to migration. You’ll need one more external tool for this such as Alembic. And doing this we are more or less replicating what has repelled me from Flask for serious projects: piling heterogeneous tools and libraries for having the job done.

The main strength of Django is to provide a lot of things out of the box homogeneously and well-documented. You do not have to use them if you don’t need them, and you can even strip them from the default application structure, but they are there, ready to be added and serve.

Same for the admin: all applications dealing with databases I’ve developed have needed a back office at a moment (when not requested from the start). Why writing one (which you’ll have to do with FastAPI, hence adding Jinja2 or alike in the stack) when it’s there for free in Django, ready to be used and even customized for extreme edge cases?

After several experiments I finally came to this rule (which at least works for me): if it’s a pure API, I go with FastAPI, but if there is a database of any type in the mix, then Django is my buddy.

And don’t forget that API is not equal to REST. Both FastAPI and Django play very well with GraphQL too 😊
How to Create a Simple Django Web App With Python.
By: Bryan Dijkhuizen
Tags: Programming, Django, Python3, Python, Software Development

Getting Started With Django

Ideally, you have already installed Python on your device. If you have not yet done this, then you can go to Python’s official website to download the latest version. To check if you are running the latest version of Python, you can run the following command in your terminal/command line:

$ python

It would help if you ended up with something similar to this:

Python

[GCC 4.x] on linux

Type "help", "copyright", "credits" or "license" for more information.

>>>

To install Django, you need the Python package manager pip. You can download it on the PIP website. When you have a stable installation of pip on your device, you need to install Django by using the following command:

$ python -m pip install Django

Now Django will be installed to Python. To verify that you have installed Django successfully, open up the Python terminal and import Django:

$ Python

>>> import django

>>> print(django.get_version())

And as I am running version 3.1, I will get the following output:
How to Create a Django Project
By: Adhney Nawghare
Tags: Django, Website, Web Development

V. Running the Development Server

We’ll cd into tutorial directory, where you’ll find manage.py and a tutorial directory which is the main app of your Django Project.

In order to run our server, we’ll type a runserver command.

python manage.py runserver

This command serves the development server to the localhost at port 8000, which can be accessed by visiting http://127.0.0.1:8000.

Ignore the warning about unapplied database migrations, that’ll be removed when you’ll further create an app within the project with database necessities.

that’s all peeps…….
How to use ngrep to debug HTTP headers
By: Antonis Christofides
Tags: Ngrep, Http, Nginx, Django, Apache

You deploy Django with gunicorn. Your web server communicates with it with proxy_pass (nginx) or with ProxyPass (apache), together with several other directives that pass headers and so on. Your web site doesn’t work properly. Is the web server misconfigured, or is Django misbehaving? Here’s how to find out.

Install ngrep:

apt-get install ngrep

Now try this:

ngrep -W byline '' 'tcp port 80'

ngrep intercepts communications at port 80; that is, between the web server and the web browser, so whenever a request is made, you will be viewing the request and the response. Press Ctrl+C to stop ngrep.

The -W byline part has to do with how ngrep formats its output (try it without it to see the difference). The next argument, the empty string, tells ngrep to output all communication; if it were non-empty it would only show lines that match it (for example, if you try nginx -W byline ': ' 'tcp port 80' , it won’t catch much more than HTTP header lines).

If your web server has traffic, there is going to be much output. You want to intercept only requests from your own browser. In that case, use this:

ngrep -W byline '' 'tcp port 80 and host [your ip address]'

(An easy way to find your ip address is to type who -m --ips at the remote command prompt.)

Now, assuming that gunicorn is listening on port 8000, try this:

ngrep -W byline -d lo '' 'tcp port 8000'

Now you are intercepting the communication between the web server and gunicorn. The -d lo tells ngrep to intercept the local network interface (i.e. a virtual network device that connects the system to itself) instead of the external ethernet interface (i.e. the actual network device), which is what you want if gunicorn has been told --bind 127.0.0.1:8000 (the 127.0.0.1 is the local interface).

Unfortunately, in this case I don’t know any way to filter the output so that only the requests from your browser are allowed. On servers with little traffic I can sometimes start ngrep, make the request in my browser, and stop ngrep; if I repeat that a few times, I can often manage to catch only my request. If the server has much traffic, you need either to use a staging server, or, if you can afford the downtime and the risk of playing with a firewall on a production system, to temporarily filter out all requests but yours with a firewall.
How to set up a new Django project
By: Lewis Kori
Tags: API, Django, Tutorial, Python

How to set up a new Django project

This post is a continuation of the django multi-tenancy series. In this part, we’ll begin to implement the backend of the multitenant Django app. We’ll be setting up a Django project from scratch.

The project source code up until this point is available on the github setup branch.

The project’s final outcome can be explored using this live demo.

Installing project dependencies

For this project, we’ll need to have python 3+ installed. You can find the necessary steps in this digital ocean post. Next, we’ll need to make virtual environments for installing project dependencies.

Install virtualenv

pip install virtualenv

Create a new virtualenv

virtualenv yourenvname -p python3.8

Activate virtual environment

source yourenvname/bin/activate

Run this command within the directory the virtual environment was created in.

Once your virtual environment is activated, there’s a number of dependencies we’ll be needing for the project:

Django and the djangorestframework: for an extensive introduction on how to use these libraries, check out my previous post on building web apis with django.

Djoser: REST implementation of Django authentication system. The Djoser library provides a set of Django Rest Framework views and endpoints to handle basic actions such as registration, login, logout, password reset, and account activation

django-rest-framework-simplejwt: provides a JSON Web Token authentication backend for the Django REST Framework.

My previous post on setting up Django APIs with JWT authentication should get you started on what JWTs are and how to implement them in Django. 😃

The repository has a requirements.txt and you can mass install all the dependencies by running pip install -r requirements.txt

Curious on some of the popular dependencies I use with Django? This post has some handy tools and resources for python programmers.

To kick off the new Django project, run the following once you’ve activated the previously created virtual environment.

django-admin startproject budgeting

Now to start with the first app that we’ll require for the next section:

cd budgeting python manage.py startapp users

users will be our first app for this project and we'll put all the authentication logic here.

Next up, we’ll cover user authentication in a multi-tenant app powered by django.🤠

open to collaboration

I recently made a collaborations page on my website. Have an interesting project in mind or want to fill a part-time role?

You can now book a session with me directly from my site.
[Django Tip] Gunicorn Async Workers Showcase
By: Lu-Hsuan Chen
Tags: Asynchronous, Async, Django, Experience, Gunicorn

[Django Tip] Gunicorn Async Workers Showcase

Photo by Dominik Bednarz on Unsplash

Scenario

Recently, I have been working on a project using Django as an API server, and there is one special API which generates a file with arbitrary generating time and size. When calling this API, I always got a 502 error. In the beginning, I thought it might be the problem of timeout setting, so I changed the timeout settings of both Django and Apache (using as reverse proxy) to 300 seconds. However, I still received 502 error.

Then I started to investigate the cause and realized the meaning of worker setting of Gunicorn. After I altered the worker type from sync to asynchronous worker, this particular API call acts normally not only its responses time but also its execution speed.

In order to let both myself and others to realize the meaning of Gunicorn workers, I wrote this post as a reminder.

Types of Gunicorn workers

Gunicorn uses pre-fork worker model, which means it uses a central master process to manage a set of worker processes. By default, Gunicorn uses synchronous ( sync ) worker, but sync worker does not support persistence connections, which means you shouldn't do anything that takes vary amount of time just like this case. [1]

Suggest in Gunicorn [1], you can do one of the following solutions:

a buffering proxy asynchronous workers

For ease I chose asynchronous workers, and this solved the problem.

Conclusion

If your application will make a long blocking calls, e.g., external web services, you can consider switch to async workers.

Reference

[1] https://docs.gunicorn.org/en/stable/design.html#choosing-a-worker-type
Heroku Django Deploy Github Action CD CI
By: Tafadzwa L Nyamukapa
Tags: Ci Cd Pipeline, Heroku, Django, Github Actions, DevOps

A simple github action that automatically deploys Django app to heroku.

The github action can be found on github market place here.

The repo can be found here. I encourage and welcome all pull requests.

*You can checkout a You-tube Video Full Course here(How i created the Heroku django Deploy using Node js )

Getting Started

heroku-django-deploy uses three methods to deploy your Django app to heroku ie.

Deploy with git Deploy with Container Registry (Docker deploy) Deploy with Heroku Build Manifest (Docker deploy)

Unless you are using git make sure you have a Procfile or a Dockerfile or a heroku.yml in your project root directory together with the requirements.txt file.

1. Deploy with git

By default if you do not specify the deployment option it will use git or else alternatively specify the use_git: true option in the with tag. see example below.

2. Deploy with docker container registry

Make sure you specify the deployment option ie use_docker option. Also make sure you have a Procfile, Dockerfile, and requirements.txt files in your root project directory.

3. Deploy with heroku build manifest

Make sure you specify the deployment option ie use_build_manifest option. Also make sure you have a heroku.yml or Dockerfile, and requirements.txt files in your root project directory.

Options

The action has multiple options here is a list of options you can use under the with flag in your workflow:

Example

A full working example can be found under tests in the github repo here.

Pull Requests and Contributions

I Welcome and i encourage all Pull Requests. Lets make the repo big :)

Github repo here

Created and Maintained by

Author: Tafadzwa Lameck Nyamukapa :

Email: [tafadzwalnyamukapa@gmail.com]

Open for any colleboration and Remote Work!!

Happy Coding, Stay safe.

License

This project is licensed under the MIT License — see the LICENSE file for details
Django, Gunicorn, Systemd Errors
By: Derrick Gee
Tags: Programming, Coding, Web Development, Django, Python

Django, Gunicorn, Systemd Errors

Getting this error while trying to deploy a Django app? Check the logs with this command:

journalctl --unit=gunicorn | tail -n 100

With this command, you can see gunicorn trying to startup your Django app more clearly compared to sudo service gunicorn status .

If your systemd socket/service settings file ( /etc/systemd/system/* ) contains the setting EnvironmentFile , make sure to check the format of your env file. It cannot be the bash script format like this:

export MY_KEY=123

export MY_OTHER_KEY=aaa

Correct format:

MY_KEY=123

MY_OTHER_KEY=aaauld

If your gunicorn is active and running from sudo service gunicorn status , but your website still doesn’t show up. Try the following:

Make sure your ALLOWED_HOSTS in your Django project’s settings.py has the correct domain names:

# settings.py

ALLOWED_HOSTS = ["example.com", "www.example.com"]

If you are hosting with a domain of something like .dev or .page , those domains require HTTPS to even let you go to the IP address. It becomes a little circular if you are wanting to test your site on a port, as you need to enable HTTPS without testing to see if the site’s homepage works. But the homepage should be working if it works locally, and if gunicorn is throwing an access log of this sort when trying to ping your server’s IP:

"GET / HTTP/1.1" 301 0

code 400, message Bad HTTP/0.9 request type

You're accessing the development server over HTTPS, but it only supports HTTP.

All you need to do is use certbot to enable HTTPS before testing your homepage, which is pretty straightforward from their instructions. After running sudo certbot --your_webserver , or whatever the instructions gave for your specific specs. Your domain should be ready to test if no errors came up.
Deploy Django using UWSGI + Nginx in AWS Lightsail with Ubuntu 20.14 LTS
By: Aji Pratama
Tags: Deploy, Nginx, Lightsail, Django, AWS

Introduction

Amazon Lightsail is an interesting product of AWS Cloud. We can use VPS service, storage, and Networking with a very low budget start from $3.5 which is a good offer if we want to deploy Company Profile, CV, Portfolio site, starter Blog, or even MVP with an early-stage user with no many traffic yet.

Django is a powerful web framework for Python Programming language with so many great features and remembers that Django is released in 2005 which is until right now Django has 15 years old with so many product build, eg: Instagram, Pinterest, Spotify, etc. We can serve Django with UWSGI and Nginx as a reverse proxy to Deploy Django in production. And we will set up DNS for connecting with the domain name.

Goals

In this article, our goal is to deploy and set up a Django application for production-ready and can access the Internet using UWSGI Nginx in AWS Lightsail.

AWS Lightsail Instance

To prepare to create something in VPS AWS Lightsail, we need to create Instance first.

Login to AWS Lightsail Console, Choose Instance Location (for me is Singapore, but you can choose need to depend on your need/customer location), Instance Image (Linux), and OS (Ubuntu 20.04 LTS).

3. Choose Instance Plan and give Identify name, for me it’s important to make clear identify the name with the region, like this:

4. Add tags

5. Click Create Instance to release your instance, and VPS is almost ready

After click Create Instance, wait until AWS finish their system to create Instance, and we back to the Home console and will see disables style Instance like this:

It’s mean the VPS is not ready yet. But after a few seconds/minutes VPS will ready and looks active like this:

VPS is really ready. We can see on the top right Instance card have terminal symbol, it’s mean we can log in SSH on the web by click that, and the Web terminal will look like this:

We just create VPS. And after this, we will set up OS.
Who is Visible Hands for?. Visible Hands will bring together an…
By: Visible Hands
Tags: VC, Accelerator, Startup, Founders, Diversity In Tech

In Summer 2021, Visible Hands will bring together an inaugural cohort of exceptional individuals from across the U.S. to support them in finding co-founders, validating business ideas, and building transformational technology companies. Selected fellows will each receive an initial investment of $25,000 as well as the opportunity for an additional $150,000 investment at the end of the fellowship.

Who is eligible for this fellowship?

We are focused on investing in underrepresented talent who would make exceptional venture-backed entrepreneurs. This includes women, non-binary people, and Black, Latinx, and Indigenous American people.

We are seeking proven builders, technologists, industry experts, community leaders, and/or people who are looking to diverge from their current career path to build high-growth technology-driven businesses.

Visible Hands aims to support fellows at the earliest, most formative stages of company-building. Our fellows don’t need to enter the fellowship having anything built. In fact, they don’t even need to know exactly what they want to be building, or who they’ll be building it with. Fellows that do come in with specific ideas or early prototypes are still open to evolving them.

Our fellows must be committed to working full-time on building their startups throughout the course of the fellowship, which is why we provide an upfront investment of $25k to every fellow.

How will we assess candidates?

In our selection process, we will look for individuals who demonstrate the following traits:

Actionable Skills & Insights: Our fellows will have ‘inspired insights’ into a specific customer, problem, industry, or technology, and/or a strong skillset that gives them a competitive advantage to building and distributing their solution.

Our fellows will have ‘inspired insights’ into a specific customer, problem, industry, or technology, and/or a strong skillset that gives them a competitive advantage to building and distributing their solution. Resilience & Resource Magnetism: Our fellows can creatively work around the constraints of ambiguity and limited resources. They will be able to attract people, money, and other support to their venture, leaving a network of evangelists wherever they go.

Our fellows can creatively work around the constraints of ambiguity and limited resources. They will be able to attract people, money, and other support to their venture, leaving a network of evangelists wherever they go. Growth Mindset & Community Orientation: Our fellows demonstrate a strong spirit of camaraderie, actively seeking out ways to contribute to and learn from the cohort, staff, and broader Visible Hands community. They are collaborative and eager to receive and implement feedback.

Does this sound like you? Head over to our website to sign up for updates. We’ll be sure to keep you in the loop for when our applications open in Spring 2021.

Does this sound like someone you know? Please take a moment to nominate them through this form.
Imagining the Possible with Black Girls CODE & Netflix
By: Black Girls Code
Tags: Netflix, Jingle Jangle, Film, Diversity In Tech, Education

Black Girls CODE has teamed up with Netflix for the creation of the #PossiblePledge campaign.

“You can absolutely be what you can’t see! That’s what innovators and disruptors do.” — Kimberly Bryant, Founder & CEO, Black Girls CODE

For those who dare to dream. For those who challenge the status quo. For those who are determined to thrive in the fullness of their authentic selves in spaces where they don’t often see themselves reflected. For those who are brave and bold enough to tap into their power and achieve the impossible. As we near a New Year full of limitless possibilities, we’re empowering our #futuretechbosses to step into their greatness.

Black Girls CODE has teamed up with Netflix for the creation of the #PossiblePledge campaign; an initiative — inspired by the film Jingle Jangle: A Christmas Journey — designed to empower girls to bring their dreams to fruition. The #PossiblePledge is an ode to those who have broken barriers before us; using their legacies as guiding lights towards creating the future we want to see. It shows and reminds us that we can apply the #BlackGirlMagic displayed by Journey in the film into our everyday lives.

As part of the campaign, our Black Girls CODE tech divas in Los Angeles played a part in bringing the magic of the #PossiblePledge to life by participating in a short visual piece. The poignant words narrated in the video — which were penned by renowned multidisciplinary artist and founder of NuJas Nubia Yasin — captured the essence of the campaign. Our #futuretechbosses also had the opportunity to explore the magic behind the holiday film during a panel discussion featuring filmmakers David E. Talbert, Lyn Sisson-Talbert and VFX supervisor Brad Parker.

Check out this powerful video featuring some of our #futuretechbosses from Los Angeles.

As 2021 nears, we encourage you to explore the square root of possible and take the #PossiblePledge. Check out Black Girls CODE and Netflix’s #PossiblePledge Toolkit that features an array of custom badges and stickers to post on Instagram or Twitter as well as cell phone backgrounds. Don’t forget to watch the film Jingle Jangle: A Christmas Journey, only on Netflix!

We hope this campaign inspires you to believe in the beauty of your dreams!
Announcing the Graduates of We Tha Incubator Inaugural Cohort
By: Luis Martinez
Tags: Accelerator, Tech, Entrepreneurship, Startup, Diversity In Tech

“Obligation should not wake you up in the morning, opportunity should.”

― Luis Martinez, Founder & CEO We Tha Plug

On February 12, 2019, I had this crazy & delusional idea to host a meetup in a coffee shop during the Startup Grind Global Conference at the same time as the pub crawl & had 80 people show up.

From this I started We Tha Plug which works with Early-Stage Pan-African & Latinx founders and startup companies from Ideation to Pre-Seed with Christiana Russell as our Chief Operating Officer.

June 1, 2019, We had our first huge event: “We Tha Plug Day” where we have a Pitch Event for Black & Latinx Entrepreneurs and unexpectedly got press from it.

February 11, 2020, Hosted the 2nd We Tha Plug Meetup in Silicon Valley in the same coffee shop & had over 140 founders show up.

April 8 Launched our Online Community Platform to expand our reach with Pan-African & Latinx founders & investors globally. Currently, we have over 400 Founders & Investors throughout our platform on 3 Continents.

September 22, 2020, We Tha Incubator Cohort 1 Launched with some national press from publications like The Philadelphia Tribune.

Necessity is really the mother of all invention. We accomplished so much in such a short time (since June 2019). We were basically using what I've learned from Brant Cooper about Design Thinking & Lean Innovation to execute effectively in order to launch We Tha Incubator.

Our main reason for launching We Tha Incubator:

PROGRAMS ARE A VITAL PART OF REINFORCING LEARNING OBJECTIVES FROM ANY COMPANY/ORGANIZATION.
Creating Holiday Memories with Black Girls CODE & Zola
By: Black Girls Code
Tags: Holiday Season, Diversity, Black Girl Magic, Holidays, Diversity In Tech

“Memories are timeless treasures of the heart.”

The holiday season is all about the creation of memories. It’s a time when we celebrate the cultural traditions passed down from generation to generation and create new ones. Although 2020 has forced us to adapt to a new normal, Black Girls CODE has teamed up with Zola to keep the holiday spirit alive.

One thing that holds significance during the holiday season, is opening cards from those near and dear to us that encompass thoughtful messages and festive designs. As part of our partnership with the online retailer Zola, our #futuretechbosses tapped into the power of design and created an array of holiday cards which are featured on Zola’s website. In October, the company’s engineering team led an interactive virtual workshop for a select group of BGC tech divas between the ages of 9–14 and showed them how to add features to the holiday cards on the backend, such as fonts and colors. The workshop, while fun and exciting for our #futuretechbosses, also provided a window into the role of a product designer. Our girls were able to sprinkle their own “Black girl magic” on these holiday keepsakes which will reach families around the world.

As part of the initiative, from now through the end of the year, Zola is donating 10 percent of net Holiday Card sales to Black Girls CODE. “Today’s younger generation spends so much time on their mobile devices, but to someday work as an iOS or Android engineer or as a product designer is not always the first career path that comes to mind for many young women,” said Zola CEO and Co-Founder Shan-Lyn Ma. “We hope that we can help to illuminate all of the endless possibilities that these girls have in front of them, because they are the next generation of leaders.” Kimberly Bryant, Founder & CEO of Black Girls CODE, says the partnership will be “instrumental in increasing the accessibility to non-traditional STEM career paths for girls from underrepresented communities and ultimately generate pathways for Black girls to have a seat at the tech table.”

Join Black Girls CODE and Zola this holiday season in our mission to empower the next generation of innovators who will use technology as a means for change. Check out the collection of holiday cards and purchase yours before December 31.
Open Office Hours — the 1st Edition Story
By: Taryn Pieterse
Tags: Startupaus, Diversity In Tech, Venture Capital

Open Office Hours — the 1st Edition Story

Open Office Hours, which took place last week, brought together Australia’s most active technology investors with a diverse array of startups in a collective effort to close the funding gap for early-stage, and in particular, under-represented founders.

To say the response from the Australian startup community has exceeded our expectations would be a massive understatement.

When we first started planning the event, our initial hope was that 20 investors and 20 founders would connect and have a great experience that would open up pathways for broader funding for startups.

We were way off. The Australian community of founders and investors responded with such incredible passion and numbers that we expanded the program.

We ended up with 40 investors (from 30 VCs and angel groups) and 197 ambitious founder applicants, of whom 75 were selected. What better evidence of the need for such an initiative than this overwhelming response from both investors and founders?

Thanks to this collaborative effort, we created 150 connections across 80 hours of mentoring sessions — what our Inclusion Advisory Board member, Shahirah Gardner, likes to call: “The Giant Warm Intro”.

74% of founders who applied for Open Office Hours identified as under-represented in one or more ways including:

🙋🏾‍♂️ 37% migrant founders

🙋🏼‍♀️ 27% women founders

🙋🏽‍♀️ 21% non-anglo founders

🙋🏼‍♂️ 3% LGBTQ!+ founders

🙋🏻‍♀️ 2% regional founders

🙋🏽‍♂️ 1% Aboriginal or Torres Strait Islander founders

Founders who made it through had the opportunity to meet remotely with two investors where they could ask for advice on anything, test their pitch or find out about the fundraising process in a supportive, collaborative environment.

Founders who applied but didn’t make it through to this edition of Open Office Hours due to limited capacity will also have a chance to meet investors in the new year.

Outcomes

Following each mentoring session, investors recorded their advice and feedback to help founders on their startup journey.

Investors told us that they could see themselves investing in more than half (53%) of the founders and their startups either now or in the future 💸

Given that the main objective of Open Office Hours is to create more connections and funding opportunities for under-represented founders, we think this is an incredible initial result, but recognise that this is just the beginning.

Following Open Office Hours, Cara Waters spoke to Paul Naphtali from Rampersand about the diversity funding gap in Australia and the work needed to be done by the entire ecosystem to make a change. You can read the full article here.
Two thousand Two Zero Party Over oops, Out of time…
By: Bill Macconnel
Tags: Facebook Marketing, Algorithms, Democracy, Advertising And Marketing, Diversity In Tech

Linkedin, I appreciate the suggestion to @ people or whatever to expand my reach, engage in conversation, believe me, and understand the advertising algorithm world of “reach” very well, which is a big part of the problem …📌 But I’m not that thirsty right now- kind of catching my breath after having a front-row seat at the Census Bureau for the past year, and watching the relentless attempt to dismantle the worlds premier statistical agency from within by feckless political appointees- and witnessing the heroic, Yes, valiant effort by the career data scientists, officials, and front line employees, and community partners who stopped it. Data integrity means something to me, integrity means something. It used to in a pre-Facebook world, anyway. So… the very idea that this sad sloppy reckless mess of a company inhibits the same world as the analytics and data professionals who actually give a shit about decency- data & otherwise… it breaks my heart.

Changes will be made, or we will look back at 2020 with fondness because the real fascist shit show waits in the same opaque shadows as their algorithms that have emboldened white supremacy, hate & destroyed democracy while creating an entire segment of the population untethered from the truth. Hashtag, wake the fuck up ALL. Polite water cooler conversation is so pre-pandemic. Let’s get real with this conversation and action to restore civic virtue, which the #facebook advertising business model has eviscerated.
Porque a diversidade deve ser tratada como meta nas empresas
Tags: Diversidade Meta, Diversidade Corporativa, Cultura Movile, Diversity In Tech, Diversidade E Inclusão

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
Hello World
By: Future Capital
Tags: Diversity In Leadership, Angel Investing, Diversity In Tech, Venture Capital

Future Capital was launched with a core belief: the lack of diversity in business is not inevitable.

Earlier this year — fresh on the heels of a new, more virtual, way of working — we launched our first livestream, establishing our commitment to showcasing and promoting a new side of the decision making table. What followed was a series of discussions, events and learning experiences that validated that core belief on a consistent loop.

Since that first livestream, we’ve interviewed a dozen experts in startup investing, run 10 crash courses on venture funding, and closed multiple private investments; all of this has been done alongside leaders from a broad spectrum of diverse backgrounds.

A new look for the future