Optimum architecture for webapp using Django

I am a complete novice in programming. So please don’t make fun of me. I would like to create a web app using Django. The idea is to let the user generate points on a map through latitude & longitude data entered in a form in the application.

The architecture I had in mind is the following : Django form => Django model => MySQL => PHP => XML => Google Map

But intuitively I feel this is not the most efficient architecture for my application. Moreover I ain’t sure how PHP would dynamically generate an XML every time a user feeds data to the MySQL database.

Could someone please guide me on what could be the optimum architecture for my application ?

Making fun of beginners is forbidden here, just so you know.

So, the first problem is if you don’t know how to code pretty well already then this question is sort of way above your pay grade. By that I mean, I could describe how to do this, but you wouldn’t be able to understand it really. The only way to explain it would be an entire big course on making your first Django application. So first step for you is to get better at just basic Python. Second step is to go through one Django book and get all the code working. Then, your question is way easier to answer and you might not even have it anymore.

But, to answer the question: You would not need PHP or XML at all this setup. Just Django and MySQL will do it, but you’d also need to have a “Geo” capability in MySQL. I know PostgreSQL has an insanely good geo plugin, which will let you easily query by lat/long coordinates and distances. I’m not sure if MySQL has it.

1 Like

In fact you perfectly answered the question. Thank you very much. I have been simply following the Google Maps API documentation which hints at using PHP & XML : https://developers.google.com/maps/documentation/javascript/mysql-to-maps?hl=fr
But your answer has given me the direction in which to look for.

I am trying to build my first Django web app using Django girls tutorial and youtube videos. These are good sources and have given me a good start but I needed some more help. I think I will be able to build from here.

Thanks for keeping a constructive atmosphere on this forum. I found guys on SO not very considerate at times. Not many take the time to understand that some of us have only nights and weekends to learn how to program and can’t always put in enough research before asking a question.

Thank you for starting this forum and being understanding.

Hello Zed,

I managed to put together a prototype for an application I wanted to create since a few months. I have to apologise because it’s in French but I will give you an idea.
Essentially I hope to crowdsource the best places to observe the night sky. I love to observe the night sky but in most cases many people choose the place to observe in a relatively arbitrary way. This application will consolidate the best places to observe the night sky with the help of crowdsourced data.


Landing page (accueil) : Brief idea of what the application is about
Discovery page (découvrir): Consolidated map of best places to observe the night sky
Sharing page (partager) : Interface for users to generate places for observation

I have used a sqlite3 database which should suffice given that it’s only a prototype with low traffic. The application has been built with Django, Javascript, CSS, HTML, Bootstrap toolkit and Google Maps API.

Feel free to give me feedback. Positive or negative, both are welcome.

Warm regards,

Super cool! So how was the experience of making this?

1 Like

Rewarding but painful. When you have a day job that is demanding and has nothing to do with programming, it takes time and energy on weekends to build something from zero. But it has been so rewarding that is has given me the motivation to continue working on it and hopefully create something that other sky observers might find useful.

This forum was a great intiative. Thanks.

I’m going to give you a super pro tip:

Find a way to do two things at once.

I’ll give you an example. I want to get back into studying jazz guitar and music theory. Problem is I also like watching TV. What do I do? I put my guitar in the living room and I practice there while I watch TV. Another: I want to meditate during the day. I do Pomodoro and on the breaks I meditate. Another: I want to practice singing. I play singing exercise audio while I work. Another: I need to code on my own applications but also want to watch TV. Just sit on the couch like normal and code while I watch. Another: I need to practice drawing but I need to code. I have a wacom and artrage ready to go and I’ll do 5 minutes of drawing as a break.

There’s always a way to combine two things to optimize your time. Just have to recognize when you’re doing something kind of mindless (TV) and then add on something that requires a little more concentration.


That is really sage advice. Historically I have always been a unitasker. But given that I spend a lot of time in commutes, your advice makes complete sense and I am sure it comes from a lot of experience. I am going to follow your advice and make the best of it. I am grateful to have studied from your book.