An inventory demo project with Python an Django 1.9 using twitter bootstrap 3 and pagination.
- Install Python (if you are using Linux, you already have Python installed)
- Install Django
- Install Pip to manage dependencies
Install these features using Pip;
I have an SQLite database. To browse and manage data, you can use sqlbrowser.
python manage.py runserver
Now you can visit the application URL: http://localhost:8000/
Now you can access the admin area:
http://localhost:8000/admin/
Create a superuser:
python manage.py createsuperuser
To run all unit test:
python manage.py test
Here are the REST calls (made with Django REST framework)
- Items list: GET /api/v1/items/
- Item details: GET /api/v1/items/{id}
- Delete an item: DELETE /api/v1/items/{id}
- Insert a new item; POST /api/v1/items/
Django deployment chelist:
- Be sure to upload the files on your server and have Django installed on your server
- Set debug mode to false: on settings.py simply change DEBUG = False
- Check every kind of tests (unit tests and functional tests etc.)
Some next steps about practicing web development with Python and Django:
- Switch to MySQL and use joins (with a category table for example)
- Admin area with many-to-many data relationships
- Admin area template customization
- Database tree structure with parent child relationship