In this tutorial I will show you the setup and how to send emails to clients who signed up at your system or purchased something.
First, set up a Django project and sign up at Esputnik.com 🙂 and come back to me.
Read More »In this tutorial I will show you the setup and how to send emails to clients who signed up at your system or purchased something.
First, set up a Django project and sign up at Esputnik.com 🙂 and come back to me.
Read More »I spent 6 hours today in Nginx configurations and logs, I learnt so much about Nginx and devops process. And in the end it was all because FireFox browser (I use desktop Ubuntu on my laptop) refused to connect to the server and get the sweet HTML pages I tried to serve it.
In particular, when I renounced attempts to serve HTML pages with explicitly stated location tags and launched my good old trusted Django and it STILL didn’t work (I got 499/403 in the access.log and 404 in the browser), I came to thinking something evil is going on here. It was an unexpected, and a bad one.
The moment I opened it in Google Chrome and it worked, dudes, if I was standing, I would fall that moment on my butt.
I immediately wrote to my Python friends "screw web, I will do webcam now". But, it was a rushed thought I soon gave up. Thankfully, I did not write that to my boss.
Following Channels’ docs I encountered yet another error the solution to what was not obvious right off the bat.
Ditch Channels.
The End.
This was my original post in October 2020 and I stand by it. You can make your project work with Google Firebase - it handles signals well enough. Yes it is primarily used by mobile developers, but overall it is fine for web too. I spent trying to install Django Channels on my local Linux 18.04, and I kind of made it work, but then I had to deploy it... And as a professional backender you don't want to let people down. I decided to try Channels because my Python-related friends talked about it. But days into the trouble I asked my friend about a certain step and he asked me in return "oh so [you use it because] they fixed Channels since two years ago?". I as like ??????????????????. So that moment I ditched it. Too much time wasted, but I like the result I achieved with Firebase. What I am saying - Firebase is fast and universal. In a matter of days I managed to make and deploy an internal Customer Support chat service that connected mobile app users and a support from the web.</p> I will be writing a new series on Django + Firebase, and this post is pretty much a short introduction.
This error occured when I used ffmpeg to concatenate different videos that I generated:
ffmpeg -f concat -safe 0 -i list.txt -c copy final_video.avi -y
BTW, if you want to run ffmpeg or any other command inside a python script (a very reasonable idea), use subprocess: command = "ffmpeg -f concat -safe 0 -i list.txt -c copy final_video.avi -y" subprocess.Popen(command.split(), stdout=subprocess.PIPE)
As a result – the videos got smashed together – some frames even never appeared.
Read More »A bad solution (with Pillow) and a good solution (with OpenCV).
Contents:
At this point I feel like the most badass devops in my village.
Contents:
I can’t believe I did it. Good Lord.
Read More »First, choose a folder you want to copy the table to and grant postgres user access to it. I chose /home:
sudo chown -R postgres:postgres /home
Then log into postgres user:
sudo su - postgres
Then get to your database. If it is a Django project, you can find the name in settings.py:
psql dbname
Then, if you need your app’s tables, make a table name from these components:
{{ app_name }}_{{ model_name }}
For app userapp and model User, I have userapp_user. So in a /home/users.json I want to copy:
\t
\a
\o /home/users.json
SELECT row_to_json(r) FROM userapp_user AS r;
That’s it.
Last year I wrote a guide for django-allauth, and now it’s time for DRF. I will be using drf-social-oauth2 for social authentication.
As far as I understood this is a collaboratory project, and it is currently maintained by Wagner De Lima.
You can find very useful materials here and there, but the purpose behind this tutorial is to help set up social authentication for your DRF-based API by following clear and easy steps. So that nobody suffers from the lack of base knowledge or the lack of time – been there, done that.
Table of contents:
1. Registering an app in Facebook and Google developer’s panels
2. Getting User Access Token from Facebook/Google
2.1 Facebook
2.2 Google
3. Installing drf-social-oauth2
3.1 settings.py
3.2 Facebook
3.3 Google
4. Creating a local app
5. Converting Token from Facebook/Google into a DRF Access token
6. Accessing things with this new Token
7. Refreshing Access Token
8. Changing Access Token Expiration
I believe it is important to listen to yourself and sense if something rubs you wrong. It’s not that I hate backend, I just don’t see myself growing. My preference is to live and work independently, and at this point, with my education and personal predisposition I am inclined to try Mobile development as a career path. I deem my experience in Django and Web development in general (including UI/UX) will help me thrive further.
By no means I am quitting this blog. I am not quitting Django either. If anything, I want to leave myself an opportunity to work as a Full-stack developer in both Web and Mobile development.
Why IOS and now Android? At least for now, I have 0 Android devices and a lot of IOS ones 🙂
I will do blog posts about the transition, and not just from back-end to mobile front-end, but from Python to Swift.
I am adding two more sections – Swift and Career.