Reference URL: https://qiita.com/YoshitakaOkada/items/f434bb0bc493ff9cd65b
Last time I was able to successfully start the local server in Python and simply display the fixed value graph (see: https://qiita.com/Takuto_Yoshimura/items/fbcdf337524adbf72e79)
Next, it seems that the html rewritten with DOM (script?) Will be displayed. (First of all, is this understanding okay? Lol) Well, it doesn't make sense to worry about that, so I'll try it for the time being.
(It's a personal story, but I'll try it for the time being! I like the mindset of taking advantage of this reflection and utilizing it in the next action (strategy), and I hate the "PDCA cycle" that is often said in the streets. Lol Before making a plan, you should just shoot a jab and see what happens. If you force it, it's a (D) PDCA cycle. I learned later that it's exactly the concept of an OODA cycle.)
Then, as usual, I stumble from the beginning.
Django seems to manage monogoto in units of "projects" and multiple "applications" in it like visualstudio. The project name is "mysite" for the time being.
django-admin startproject mysite
But the "mysite" folder doesn't appear in "basic_django_graph"! I was worried about why ~ why ~, and when I looked closely, it was created in the folder "basic_js_graph" I made last time! Lol
take heart Recreate it in basic_django_graph and continue. It was an ordinary mistake.
Next, type cd my site in the terminal. → Nothing in particular (If you get any error, it's annoying, but if you don't say yes or no, that's anxiety lol) → Well, next with some spirit → Next, type python manage.py runserver
→ An error came! !! (A reactionary reaction that I didn't say yes or no, I'm a little happy if an error occurs)
yoshimunnoiMac3:mysite TakutoYoshimura$ python manage.py runserver File "manage.py", line 17 ) from exc ^ SyntaxError: invalid syntax
Well, I was hoping that it would be honest from the last few experiences.
→ python3 manage.py runserver
Type in.
→ Somehow it is said to be in the red, but the text is the same as the model, and the server seems to be running.
→ In your browser http://127.0.0.1:8000/ Try to type
Alright!
→ Next> Create an application folder. Name it test_chartjs → k. So far so far
But then
>python3 manage.py startapp test_chartjs
When you hit
→ What a smile test_chartjs has a name that matches other Python modules, so rename it.
Hmm. I don't know, but python3 manage.py startapp test_chartjs If that doesn't work python3 manage.py startapp test_chart
I'll try it with a shit suitable glue.
→ A folder called test_cahrtt has been created! In other words, it was because I originally created a folder called "test_chartjs" first.
→ If you find out, delete the test_chartjs folder once! Lol
python3 manage.py startapp test_chartjs When you type,
→ Alright, success!
Create a new urls.py to change the URL association from the rocket animation Hello World (create it in the test_chartjs folder). For convenience, it may be called "children's urls.py".
Ah, a programmer's colleague used to say "child" or "parent" at the previous workplace. (Also, I said something like "Kill the child," but I now understand that the point is to invalidate some code in the lower hierarchy?)
→ If you go crazy several times, he will point out that this is wrong in the red (it is convenient.) → Crush one by one python3 manage.py runserver
When you enter,
Is this a move? .. ..
→ Well, even if I'm worried (ry → Access http: // localhost: 8000 / test_chartjs /
→ "hello world" is here! Shah!
Try accessing http: // localhost: 8000
Yeah, as a model!
→ If you think it's going well, you'll stumble at MySQL.
Or rather, on Mac you need Xcode to install MySQL It's 11GB w. The fixed line of my house is only about 1Mbps depending on the time zone, so it's not technical. The line is poor and it takes a long time to download, so I can not proceed. .. Lol (especially late over the weekend ...)
(I've been watching the display for the remaining 1 hour for at least 10 hours, but that is ...)
The article has become long, so I'll close it here. I will write the continuation in another article.
Recommended Posts