Giter Club home page Giter Club logo

django-chained-dropdown-experiment's Introduction

django-chained-dropdown-experiment

Experiment chained dropdown list with Django.

Video no YouTube

Como rodar este projeto?

  • Clone esse repositório.
  • Crie um virtualenv com Python 3.
  • Ative o virtualenv.
  • Instale as dependências.
  • Rode as migrações.
git clone https://github.com/rg3915/django-chained-dropdown-experiment.git
cd django-chained-dropdown-experiment
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python contrib/env_gen.py
python manage.py migrate

Tutorial

Vamos começar com base no projeto django-datatables-experiment.

git clone https://github.com/rg3915/django-datatables-experiment.git

A partir dai assista o video no YouTube.

Anotações mostradas no video:

Copiando arquivos

cp -r django-datatables-experiment/contrib/ .
cp -r django-datatables-experiment/myproject/ .
cp django-datatables-experiment/manage.py .
cp django-datatables-experiment/requirements.txt .
cp django-datatables-experiment/.gitignore .
rm -rf django-datatables-experiment/

Iniciando o projeto

python -V
python -m venv .venv
source .venv/bin/activate
pip install -U pip
pip install -r requirements.txt
python contrib/env_gen.py
python manage.py migrate
python manage.py createsuperuser --username='admin'

Resetando a senha

python manage.py shell_plus
user = User.objects.get(username='admin')
user.set_password('d')
user.save()
exit()

Importando os dados

mkdir fix
cd fix
wget https://raw.githubusercontent.com/rg3915/django-chained-dropdown-experiment/master/fix/cities.csv
wget https://raw.githubusercontent.com/rg3915/django-chained-dropdown-experiment/master/fix/districts.csv
cd ..
python import_data.py

Lendo os dados

python manage.py shell_plus
City.objects.all()
City.objects.all().count()
Distric.objects.last()
Distric.objects.all().count()

Referências

How to Implement Dependent/Chained Dropdown List with Django

https://django-localflavor.readthedocs.io/en/latest/localflavor/br/

django-chained-dropdown-experiment's People

Contributors

rg3915 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.