GithubHelp home page GithubHelp logo

neil-rubens / django-orm-standalone Goto Github PK

View Code? Open in Web Editor NEW

This project forked from masnun/django-orm-standalone

0.0 1.0 0.0 7 KB

A standalone package using django-orm for database manipulation

Python 100.00%

django-orm-standalone's Introduction

Django ORM Standalone Application

Author: [email protected]

Requirements

This repository doesn't ship with a django installation. The system must have an existing django installation so that we can safely import required modules. A django app is absolutely not required. Among other requirements is the db backend. If you're planning to use mysql or pgsql - please make sure you have all dependencies met. This code works on Django 1.11.

Application Structure

  • settings.py - The Django settings module. Contains the database configuration in it. Modify this file to match your database credentials.

  • manage.py - The famous manage.py script from django projects.

  • main.py - This where we write codes. This is just a sample file to demonstrate how to import models.

  • data - The data directory works as a django application and contains the models.py which is where you put your models according to django conventions

How to setup?

  • git clone the source as a starting point
  • Change to your project directory
  • Create a new python3 virtualenv: python3 -m venv .env
  • Activate the virtualenv: source .env/bin/activate
  • Install Django: pip install django

How to use?

  • Generate a new SECRET_KEY for your settings.py.
  • Modify settings.py to add your database connection parameters.
  • Open "data/models.py". Modify existing model or add your own.
  • Run python manage.py makemigrations to make migration scripts
  • Run python manage.py migrate to create the tables and sync db changes. Feel free to use other manage.py commands available for django orm.
  • Every time you make changes to models or change db parameters, don't forget to run the migrations.

django-orm-standalone's People

Contributors

masnun avatar mattmc3 avatar mikoim avatar

Watchers

 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.