Skip to content

app-generator/how-to-integrate-django-with-mongo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code sample on how to integrate Django and MongoDB. Open source Django dashboard generated by AppSeed as the user interface of the web application.


Requirements

To use the following code, you need to have the following tools installed on your computer.

  • Python3
  • MongoDB server

Links

Features

  • Simple, intuitive codebase - built for beginners (can be extended with ease)
  • Design: Django Soft Dashboard - Free Version
  • Sections covered by the design:
    • Admin section (reserved for superusers)
    • Authentication: Django.contrib.AUTH, Registration
    • All Pages available in for ordinary users
  • Persistence: MongoDB

How to use the code

Start MongoDB service

For Unix, MacOS

$ sudo service mongod start

For Windows:

Mongod starts automatically when MongoDB is installed as a service. If not check here

Clone the sources

$ git clone https://github.com/app-generator/how-to-integrate-django-with-mongo.git
$ cd how-to-integrate-django-with-mongo

Create a virtual environment

For Unix, MacOS:

$ virtualenv -p python3 venv
$ source venv/bin/activate

For Windows:

$ virtualenv venv
$ .\venv\Scripts\activate.bat

Install dependencies using pip

(venv)$ pip install -r requirements.txt

Start the API server

(venv)$ python manage.py migrate
(venv)$ python manage.py createsuperuser # create the admin
(venv)$ python manage.py runserver

At this point, the app runs at http://127.0.0.1:8000/



Integrate Django with MongoDB - Open-Source sample provided by AppSeed