Intro to Relational Databases >> Python DB-API >> Deleting the Spam

 

Again we go into the terminal while server is running, and input:

  1. Control – C
  2. psql forum
  3. delete from posts where content like ‘%Cheese%’;
  4. OUTPUT (don’t input this, this is what you will see as output in your terminal): DELETE (and some random number)
  5. Control – D
  6. python forum.py

Now if you reload localhost:8000 you will see your changes, aka all cheese posts deleted.

 

Advertisements

Author: ajoannaproject

Studying Udacity's Full Stack Web Developer program and passing on my improvements, hints, hacks, and updates to other students via ajoannaproject.wordpress.com.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s