https://github.com/alancoding/example-django-app
Starting place to demo both Django basics and the basic twists to put on your project
https://github.com/alancoding/example-django-app
Last synced: 4 months ago
JSON representation
Starting place to demo both Django basics and the basic twists to put on your project
- Host: GitHub
- URL: https://github.com/alancoding/example-django-app
- Owner: AlanCoding
- License: mit
- Created: 2016-11-13T22:29:44.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-12-05T00:10:08.000Z (over 8 years ago)
- Last Synced: 2025-01-03T05:39:14.008Z (6 months ago)
- Language: Python
- Size: 55.7 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Example-Django-App
Starting place to demo both Django basics and the basic twists to put on your project## Creation Process
Pre-reqs:
- create a virtual environment
- pip install django, others in `requirements.txt`Along the way, you'll need to use these commands. In-between you need to
actually write code.```bash
# Find out what you can do
django-admin --help
# Create your django project
django-admin startproject demo
# Create your app
django-admin startapp hiworld
```You might do better to just follow the Django [getting started](https://www.djangoproject.com/start/)
guide. Alternatively, after you have started the project, you can run these
things with `python manage.py ....`.```bash
# Create your app
python manage.py startapp hiworld
# Run the server
python manage.py runserver
```Database setup in postgres:
```bash
# Get shell in the database
psql
# Create your database
CREATE DATABASE myproject;
# Create your user
CREATE USER myprojectuser WITH PASSWORD 'password';
```## Single Page Example
Useful for understanding what Django does. Found at
https://www.safaribooksonline.com/library/view/lightweight-django/9781491946275/ch01.html
# TYI 2015 projects
Class projects:
- (demo) https://github.com/tiyd-python-2015-05/mowdie
- (demo) https://github.com/tiyd-python-2015-05/contact321
- https://github.com/tiyd-python-2015-05/single-page-app-template
- https://github.com/tiyd-python-2015-05/urly-bird-api
- https://github.com/tiyd-python-2015-05/django-movies
- https://github.com/tiyd-python-2015-05/todomvc-djangoAlan's version of it:
- Github:
- hosted: http://www.ac4.xyz/# Giant Shotgun of Concepts
Relational, structured, databases and links inside of it.
Database contains tables, which contain rows and columns.
Some columns may contain a reference to point to other rows, either
in the same table or in a different table. Relationships:- ForeignKey, also acts as a de-facto one-to-many
- Many-to-many relationships, "fake" it with an "through" table that
uses ForeignKeysORM - python library that acts as intermediary to the database
CRUD
Data-interchange formats
- JSON
- YAML
- XMLREST APIs
- django rest framework
Ports
Deployment
example: https://github.com/technivore/ansible-django# To Do, in progress
- demo of a CI/CD process with ORM access as homework
- deployment of a Django project to the public cloud