Change Existing Column to Serial in Postgres
How to Change an Existing Column to a Serial Column in Postgres so that it Autoincrements on Insert
Postgres Upsert On Conflict Where Clause
A basic example of a Postgres Upsert using "on conflict do update" with a where clause. Postgres Upsert ON CONFLICT with WHERE clause create table z_test( f1 text PRIMARY KEY, f2 text, f3 text, f4 text ); insert into z_test (f1,f2,f3,f4) values('1','2','3','4');...
Set Python Virtual Env on Windows
How to set (activate) the Python Virtual Environment on Windows Command Line cd /<path to virtual env>/Scripts activate.bat
Django Views
Each Django view is responsible for doing one of two things: returning an HttpResponse object containing the content for the requested page, or raising an exception such as Http404. The rest is up to you. Your view can read records from a database, or not. It can use...
Django Tutorial – models, database, admin
Code / Syntax stuff from the tutorial that I'm definitely going to forget, so putting it here for easy reference: Question.objects.all() Question.objects.filter(id=1) Question.objects.filter(question_text__startswith='What') q = Question(question_text="What's new?",...
Setup FTP Server on Debian using VSFTP
vsftpd, is an FTP server for Unix-like systems, including Linux. To get vsftpd up and running, do the following as root. Bash Script apt-get install vsftpd ftp systemctl restart vsftpd.service cd /etc vi vsftpd.conf uncomment local_enable = YES That...
Location of PostgresSQL Data Files Windows 7
Posgres data file location
Django – Useful manage.py Commands
Django – Useful manage.py Commands
Django 1.11.17 Tutorial (part2) – Create Polls App
Create a django webapp with part 2 of this django tutorial
Django 1.11.17 Tutorial (part 1) – Create Environment
Installing a Virtual Env, Installing Django 1.11.17 & Creating the Django Project Environment