Skip to content

How to make Django select menu using Django model for getting menu items

Notifications You must be signed in to change notification settings

tnptm/Django-select-menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django-select-menu

This project is for showing simple way how to make with Django a view where is template with select menu using Django models and forms. Main functions are described in forms.py, views.py and models.py. This is for you who want to learn little bit of Django and Bootstrap with it.

How to install Django and this code?

At first you need to make sure, you have Python installed. I'm using here Python's own virtual environment. Go to directory you want to install this repository in your terminal (This is for Linux).

$ python -m venv venv
$ . venv/bin/activate
$ pip install django django-bootstrap-v5

Download and extract this code to this direcory. Then we need to create SQLITE database for this. It can be done using Django with the following way. Go first to the directory where is file manage.py and then:

$ python manage.py makemigrations

#Create tables into database based on migrations
$ python manage.py migrate

#Create user for administrator site
$ python manage.py createsuperuser 

#Run the server:
$ python manage.py runserver

Then you can go with browser to localhost:8000/admin/ and add as many projects as you like.

About

How to make Django select menu using Django model for getting menu items

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages