r/learnpython • u/PaperPages • Jun 04 '20
My first web app! Made with Django
I've been working diligently learning python and finally have something to show for it! It felt like a long stay in tutorial purgatory with tons of failures, but I'm starting to feel like I'm emerging :)
My first app is a net worth/personal finance app called TrackerBE!
I made it public a few weeks ago, and I'm hoping to find someone that can use it for a week or so and provide some feedback. Let me know if you're interested in poking around :) You basically add financial info, and it tracks trending charts over time. I'm hoping to add enough features and tools to launch a full service in early 2021. Let me know what you think :) Thank you!
EDIT: Here's some screenshots. I'll work on getting a home page built that provides more about the app.
EDIT: Also, for my fellow students of python who feel lost, just keep on trucking along. It sounds cheesy, but you truly don't fail until you quit. Eventually, piece by piece, bit by bit, things start to make sense. Personally, I feel like I had an 'Aha!' moment working on this app where my development speed started picking up and the overall app architecture just started falling into place and making sense. The most helpful resource for me so far on my journey was the edX MITx 6.00.1x Intro to CS and Python course. Keep at it! :)
EDIT2: For those interested, my django app was deployed using Heroku. I found it far easier to get off the ground running. I had some success trying Azure and DigitalOcean, but kept running into problems I couldn't solve with my current knowledge.
11
u/Humanist_NA Jun 04 '20
Awesome! I'm also learning and will probably jump into a Django project in the near future. What did you use for the front end? And did you have to rent a server to deploy the site? These are the confusing peripheral things for me right now.
19
u/PaperPages Jun 05 '20
I use Django rendered templates for most of the front end, with a little jQuery magic for the parts of the pages that movie (menu, account drop downs, etc). I want to learn react, I’m just not there yet.
I would strongly recommend heroku for your first deployment. They use aws servers. They have good documentation for deploying a Django app. I tried a few different methods with azure, and then digital ocean, and heroku was a breeze in comparison. PM me if you want any help:) I’m still a noob but I’ll do what I can!
Edit: I also used ChartJS for the charts
2
4
u/Fvnes Jun 05 '20
I'm also interested about fron end. I was wondering if I need to learn frontend before learning backend.
1
u/La_Tasse Jun 05 '20
IMHO you definitely don't "need" to. Just have in mind that depending on what you will chose to use in the future for the front-end, you might want to provide data that are formated differently (eg. provide some JSON values instead of the whole html page).
10
u/kundanML Jun 05 '20
Overall a good look.
A small feedback though: when the user directly jumps to https://www.trackerbe.com/Portfolio/new without logging in, for your site it displays the form to Edit investment , But ideally it should redirects user to login first and and then make any changes.
you can use something like login_required decorator to fix this.
1
5
u/violentlymickey Jun 05 '20
Great job, but immediately I am initially resistant to registering without any idea what the functionality looks like. I would like at least a screenshot overview or even better, let me go in and try it without registering, and if I want to keep what I've done, then prompt me to register.
1
u/PaperPages Jun 05 '20
Thanks! A few others have said that. I think my next update will definitely include a proper home page that explains the app. I had always planned on adding one once I thought I had enough features/tools. Thanks for the feedback!
8
u/-CryptoMania Jun 05 '20
🔥 🔥 🔥 go get those open source MIT courses right now
3
u/PaperPages Jun 05 '20
the MITx 6.00.1x was such a good course. I feel like I walked away from that with a completely different perspective and much more confidence with coding. Any others you'd recommend? Maybe lightning can strike twice for me haha
1
6
2
u/offenderWILLbeBANNED learner Jun 04 '20
What resource did you use to learn django?
15
u/PaperPages Jun 04 '20
Originally, I picked Flask (for no particular reason) to make a web app, but I could never get it successfully deployed. It was basically just a few static HTML pages.
I then switched over to Django. I didn't follow a particular video or anything, I just googled the crap out of it. The Django documentation is the first documentation that I've been able to comprehend and implement in my code so that was very helpful. I also recently purchased the book Two Scoops of Django, so some of the more recent changes have come from recommendations in that. Thanks!
0
Jun 05 '20
[deleted]
1
u/PaperPages Jun 05 '20
Thanks! I just bookmarked it. I'm sure I'll revisit Flask, especially if I just need to get a small service up and running.
3
u/barophobicastronaut Jun 05 '20
Also check Test-Driven Development with Python: Obey the Testing Goat: Using Django, Selenium, and Java Script it's a really great resource in my opinion, taught me a lot.
1
7
u/hedonistolid Jun 05 '20
BTW Python Crash Course has a nice Django project in it where it walks you through setting up a blog from scratch.
2
u/Adhesiveduck Jun 05 '20
This is a really good resource if you want to pick up Django.
The guy takes you through everything right up to deployment, and you cover everything including code structuring and writing unit tests.
2
u/DirtyHirdy Jun 05 '20
That’s pretty cool! I like the color scheme and seems pretty clean. What other items do you plan to add in the future?
Did Django make data storage and queries way easier or harder than committing entries somehow with flask via db connector or something?
1
u/PaperPages Jun 05 '20
I really want to just keep it as simple as could be, so anything added should meet that criteria. Having said that, I would like to add more charts/graphs regarding profit and breakdown of assets. Also, I'd like to expand on the 'Current Market's area so that it's editable to pick stocks you'd like to follow. Once the charts/graphs become numerous, I'd also like users to have the ability to show/hide only the ones they want to see. I'll probably also add some simple calculator tools that use your current data as a starting point. We'll see :)
I'm an analyst by trade, so I'm pretty used to working with SQL. Switching over to Django's ORM was kind of tough for me as I'm still a budding OOP programmer and don't know very much. But it's actually pretty straight forward. I found that with Flask, I had a lot of connection issues. Opening connections was fine, but I kept running into problems where they weren't closing and I would meet my max connections in the DB.
I used Heroku to deploy this app, and they guide you towards using their PostgreSQL service, so that's what I'm using now. First time using it, it seems fast and reliable so far :)
2
u/DirtyHirdy Jun 05 '20
Awesome, thanks for the reply! Keep up the good work!
After futzing around with MySQL connectors and tkinter for a what seems like forever, trying to put it all together for a web or mobile app is a bit of a different monster I’m finding. Took way too long to wrap my head around that stuff so I think it’s really cool that you were able to get your program up and running for both mobile AND web. I may have some more homework to do on django’s ORM and Heroku. I came across it a few times but chose a different path.
I work w SQL Server every day but actually adding a DB into the backend of my pet projects was a steep learning curve!
You may have answered this already, but did you use Heroku for the mobile deployment as well?
1
u/PaperPages Jun 05 '20
Yup, it’s just one site right now that is responsive for mobile and web. I’m starting to find small things I want only on mobile or only on web. I think for now I’m just gonna get creative with hiding and showing things. Thanks!
2
2
u/hisfastness Jun 05 '20
Hey I remember you sharing this with me last week :D Good job getting it all finished up and shareable with the world. Looks great!
2
u/PaperPages Jun 05 '20 edited Jun 05 '20
Thanks! :) I feel like it gets more polished everyday which is exciting!
Edit: Tendie Tracker! I knew your name looked familiar haha. I need to make a landing page like yours, it looks awesome!
2
u/bbt133t Jun 05 '20
Very happy and envy you. Almost wrapping up the basics of Python then I will dive head first into Django. :)
2
2
u/ParxyB Jun 05 '20
Congratulations man! I remember when I built my first full stack app I was sooooo happy! I’m happy for you!
1
2
u/halfk1ng Jun 05 '20
Would you link the git?
1
u/PaperPages Jun 05 '20
Yeah I gotta figure out how to delete a bunch of previous commits that have sensitive data all of over the place :( I didn't know what I was doing and had never deployed an app so figured it didn't matter lol. I tried to get rid of the commit history a few weeks ago and couldn't figure it out. I'll revisit that, I'd love to share the code
1
u/halfk1ng Jun 05 '20
I'm actually still learning it myself. I have known CSS HTML and a little PHP/JS for years. I'm finally trying to dive into Python. This project looks fun, looks like it's useful, looks like it's structured in a way that might be able to be learned a little more easily. Taught myself the dumb languages by going to view source, so I'm hoping I can do something similar here :)
Thank you in advance.
1
2
u/Infreezy Jun 05 '20
Did you use javascript or some python module for that? If so it's probably not your first web app is it ? I've been praciticing with flask and I like the back end work but whenever it comes to the front end and how I ACTUALLY want the page to look like I instantly give up.
Does Django help with the front end or is it just jinja2 like flask?
1
u/PaperPages Jun 05 '20
I did use Wordpress in the past to make a couple websites, but I never coded anything from scratch on them besides hacky HTML/CSS changes, and I worked up the courage to implement a jQuery sliding/toggle animation a few times.
I have been going through tutorials and stuff for a long time, but this is the first app that I was able to get successfully deployed :)
Django also uses jinja2 like Flask to pull in database stuff.
I hear ya on the front end stuff. I'm getting pretty decent with HTML/CSS the more I work with it, but I'm still having a really hard time with javascript. I can manage to google my way through it, but I don't think I could write more than a couple lines of code without google. I found that my fight to try to not learn javascript is just going to hurt me, and I'm trying to solve more problems with it. It's pretty unavoidable to really start making the front end work how you want.
Good luck!
2
u/lance_klusener Jun 05 '20
What are the costs of using Heroku?
1
u/PaperPages Jun 05 '20
Heroku has a pretty awesome free service. It goes to sleep every 30 minutes so it takes a while to boot up when you first visit, but it's great to get started.
They call their container thingys 'Dynos'. They're $7 / month. You probably only need 1 (I'm only using 1). Additionally, their postgreSQL DBs start off free, however if you need to upgrade out of the free version, you have to start from scratch. That scared me, so I'm paying $9/month for a postgreSQL service. That gives me 10mil rows max. If I ever need to upgrade now, it's just a matter of scaling up, I won't have to remake anything.
Hope that helps!
2
u/PrecariousKitty Jun 05 '20 edited Oct 05 '26
The original post content no longer exists here. The author used Redact to remove it, exercising their right to control their data & privacy.
Nine quack groovy wander toy sand growth crayon numerous
1
u/PaperPages Jun 05 '20
For the login and registration I’m just using djangos built in templates. I haven’t used any modules for that part yet, it seems to be working well so far. Thanks!
3
u/RippyTheGator Jun 05 '20
Nice job!! I will register and poke around.
I am trying to get my way to this. I have a great project idea for me that would implement well for a web app, just don't have the knowledge of how to use Django or anything yet. I have a decent grasp on python but not for web development. Did you read any books that helped you along the way? Or just google?
2
u/PaperPages Jun 05 '20
Honestly, it was mostly just googling a lot. Usually, I have a specific tutorial article or video that gets me up and running, but for this one - I just launched Visual Studio, created a Django project, and started poking around and googling. Once you get into it, Django does seem pretty straight forward (at least I found), and the documentation is really helpful.
6
u/eddykatz Jun 05 '20
I’d you’re interested in starting with flask instead of django, this tutorial was incredibly helpful and I was able to get a small web app deployed on heroku in under a week with no previous web development experience
2
1
u/PaperPages Jun 13 '20
Awesome! Shoot me the link when it’s up and running :)
Yes, I did have a decent amount of html and css tinkering from hacking together Wordpress websites a while back. I usually don’t remember the syntax exactly, but I remember what css/html can do. Knowing that is enough to just google it. Let me know if you ever need a hand with anything!
1
Jun 05 '20
very nice! any advice for learning how to set up user registration/maintenance?
1
u/PaperPages Jun 05 '20
Django has built in authentication and registration templates which was really nice. Someone else suggested my registration page is a little “uninviting” so I think I’m going to nix the Django registration template and try to build one on my own.
As far as user registration and password security and stuff, Django seems to have had handled all that as far as I can tell.
Thanks!
2
2
2
2
2
u/itsDaco Jun 12 '20
I’m working on a Django project too! I think I’m understanding most of it but I begin to get lost when HTML and CSS get thrown in because I’m not too familiar with them. Did you know HTML/CSS before starting or did you learn while working on this. It looks really good btw!
0
Jun 05 '20
[deleted]
4
u/PaperPages Jun 05 '20 edited Jun 05 '20
Stock data is up to date during market hours! I don't like after hours prices, IMO they don't represent the market accurately.
The regular market stuff comes from the module YFinance
For bitcoin, I'm using CoinMarketCap's API
EDIT: Probably also worth knowing: I store the stock data locally in my own postgreSQL DB so that it isn't doing an API call every time a user visits the page (would drain my API calls, and slow down the page). Instead, I use APScheduler and every 15min it pings the API and updates the stock data in my DB. So "live" data actually is every 15min. Hope that helps :)
2
41
u/AndresArc123 Jun 04 '20
You should provide a demo user or at least some screenshots. Or a home with this info in the webapp. Looks nice