![]() The interactive prompt will ask you for a password to authenticate. Mongo "mongodb+srv:///test" -username yourUserName Open the command line and run the following: Later we’ll also use a connection string for an application. To test the connection, we can use the connection string for the mongo shell first. Choose a connection method that suits you best.For security reasons, it’s recommended to auto-generate a strong password. The first one will have atlasAdmin permissions for the current project which means possessing the following roles and privilege actions. Whitelist your current IP address or add a different one.Now that our cluster is ready, let’s connect to it! You can choose any data of your preference. It will help us to achieve the goal of establishing different reporting tools within the same application. Using this data, we’ll try constructing a meaningful report which can serve for exploratory data analysis within a real organization.Īdditionally, we’re going to use mock JSON data about marketing. For this tutorial, we’re going to use the Kaggle dataset with transactions from a UK retailer. While you’re waiting for your cluster to be created, let’s take a closer look at the data we’ll be working with. Give a meaningful name to our brand-new cluster.The recommended regions are inferred via your location and marked with stars. Since we’re on our learning path, the simplest free plan will be sufficient for our needs. You can invite users to participate in your project via email address. ![]() Next, add members (if needed) and set permissions.After you've signed in your MongoDB account, create our first project.Alternatively, you can prepare a local database and work with it in any convenient way (e.g., via MongoDB Compass or the mongo shell). I suggest we practice creating the remote MongoDB database by hosting it on MongoDB Atlas - a cloud database service for applications. Let’s set the app aside until we’re done with arranging our database. Set up MongoDB database using MongoDB Atlas Hooray! Now the project knows about your app’s existence and we’re ready to move on to the database configuration. ![]() Open the django_reporting_project/settings.py file and append the app’s name to the end of the INSTALLED_APPSlist: After an app is created, it’s necessary to register it at the project’s level.It also conveniently manages the creation of a project-specific isolated virtual environment. I highly recommend using P圜harm since it makes the whole process of programming in Python a bliss. Next, open the project in your favorite IDE.If you don’t feel confident about the difference between projects and applications in Django, here’s a quick reference to help you figure it out. Now it’s time to create our application empowered with reporting features. If you can see this cool rocket, we are on the right track! Create an app Unless specified otherwise, the development server starts at port 8000. Let’s check if everything works as expected.Open the console and run the following command to create a new shiny Django project:ĭjango-admin startproject django_reporting_project First, open the directory where you want your project to be created.Make sure you've previously installed Django on your machine.In a step-by-step manner, we’ll set up everything to make our application outstanding. If you’re new to Django development, that’s alright. P圜harm Community Edition - an IDE for Python development.The MongoDB connector for Flexmonster- a server-side tool for fast communication between Pivot Table & MongoDB.It will handle data visualization tasks on the client side. Flexmonster Pivot Table & Charts - a JavaScript web component for reporting.MongoDB Atlas -a cloud database service for modern applications.Django - a high-level Python web framework.Basic experience with NoSQL databases (e.g., MongoDB).How to add a reporting tool to the Django app.How to import JSON and CSV data to MongoDB.How to host remote MongoDB data in MongoDB Atlas. ![]() Here is the list of skills you’re going to master upon the tutorial completion: If you have any questions regarding the process, please ask them in the comments. If you ever encountered the necessity to build an interactive dashboard or you’d like to try doing it, you’re welcome to walk through the steps from this tutorial. In this tutorial, I’d like to share with you an approach to data visualization in Python which you can further apply in the Django development.
0 Comments
Leave a Reply. |