Skip to content

duplxey/django-limit-content-types

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Limit Content Types in Django Model

This repository demonstrates how to limit content types in Django model (ORM).

For more information check out the post.

Want to use this project?

  1. Fork/Clone

  2. Create and activate a virtual environment:

    $ python3 -m venv venv && source venv/bin/activate
  3. Install the requirements:

    (venv)$ pip install -r requirements.txt
  4. Apply the migrations:

    (venv)$ python manage.py migrate
  5. Create a superuser and populate the database by loading the fixture:

    (venv)$ python manage.py createsuperuser
    (venv)$ python manage.py loaddata ./dealership/fixtures/initial_data.json
  6. Run the server:

    (venv)$ python manage.py runserver
  7. Navigate to http://localhost:8000/admin in your favorite browser. The content type in Sale model should be limited to Car, ElectricCar, and Motorcycle.

About

Limit content types in Django model (ORM).

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages