Friday, December 14, 2012

DJango Python 101

DJango commands cheatsheet


How to start server:
./manage.py runserver

How to create new app
./manage.py startapp newappname

Database stuff
How to create database from models (Use South instead)
./manage.py syncdb

How to use South
http://south.readthedocs.org/en/latest/commands.html

For existing app
you will need to convert into South supported app first.
./manage.py convert_to_south myappname

For new apps
Create db (Similar to syncdb command)
./manage.py schemamigration myappname --initial

Update db with schema changes
./manage.py schemamigration myappname --auto

These commands generates migration scripts only.
Run this command for changes to take effect in db
./manage.py migrate myappname

6 comments:

  1. Python language course provides complete practical knowledge of Python programming. It explains core syntax and advanced concepts clearly. This python language course improves real-time coding skills. Students work on live coding projects. Data structures and OOP are included. File handling and exception handling are covered. Best practices and libraries are explained. It prepares job-ready Python developers.

    ReplyDelete
  2. Excellent overview! A data modeling course
    helps professionals understand relationships, schemas, and data flow. Practical exposure ensures better implementation in real business environments.

    ReplyDelete
  3. This blog is really informative and practical. The explanations are clear and easy to follow. Thanks for sharing these useful ideas.servicenow online training

    ReplyDelete
  4. Flexible practical sessions in this dell boomi online training help learners understand workflow automation and cloud integration concepts.

    ReplyDelete
  5. A python programming class helps learners understand programming fundamentals and coding logic using Python. It explains syntax, problem-solving methods, and programming structures clearly. This python programming class helps students gain hands-on practice through assignments and exercises. Learners write programs to strengthen their coding abilities. The class prepares learners for advanced programming and development roles.

    ReplyDelete