In this project, I'm building the XFA site using the Django web framework. Basically this project encompasses the effort to move from an empty Django project to an actual website hosted at exfizzassist.com. The fact that you're reading this right now signifies that this effort has been completed, but I will constantly be improving and making changes to the site.
Just as a brief warning, this post is going to be quite technical. I imagine this content might be dry for those of you who aren't computer science-ically inclined. For those of you who are computer science-ically inclined, I can only hope this will be useful, but know the following content is mostly for my own benefit. If you're looking to be entertained, I suggest hitting the next/previous buttons on the bottom of the screen.
Now then, I have largely finished the architecture for the XFA site. I think it is very likely that I will build more web apps in the future, so I’m going to write what I like to call a documentation story for this project. The “Quasi” prefix is there because the last time I wrote a documentation story it was incredibly long and detailed, and here I’m only really going to include important points from the project. This is going to be in mostly chronological order with respect to when I completed the various parts of the project. I should also note that this is also mostly for my benefit, and this shouldn’t be taken as a comprehensive guide.
There are five main parts of a Django web app (when you’re using Django templates): Models, Views, Urls, Templates, and Settings. I will go over each in order.
HTML / CSS:
This is really only my second web dev project, so I learned a great deal about HTML/ CSS in this project. I’m going to include points that I find valuable. Some of these are quite basic.
I used the Materialize CSS framework for some of the CSS heavy lifting. Here are some important things to be done with Materialize:
This was very daunting, but thanks to Corey Schafer, everything is up and working. This was my process for getting the XFA site up on the interweb.
Setting up Git: This is super important because it allows you to develop on your local machine and easily push changes to the server. I will redirect you to this link which has much more information about this. Somethings to note about this process. Include your settings.py and your db.sqlite3 database in the .gitignore because you will have different settings for your live Django app than for your local Django app. It is also best practice for the server to have its own database. I used PostgreSQL for my live server. It’s super easy to setup and configure with Django, and Django migrations worked just as well for the Postgres as they did for Sqlite.
I think that just about covers everything. There are, of course, a ton of other nitty gritty details to figure out, but that’s how any software project goes. Once again, I’m mostly writing this as a way for me to remember the main steps for building a web app with Django. Perhaps this may be of some use to the rest of you.
I did despair, my friends. I had sunk low into the darkness. I thought all was lost. I thought that all the work I had done on the XFA site was for naught. I thought…it’s almost too difficult to write. I thought I would have to…*gags*. I thought I would have to build my website with WordPress. Wow, that was hard to say. Allow me to explain.
Yesterday, I had finished the first version of the XFA site. I happily, giddily even, danced over to the BlueHost website and almost mindlessly bought a 3 YEAR shared hosting plan. Up until that point, like the good lil programmer I am, whenever I had run into an issue, I waltzed on over to StackOverflow to figure out what I was doing wrong. After I looked at the BlueHost interface, I thought to myself, “self, I have no idea how to deploy a website on a shared server, I should probably bop on over to StackOverflow.” But then, to my overwhelming horror, the internet absolutely failed me. As much as I looked into the revolting bowels of the interweb, I couldn’t find a single (applicable) tutorial about how to deploy a Django web app on a BlueHost server.
Ya boi was all like, “what the flippin’ heck?” In my confusion, I did a bit more research into general Django deployment practices, and it was there that I found the truth. It turns out that it is SUPER, SUPER, SUPER, SUPER overkill to use Django to build a blog site, which is precisely what I had done. Because it is SUPER, SUPER, SUPER, SUPER overkill to build and deploy a blog with Django, no one really ever does it. And because no one ever does it, there’s no one to make a tutorial for how to do it. And thus, the internet community failed me.
It was in that moment that I reached a nadir. I very, very angstily arose from my computer perch, vented to my brother, and then took a walk outside in the cold, cold Colorado air.
I decided that the only reasonable way to deal with this situation was to be brutally honest with myself. I know that I have no experience with server programming. You don’t either, so stop judging me. I knew that I might be able to get Django to work on BlueHost, but it would likely require a knowledge of Apache that I don’t possess, and several long heart-to-hearts with the Support Team of BlueHost. As a quick aside, the Support Team of BlueHost is hands down the best customer service with which I have ever interacted. Let be the first to tell you: if you are building a WordPress site, or a static web page, look no further than BlueHost. They’ll be the Obi-wan to your Qui-gon Jin.
And that is when I began to despair. BlueHost is super good at building and deploying WordPress sites, so there I was with my 3 year subscription, thinking I would have to sell my soul to the abusive mistress that is WordPress.
But then, when all hope was lost, a single beam of light shone through the dark stormy chaos that is the world-wide web. I was desperately flinging myself at every forum I could find, desperately searching for answers I never hoped I would find, when Reddit in all of its glory deposited a single comment into my lap that would come to fundamentally change the entire course of my afternoon.
The comment said something like, “…check out Corey Schafer’s tutorial on Django Deployment. He probably will have something that can help.” While to the untrained eye, this comment may have appeared as an emotionless recommendation for an online tutorial, I saw it for what it truly was: a supernatural sign of hope, where no hope could be found. Blessed readers, I will have you know that I did go to Corey Schafer’s website in an almost delirious fervor, and I found his tutorial on Django Deployment.
I’ll leave out the juicy, juicy details associated with the process of setting up SSH keys, configuring apache, and massaging linux, but I am here to tell you that as I sit here tonight, you yourself can go to exfizzassist.com, and there you will find the XFA site. I know, I know. I can hear your whoops and hollers from across the bounds of space and time itself. The XFA site is comfortably siting on a Linode Server somewhere in Fremont, California.
But I think the true moral of this story is not that the XFA site is finally up. The really, truly fundamental take away from this post is that Corey Schafer is a sexy, sexy beast. For all you girls out there trying to find a strong, yet sensitive man, you’ve got your priorities all wrong. There is really nothing more animalistically sexy than a man who can battle a Linux web server and emerge the victor. To be perfectly honest, I have absolutely no idea if Corey Schafer is romantically involved with anyone. But by the hammer of Thor, if he’s not, then citizens of the world, hop on over to that hunk of man-meat!
Ugh. It’s 11:30pm. Last night I got like 5 hours of sleep, so I told myself that I would be in bed by 11 tonight. Well, that didn’t happen. Anyway, I best be off. However, one more quick thing. If you do happen to be looking for tutorials on Python, Corey Schafer is your man. Don’t go to pythonprogramming.net (I love you Harrison, but Corey is better). Don’t ask questions and go directly to Corey Schafer’s YouTube channel. Peace.
What’s good, people? I’ll tell you what’s good. I basically finished all the source files for the XFA site. YEET! I won’t make any effort to hide my emotions. I am deeply, deeply stoked.
Now then, what’s bad, people? I’ll tell you what’s bad. Deploying the website. For some reason I figured the deployment process would be a walk in the park. Not so, readers, not so. It turns out that there is a tremendous amount of hullaballoo associated with getting servers up and working.
After I finally finished the source code for the project, I began poking around at which hosting service to use. I decided on BlueHost because the internet told me to. If the internet told me to jump off a bridge, would I do it? Well, readers, that depends. If the bridge was sufficiently high and I had a ballistic parachute strapped on, that might be a wild ride. In that case, I would probably have the internet to thank for its peer pressure. As a brief side note, in High School we’re taught that peer pressure is a bad, bad thing. While I have found that this is mostly true, I have found that mountain biking and longboarding are two activities where peer pressure is invaluable. If you are longboarding, however, please for the love of Thor’s hammer, wear a helmet. Perhaps this statement has shattered your perception of me as an invincible Coloradan (which I am, don’t you forget it), but I will have you know that one of my friends almost got into a horrible longboarding accident involving a pendy slide and an aggressively placed curb because he hadn’t strapped his helmet on. No one cares if you’re cool. Wear the fracking helmet. If nothing else, how on earth are you going to understand the covariant form of Maxwell’s equations if you have brain damage? That alone should hopefully scare you into keeping that helmet on whenever you’re on a mountain or boarding down a road.
Wait, hold up a moment. I believe I hear coyotes howling. It honestly sounds more like wolves, but we haven’t had wild wolves in Colorado for ages. What an interesting sound. I don’t really know why they howl like that. They can’t howl before a kill because it would alert the prey. The can’t howl after the kill because it might lure other predators. Maybe they just do it because it feels awesome. I can certainly understand that sentiment. I have been known to make bizarre noises for the good, good mouth-feel. Yowl on, coyote brethren (and sisthren), yowl on.
Back to the main matter at hand. What to do about website deployment? In a courageous and noble effort, I shall strive onward. I shalt not let the tribulations of restricted Shell access keep me from that for which I conquest. I conquest for glory! I thirst for honor! I strive onward empowered by the vision of a day that may come when our sons and daughters can deploy their Django applications without fear of bad documentation and bad tutorials. Yes, my readers, yes! Let us not by hindered by the afflictions of server programming! Let us draw together, and march on toward the glorious horizon, a future where we are no longer at the mercy of nefarious hackers cloaked in scripted shadows, trying to steal or personal information from the whois database! (the whois database, btw, seems like one of the most anarchical creations of man. I openly condemn it. Do I fully understand it? No. Did I learn about its existence tonight? Yes.) For honor! the crowd roars in agreement. For glory! the crowd stamps their feet and pounds their fists. For our sons and our daughters! one member of the crowd becomes so impassioned he starts performing a ceremonial jig. The rest of the crowd openly shuns him and tries to pretend he doesn’t exist. To me! with an army of programmer-warriors at my back, I rush forward into battle I know we may lose, but will no doubt be sung about for generations to come.
Goodness me. Nothing like leading a pack of hypothetical programmer-warriors (a lovely oxymoron, you’ll agree) into a hypothetical battle against a metaphorical manifestation of my troubles with web app deployment. You may be amused to know that I’m currently propped up on my queen-sized bed (yeah, I know. It’s absolutely egregious that I possess a queen-sized bed) which is covered in snowflake flannel sheets. The morning light has been waking me up at ungodly hours, so I have placed a green flannel blanket around one set of windows (this blanket’s original purpose was as a green-screen for a project I did in seventh grade about caecilians), and a brown fitted sheet over the other. The green and the brown really come together to produce a wonderfully swampy effect during the day, which only solidifies the “Cave of Sorrows” motif I’ve been trying to cultivate in my current living space.
Goodness gracious, to my left is An Introduction to Analysis, Calculus, An Introduction to Astronomy, and Modern Physics. Those of you who are rightfully concerned about my sanity are probably wondering what these books are doing in my bed. Well, my friends, I honestly don’t know. I could try to pull off the ultimate weird flex and tell you all that I sleep with them, but we both know in our heart of hearts that isn’t true.
I am fast approaching… wait hold on. I can hear an animal prowling right outside my room. If it weren’t 12:40 am, I could try to see if it’s a mountain lion or bobcat. Drat. Anyway, I am fast approaching the hour of 1am, so I feel I should wrap this sucker up.
I can assure you all that I will remove the textbooks from my bed with extreme prejudice. Toodles!
Good tidings, brethren! Brethren seems to be a masculine word. My university would be most displeased if I only used masculine greetings. Berkeley actually outlawed the use of gender-specific words in legal settings like ‘manhole’ and ‘manmade.’ It’s really quite something that Berkeley prides itself on free speech. What would the female equivalent of brethren be? Sisthren? Well then, good tidings my brethren and sisthren! Why are the tidings good, you ask? Because I have been putting in a good deal of work on the XFA site, and as the title suggests, it is looking simply gorgeous! I realize that these particular posts are a bit meta because I’m writing posts about the creation of the site that I will use to post these posts, but I suppose that’s just one of the beauties of life.
I am planning on putting several pictures of myself around the site (to confirm that I am in fact a human being, and not just another sexy poltergeist) but these pictures haven’t yet been taken, so I’ve had to use random surrogate pictures from the internet. I only mention this because the picture I grabbed from the clutches of google images for XFA’s homepage makes the homepage look like an ad for a makeup company. I’m coming for you Kylie! They told me a straight male physicist/computer scientist/mathematician with no experience in fashion would never be able to start a successful makeup brand, but I’ll show ‘em!
Interestingly enough, I’ve actually thought that I would actually really enjoy doing hair/makeup. This was a passing thought/feeling I had a couple years back that I clearly haven’t done anything about, but perhaps at some point if I ever achieve fame and riches, I’ll give it a go. What I do know is that I have an incredibly hard time keeping myself from bursting into fits of birdlike laughter whenever I watch makeup tutorials on YouTube. I haven’t watched that many, but for some reason I absolutely can’t take them seriously. Now that I think about it, I doubt that I’ve watched any more than two throughout my entire life. I don’t remember much about the first one, but the second one was by Belle Delphine. As a concerned reader, you might be wondering why on God’s green earth I was watching a video by Belle Delphine. If you must know, I believe Pewdiepie mentioned her at one point (yes, I have watched several of Pewdiepie’s videos. I’m honestly not a huge fan. YouTuber culture is a truly bizarre phenomenon) and when I looked at her channel, I was astounded at her subscriber count. Everything made sense when I did a bit more research and realized she essentially makes softcore porn. Nothing like porn to get you a massive internet following. It may not be crystal clear from reading this, but I would like to formally state that I do not condone the practice of using porn for generating a massive internet following. If you are actively doing this, I would suggest you perhaps find a counselor of some sort or perhaps a therapist.
Good heavens, how on earth did I get onto a high horse about porn? Ah yes Belle Delphine. Always the troll.
Anyway, in a desperate effort to stop writing about porn, let me tell you about my day. I think that even I have the right to share my feelings with the emotionally psychotic, entirely chaotic lifeforce that is the internet.
So today I woke up in the mountains, and my brother and I went skiing at A-Basin in Colorado. I had a free day pass at A-Basin because last summer I went skiing in a lightning storm at A-Basin, which resulted in me being awarded a free day pass. It was a superb day of skiing, aside from the fact that it was a complete white-out, and we literally couldn’t see the ground. It’s always a bit disconcerting when you think you’re going to move in a straight line and then suddenly you’re skiing up the side of a mountain by accident. At one point my brother and I were on the chairlift, and a girl skiing beneath us yelled, “Where is the ground!?” I think that pretty well sums up the day.
As with most nature activities, I can only fully enjoy skiing for about three hours before my mind starts drifting to other matters. Today, for instance, I thoroughly enjoyed skiing in the morning, and then my twit little brain started zoning off trying to figure out how I can use category theory in the math software I plan to begin developing.
You can bet your sweet petunia that this math software is going to be an XFA project, so I won’t give too many details away just yet.
Goodness me, now I’m just blabbering about my day. I will have you know that I don’t plan on posting about my everyday life very frequently because why should I? Isn’t hearing about someone else’s life half the point of friends? If that’s what you’re looking for, maybe you should go make some friends. Now then, I’m off to bed. Until tomorrow night my sisthren!
Shalom, brethren. I have spent this week of winter recess in Arizona with my family, which means I have had time to obsessively build the XFA site. I understand that many of you readers may not be programmers, but let me tell you, if you’re looking for a hot, passionate night of shameful pleasure, learn Python and then build a web app with the Django framework. I can barely contain my feelings toward Django. It is juicy, juicy sauce. If you are in fact a programmer, and have previously used Django in your endeavors, I’m sure you share my sentiment.
My compulsive programming this week has also been a time of self-learning for me. I know all you readers care deeply about even the most minute details of my work life, so I won’t hold anything back. Actually scratch that, I am going to hold some stuff back. Otherwise, many of you might be concerned I’m an egotistical sociopath, which isn’t good for business. Anyways, I have specifically been paying attention to my micromanaging tendencies. When building a web app you generally have to keep track of several moving parts (models, views, CSS styling, whatnot), and I very much tend to spend far too much time perfecting small details when much larger pieces aren’t in place. For example, you know how sometimes you go to a news or blog site that only displays part of an article, and then the text fades out with a “Read More,” button at the bottom? For some reason, I had a spontaneous love affair with incorporating that effect on the XFA site, and I honestly think I spent an hour (“…A full hour!” –Crazy Craig) getting everything right. Now, this wouldn’t have necessarily been the end of the world, except for the fact that the entire site looks like garbage right now because I haven’t started styling the site yet. The engaged reader might be tempted to ask the question, “Why oh why, Danny, did you spend so much time perfecting the text fade away effect when you haven’t even started styling yet?” Well, my wonderfully engaged reader, I don’t really have a good answer for you, aside from the fact that I derive an irrationally large amount of utility from having perfect control over small details. Some might say I’m a perfectionist. Others would be wrong.
I think because I’ve spent the last five years mostly doing physics (not hard stuff like QFT or GR or String Theory. I’m not Wolfram sigh) I’ve generally been rewarded for being cripplingly OCD about the minute details of derivations. However, recently I have been attempting to tackle more complex theories (the hard stuff like QFT and GR), and I have been running into issues because I tend to spend way too much time trying to understand the incredibly minute details of every equation instead of trying to grasp the central tenets of the theories. It's also hard because the minute details of the mathematical theory usually give me the most pleasure (the details are a bit fuzzy, but at one point I believe I was accused of having romantic feelings for eigenvalues. I can’t say that’s too far off the mark. Honestly, eigenvalues are the Django of basic linear algebra). The issues I’ve been having with these theories specifically have genuinely caused me to wonder if my brain is already slowing down, but I think it’s far more likely that my perfectionist tendencies are finally catching up to me.
So then, the ~groundbreaking~ (really pretty obvious) conclusion I’ve come to is that I have to be much more militaristic with myself when it comes to my organizational approach to learning new subjects or working on my projects. As a practical example, I will have to force myself to implement the architecture of the XFA site before I go about trying to style the thrice-fracked thing. This organizational approach is pretty obviously the best way to go, but my time of self-reflection has really showed me how shamefully unorganized I’ve been with my past projects.
As an example of this shameful, shameful behavior, for the past two semesters, I’ve been doing a research apprenticeship for the ATLAS group at Berkeley (For the uninitiated, the ATLAS detector is a detector in the Large Hadron Collider in Geneva, Switzerland, which just so happens to be the largest particle collider in the world). I won’t go into the specifics of my projects with ATLAS, but this last semester I was primarily working with the incredibly elaborate data readout system used by ATLAS.
It’s honestly a bit painful to think back to my project this semester, because I really did a poor job learning the necessary material to do the project I was working on. The fundamental issue was that in order to understand anything about anything, you had to first develop a basic understanding of the system as a whole. This was an issue for wee physicist Danny because I’m used to reading out of a physics textbook, understanding equations line-by-line, and then watching the main ideas unfold before me like the glorious phoenixes they are. When confronted with a subject that wasn’t possible to learn line-by-line, I hopelessly floundered about like the weird fish in Harry Styles music video for Adore You.
The moral of the story is that if you’re a perfectionist, you’re annoying and I don’t like you. JK, we’re all friends here. The moral is that in the future, I’ve learned that I need to make a much more concerted effort to outline whatever it is I’m working toward, and only dive into the details when I can see how they support the bigger picture. Unless I’m just looking to trip out on some delicious math. Then I’ll just shamefully and giddily open Weinberg’s QFT book to the section about the topology of the Lorentz Group. Until next time, my friends.
Like so many others, today was a remarkably interesting day. As the title might suggest, I began work creating the site for XFA today. I am currently refamiliarizing myself with Django, which is a python framework for building web applications. I naturally will need to have perfect control over the XFA site in order to convey the precise information and emotion I wish to convey, and thus I feel as though I necessarily must build the site myself, instead of turning to some easy way out, like WordPress. I simply cannot convey my excitement about enacting my vision for the XFA site, and it is a gift from life itself that I have the ability to birth this site from my mind in the form of succinct blocks of code.
Now then, I feel as though I ought to expound upon my first statement pertaining to the interesting character of this very day. After a brief stint journaling, I began reading Srendniki’s book on Quantum Field Theory. Up until now I have been attempting to learn the subject by means of Weinberg’s text, but let me tell you, that book is dense. A good friend of mine suggested I use Srendniki’s text instead of Weinberg for an introduction to the subject, so I decided to give it a whirl today. I read through the first section which motivated the use of Quantum Fields to deal with the problem of unifying special relativity and quantum mechanics, and the math was quite interesting. I am currently on Winter Recess and am spending time in Arizona with my family, and at about 12 I went to play 18 holes of golf with my father, brother, and Grandmother.
It was a truly gorgeous day. Arizona can sometimes be reconkulously hot, especially when playing golf in the desert, but this winter day was wonderfully temperate, and the sky was an incredibly compelling shade of eggshell blue. Anyway, I was able to enjoy the day and the golf for about 9 holes, when I was suddenly overtaken by the compulsion to work on quantum field theory problems. Gone was my enjoyment of the day, my family, and ridiculous sport of golf. This compulsion is very interesting to me. It happens fairly frequently to me, and it honestly seems quite silly. It robs me of the joy of living and fills me with a profound sense of anxiety.
I’m going to abruptly cut off this entry simply because it’s nearly midnight, and I’m quite tired.
Stars; in your multitudes; scarce to be counted; filling the darkness.