Skip to content

Instantly share code, notes, and snippets.

@croensch
Last active April 9, 2019 07:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save croensch/b0658442f71591a13bd9514f0b018660 to your computer and use it in GitHub Desktop.
Save croensch/b0658442f71591a13bd9514f0b018660 to your computer and use it in GitHub Desktop.

Anzeigen

Eine Route und Template show erstellen mit

  • Titel als <H/>
  • Inhalt als <div/>

Die ID soll übergeben (/show/1) und geladen (SELECT * FROM page WHERE id = 1) werden.

Speichern

Eine Template edit erstellen mit

  • einem Formular als <form>
  • Titel als <input type="text"/>
  • Inhalt als <input type="textarea"/>
  • einer Schaltfläche zum absenden als <button type="submit"/>

Wo wird hingesendet?

Eine Route save erstellen welche bei POST die Daten speichert. Nach dem Speichern soll auf die Route show/1 weitergeleitet werden.

Datenbank

Eine Tabelle page erstellen mit den Feldern

  • id integer
  • title varchar
  • content text

Die Datenbankverbindung aufbauen. https://dev.mysql.com/doc/connector-python/en/connector-python-example-connecting.html

Auflisten

Eine Route List erstellen, mit klickbaren Titeln.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment