Giter Club home page Giter Club logo

djorg's Introduction

djorg

Django project with personal organization tools

Bookmarks (all in context of bookmarks app)

  1. Made model and set up fields for our model (models.py)
  2. Made a view that queries the model and renders the template from data in the model (view.py)
  3. Made a template that shows the data (index.html)
  4. Made a url that matches a path to the view. (url.py)

djorg - refers to overall project djorg/djorg/urls.py - inner djorg folder refers to the settings for this project

Migrations

Commands:

  • ./manage.py shell: django and python shell automatically has all django stuff available to it, like import models to database, django stuff
  • from bookmarks.model import Bookmark: import bookmark model
  • dir(Bookmark): view object
  • Bookmarks.objects.all(): query set to return all bookmarks
  • len(Bookmark.object.count(): return count of all bookmarks
  • dir(Bookmark.objects): view

Make a bookmark in the terminal

  1. ./manage.py shell
  2. from bookmark.models import Bookmark
  3. bookmark = Bookmark(name="Lambda School", url="https://lambdaschool.com") - instantiate
  4. bookmark.save() - can view using Bookmarks.objects.all(), returns which is an iterable, so not quite a python list but almost like it

djorg's People

Contributors

jamiemd avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.