Join us and get access to hundreds of tutorials and a community of expert Pythonistas.

Unlock This Lesson

This lesson is for members only. Join us and get access to hundreds of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Hint: You can adjust the default video playback speed in your account settings.
Hint: You can set the default subtitles language in your account settings.
Sorry! Looks like there’s an issue with video playback 🙁 This might be due to a temporary outage or because of a configuration issue with your browser. Please see our video player troubleshooting guide to resolve the issue.

Next Steps: Make a Blog

In this course, you built a Django portfolio, learned a lot about how Django functions, and made friends with a lot of error messages!

If you’d like to keep building this project, you can check out the article this course is based on to add a blog to your site. A blog is a great way to share your technical knowledge and writing skills with the world.

Download

Sample Project (.zip)

411.3 KB

Download

Course Slides (PDF)

1.7 MB

00:00 Hey, for the final video! In this video course, we built out a pretty cool Django portfolio. We learned a lot about how Django functions and what to take care of.

00:11 Most of all, we made friends with a lot of error messages and made sure that these things are not actually scary, but helpful tips for us to know how to develop forward.

00:20 Now, you might be wondering what’s a possible next step from here, and I have a good tip for you. In the original Real Python written tutorial, there’s a section on how to also create a second app for this project that’s going to be a blog.

00:35 So, a blog is a great way of showing your technical writing skills—and some knowledge, also—with the world, additionally to the projects that you built. Therefore, adding a blog app to your Django project—to your portfolio project—can be a great way to move forward from here.

00:50 I’ll show you how this can look like. So up here, we have another tab now that says Blog. If you click on here, it takes us to a different app inside of our Django project that has different models, it has different views.

01:06 So, all of this stuff that we built inside of the projects app is going to be different inside of the blog app. In here, you can see, we have categories, so we can filter by categories: only show the Django-related posts, or show all of them.

01:20 You can click on the title of a post to, again, get to a details view, similar to in our projects app. Here, you can have all the texts for your blog, and we also have the functionality to leave a comment. So, I can type in here my name, “this is great!”,

01:40 Submit a comment. So users that come and visit your page could also leave a comment on the article that you wrote.

01:50 This nicely integrates together with our portfolio app. Here we have the projects. Again, we can go to the details, et cetera. Up top, in our navigation bar, we can switch to the blog and then take a look at the awesome stuff that you can write about your Python and web development knowledge.

02:09 We have the models registered inside of our admin interface, so you can easily create new categories here, as well as create new posts—same way that we did for our projects.

02:25 In this case, you will have to associate it with a Category object, and then that’s what allows us to do this filtering that I showed you before—let’s take another look at it…

02:38 filtering so that we would, for example, only see the crickets-related posts up here. Sweet! So, this could be a great next step to make your portfolio page even better.

02:50 Make sure to head over to the associated Real Python tutorial and build out your blog for your portfolio app and share all the interesting knowledge that you have inside of your personal blog. That’s it for now.

03:06 Keep learning, keep working on things, keep building stuff—that’s really where all the magic lies. Thanks for being part of this tutorial and I hope to see you around! Bye-bye.

Amitesh Sinha on Oct. 15, 2019

A little bit long.. but a great course !

Martin Breuss RP Team on Oct. 16, 2019

Thanks :) It’s a big topic! Congrats for getting all the way through it @Amitesh Sinha

Rahul Saxena on Oct. 16, 2019

Great course Martin. I just completed it.

Pygator on Oct. 20, 2019

Awesome tutorial Martin! Where is your accent from?

Martin Breuss RP Team on Oct. 21, 2019

I’m originally from Austria 🇦🇹 : )

Gascowin on Oct. 22, 2019

This was very well taught Martin. Many thanks.

So i was thinking; “why not add a simple landing page with links to the ‘Projects’ page”. This is what I did:

  1. Created an app called “pages” :
python manage.py startapp pages
  1. add url pattern in portfolio/urls.py:
path('',include('pages.urls')),
  1. Create a urls.py file in pages folder with the following content:
from....#usual imports

urlpatterns = [
    path('',views.index),
    ]
  1. Create a ‘index’ function in pages/views.py:
def index(request):
    return render(request,'pages/index.html')
  1. Create an index.html welcome page in pages/templates/pages.

…I run the server and I end up with a “TemplateDoesNotExist at / error” message! Any ideas?

Gascowin on Oct. 22, 2019

…found the issue.

I forgot to add ‘pages’ to the installed apps in portfolio/settings.py

Aside from your advice, which of the Django resources on this platform would you recommend as a natural next step?

Thanks once again.

Martin Breuss RP Team on Oct. 22, 2019

Nice work going through the whole process again and creating an additional app 👏! And well done realizing that you’ll also have to register the new app in settings.py. :)

As for next steps:

Hope this helps, and keep up the great work :)

Lee RP Team on Oct. 31, 2019

wooo! that was a great course. my team at work uses django, so this is going to help clarify a lot of things. also, now i know how i can build a site fairly quickly :)

simon on Nov. 6, 2019

Thanks for putting this course together! it was very informative and a good introduction to Django!

brechtv6 on Nov. 24, 2019

Hey Martin, great course!

Real good introduction to get to know the basics of django. Feel like I’ve something to build further upon!

Cheers!

Martin Breuss RP Team on Nov. 26, 2019

Thanks @Lee, @simon and @brechtv6 :)

Glad you enjoyed the course and found it helpful!

eclaudio on Dec. 4, 2019

@MartinBreuss Great Work!! Great Job!!

Deeply appreciated

eclaudio on Dec. 6, 2019

@realpython @martinbreuss any recomendations with to concerns to where would be a great place to deploy this having a hard time. because of a anaconda-client==1.7.2 issue on heroku and render

Martin Breuss RP Team on Dec. 7, 2019

You could try to use https://www.pythonanywhere.com/ or DigitalOcean’s Django droplet for +/- easy deploys. Heroku should work as well. Did you remove the venv from your GitHub repo? There shouldn’t be any need to have anaconda-client up there when running it on Heroku.

pierrelaurent62 on Dec. 9, 2019

Awesome job Martin ! You didactic methods are really cool ! I’m now prepared to build my own site in Django. What would you suggest for a next step ?

Indeed, in admin part, i’ve registered my own models as per your course. But, when clicking on it, i do have Project object (1) .. Project object (n) instead of having something more readable. I’ve tried to create a class within admin.py and pass it to the register function but without success atm.

pierrelaurent62 on Dec. 9, 2019

I have it ! In models.py, i’ve added a str function which return self.title. It works with f’{self.title} - {self.description}’

Martin Breuss RP Team on Dec. 9, 2019

Thanks @pierrelaurent62 and awesome job for figuring this out!

Just for improve the clarity of what you wrote with some formatting: you can make the admin interface return better readable representations of your model objects by adding a __str__() (“dunder str”) method to each class, like so:

class Project(models.Model):

    title = models.CharField(max_length=100)
    # snip

    def __str__():
        return self.title  # or any string combo you'd like :)

Keep up the learning!

eclaudio on Dec. 11, 2019

@martinbreuss Ya I have been changing a bunch of things with this project. I removed the anaconda stuff as I have very little luck with deploying this project. I am trying render now and I might go back pythonanywhere again.

Gaurav yadav on Dec. 11, 2019

I have used a DetailView for blog_detail:****

class PostDetailView(DetailView):
   model = Post
   template_name = 'blog/post_detail.html'

and now i want populate the comment database is there any way using the same Detailview or how can i populate comment database( considering comment model have post as a foreign key) in another class?

eclaudio on Dec. 11, 2019

@martinbreuss I am currently attempting my first deploy with the hosting platform Render. My error is in the portfolio/urls.py file.When I attempt my deployment, Render will be able to produce a (this is just an example) www.mywebsite.com/projects and a www.mywebsite.com/admin page but not at www.mywebiste.com page, and this lack of urlpattern is forcing me not to be able to deploy.  Any advice on how to resolve this is deeply appreciated.

github.com/ErinClaudio/musical-octo-funicular

Martin Breuss RP Team on Dec. 13, 2019

@eclaudio if a missing page at the base URL is really the issue, I think the simplest way to go is to add a redirect() to the base URL, and point it to e.g. /projects/. Check out The Ultimate Guide to Django Redirects and implement the smallest example mentioned at first.

eclaudio on Dec. 19, 2019

@martinBreuss that was super useful, thank you.

So things are going well with the page. But the images for the projects no longer appear on the deployed site. They work just fine locally. I looked through stack overflow and found no solution, any advice?

Martin Breuss RP Team on Dec. 25, 2019

Glad it helped :)

Django can be a bit tricky for getting static files (e.g. images) served correctly in production. Did you run collectstatic and set your STATIC_ROOT directory? Check out Django’s guide on Deploying Static Files.

raymie1986 on Dec. 28, 2019

Thanks, this has got me really started with Django now :)

tsusadivyago on Jan. 2, 2020

I wanted to learn django from a long time, this just got me started. Nice Intro :)

Lokman on Jan. 9, 2020

Thanks @Martin really happy with this course! at least all my self taught python gonna have product out. Will start build something here. Gonna digging more in Django documentation there.

sumazmail on Feb. 2, 2020

Hello Martin, Thank you and your team who worked on this course! This course was really wonderful, I subscribed due to this course. I have one request. Could you cover some details on following items as part of future courses or articles? 1. How are Django front end and back end components deployed in actual production? As a single app or two separate components? 2. This sample app was developed from a development perspective. How about things to be taken care in production application?

Thanks, Suma

Martin Breuss RP Team on Feb. 2, 2020

Hello @sumazmail! Thanks for your post, and glad the course was helpful for you :)

As for your questions, let me attempt to answer as best as I can:

1. Django Deployment

I’m not entirely sure that I understand what you mean with the front-end and back-end components of Django. Django is a back-end framework, the “front-end” part of this app would maybe be the Bootstrap CSS.

You can use JavaScript front-end frameworks together with Django, but I don’t think that is what you’re asking here.

The app as you built it here can be deployed in one piece. Deployment, however, is a whole other world that can get quite complex. Not without reason there are many companies that try to take that work away from you (and let you pay for it instead :)

Heroku

When you want to try to deploy your app, I would suggest to go with Heroku first. They have a great walkthrough on Deploying Python And Django Apps On Heroku.

We also have a written guide on Migrating Your Django Project To Heroku here on Real Python that you can check out.

And MDN has also written a great guide on getting a Django app up on to Heroku in the Deployment chapter of their Django tutorial.

Digital Ocean

Another option is to set up your cloud server from the ground up and deploy your app there. This is more complex and I would suggest it only if you’re up for diving into devops and working with servers.

At the same time it will help you to better understand all the work that is involved with getting an app live on the internet and shed some light on processes that a PaaS such as Heroku takes care of for you.

Digital Ocean has a great guide on How to set up Django with Postgres and gunicorn on Ubuntu.

AWS

Same as Digital Ocean, AWS allows you to build your cloud server yourself and customize whatever you want to deploy your webapp.

If you managed to deploy your app on Digital Ocean and want to try another cloud ecosystem, or if you already have some experience using AWS, then this can be an interesting next step.

We have written guides on Deploying a Django App to AWS Elastic Beanstalk and Deploying Django + Python 3 + PostgreSQL to AWS Elastic Beanstalk that could be helpful to get you started.

Again: deployment is not easy and might take some time and a couple of tries to get more familiar with it. If you just want to get your webapp live on the internet, I’d suggest you to stick with using Heroku.

2. Django in Production

Glad you asked! :) There are indeed a couple of things you will need to take care of when working with a Django app in a production environment.

The first and foremost one is to turn DEBUGGING to False. You will also likely have to run collectstatic to get your static files ready for production.

Read over Django’s official Deployment Checklist and I’d again suggest to check out MDN’s Deployment section in their Django tutorial.

I hope these links can help you get your app deployed. Expect some frustration working through this process. That’s normal and you can do it if you stick with it and keep trying :)

sumazmail on Feb. 3, 2020

Thank you for the detailed response and reference links; I will refer these links.

On front end and back end part of the question - I got your point, it answered my question. As I worked earlier using MEAN stack, where-in front-end website can be hosted on AWS S3 and backend (NodeJS/ MongoDB) on AWS Elastic Beanstalk, I got similar doubts on Django whether the entire app needs to be deployed as a single application.

Martin Breuss RP Team on Feb. 3, 2020

Great! Glad to hear it helped :)

Yes, if you’re combining a Django back-end with a JavaScript front-end framework (such as Angular from MEAN) you could host them on different services. But you can also have them running on the same server.

I’m sure there are good reasons for splitting the delivery up like that, but keep in mind that it’s not necessary. In the end, whatever you (cloud) server architecture you choose to use, they are just a bunch of computers. You can split up services and gain some advantages, but likely also complexity.

As a rule of thumb: as long as you are working for a personal project you don’t have to deal with any of these performance optimizations. Keeping it simple when you’re getting started is the way to go IMO. Django is a great framework that can handle tons of requests just out-of-the-box, and any personal site will be well served without any further adjustments.

If you work for a company that really needs additional tweaks, they will surely know about what and why, and let you know. :)

That said, there’s nothing wrong with exploring how to optimize and prep for that job where they really need you to do it. Just as long as it’s interesting and not overwhelming, and as long as you keep in mind that it’s not necessary in order to get a solid web app up and running.

sumazmail on Feb. 3, 2020

Thank you for the clear explanation! :)

Dion Johnson on Feb. 4, 2020

Martin, thanks for a great course! Much learned and much still to learn and practice. This was my first Real Python course and I’m looking forward to the next one!!

koutsellisthemistoklis on March 4, 2020

Excelent! Just excelent! Well done Martin. Keep up the good job! I have a question, though. Is it possible to get a certification that I did this learning-path so that I can post it on my Linkedin account? (When a registered, the offer indicated that there are certifications). thank in advance! :)

Dan Bader RP Team on March 4, 2020

@koutsellisthemistoklis Yep, you can get a completion certificate for this course and all others here on Real Python. Please check out this article in our support base: Where do I find my Completion Certificates?

Nishith Singhai on April 1, 2020

This tutorial shows how to view single project. How does one view multiple projects in a single view then navigate into the projects.

Martin Breuss RP Team on April 1, 2020

Hi @Nishith Singhai. The fourth part Showcase Your Projects is all about building out an overview page that displays all projects.

sidonio on April 3, 2020

Hi everyone!

I have finally manage to get my portfolio up and running yesterday but now I have a problem loading the page.

When I open the project in PyCharm and run the server, here is what I find:

The default interactive shell is now zsh. To update your account to use zsh, please run chsh -s /bin/zsh. For more details, please visit support.apple.com/kb/HT208050.

(.env) Sidonios-MacBook-Pro:django-portfolio sidoniodossantos$ python manage.py runserver
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/sidoniodossantos/django-portfolio/.env/lib/python3.8/site-packages/django/utils/autoreload.py", line 53, in wrapper
    fn(*args, **kwargs)
  File "/Users/sidoniodossantos/django-portfolio/.env/lib/python3.8/site-packages/django/core/management/commands/runserver.py", line 109, in inner_run
    autoreload.raise_last_exception()
  File "/Users/sidoniodossantos/django-portfolio/.env/lib/python3.8/site-packages/django/utils/autoreload.py", line 76, in raise_last_exception
    raise _exception[1]
  File "/Users/sidoniodossantos/django-portfolio/.env/lib/python3.8/site-packages/django/core/management/__init__.py", line 357, in execute
    autoreload.check_errors(django.setup)()
  File "/Users/sidoniodossantos/django-portfolio/.env/lib/python3.8/site-packages/django/utils/autoreload.py", line 53, in wrapper
    fn(*args, **kwargs)
  File "/Users/sidoniodossantos/django-portfolio/.env/lib/python3.8/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/Users/sidoniodossantos/django-portfolio/.env/lib/python3.8/site-packages/django/apps/registry.py", line 122, in populate
    app_config.ready()
  File "/Users/sidoniodossantos/django-portfolio/.env/lib/python3.8/site-packages/django/contrib/admin/apps.py", line 24, in ready
    self.module.autodiscover()
  File "/Users/sidoniodossantos/django-portfolio/.env/lib/python3.8/site-packages/django/contrib/admin/__init__.py", line 26, in autodiscover
    autodiscover_modules('admin', register_to=site)
  File "/Users/sidoniodossantos/django-portfolio/.env/lib/python3.8/site-packages/django/utils/module_loading.py", line 47, in autodiscover_modules
    import_module('%s.%s' % (app_config.name, module_to_search))
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 779, in exec_module
  File "<frozen importlib._bootstrap_external>", line 916, in get_code
  File "<frozen importlib._bootstrap_external>", line 846, in source_to_code
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/Users/sidoniodossantos/django-portfolio/projects/admin.py", line 5
    admin.site.register(Project)pwd
                                ^
SyntaxError: invalid syntax

I cant seem to see what the problem migth be. Any ideas?

Best wishes, Sidonio.

Martin Breuss RP Team on April 3, 2020

Hi @Sidonio, double check your error message friend 🤗, it’s got some good tips for you here:

“/Users/sidoniodossantos/django-portfolio/projects/admin.py”, line 5 admin.site.register(Project)pwd ^ SyntaxError: invalid syntax

This gives you two essential pieces of information:

  1. Location: The file where the error occurred: projects/admin.py - and there’s even more info about which line to check out
  2. Type: The type of error, in this case a SyntaxError

Looks like some characters may have accidentally snuck their way into that file : )

sidonio on April 3, 2020

Hi @martin than you very much for the tips. I have finally managed to fix it. the problem was that I accidentally typed pwd in the admin.py but after removing it, it seems to be working fine.

Yes… i did it.

I am completely new to Web development but with this tutorial I have finally learn something valuable and this motivates me to learn even more about python web development.

Again many thanks!!!

Andrew E on April 7, 2020

Brilliant course, thanks again =)

zufrizalfatma on April 9, 2020

thank you for your course

dzhuliana on April 16, 2020

Hello!

Thank you for this amazing course - you are teaching so so well - I am really impressed by your approach! I want to continue with building the Blog but I cannot find a link to the video course. It will be super helpful if you could refer me to this course! Thank you again and never stop doing what you are doing - it’s awesome!

Martin Breuss RP Team on April 17, 2020

Hello @dzhuliana, and thanks for the nice words :)

As to your question: we don’t currently have a Part 2 for the video tutorial, but you can read more about building the Blog in the accompanying written tutorial. Hope that helps to keep you advancing in your learning :)

okorobright13 on April 21, 2020

@Martin thanks alot

Phil M on April 29, 2020

Hi @martin, thank you for a very well done and in depth mini Django course. I really did make a lot of Friends - this was something that I really need to do! :)

The light bulbs kept going on and on again, with each new section through out the course. This really helped me fill in the Django pot holes, from various other Django readings.

Younseo Roh on May 4, 2020

Hi, Martin, thank you for a great course. I’ve just finished this course and I learned a lot from here. I feel more comfortable to create a web application of my own, and would definitely like to extend this one to include blogs!

Martin Breuss RP Team on May 4, 2020

Awesome, that’s great to hear :) Go right ahead and add your blog following the written tutorial.

BlackJesus on May 6, 2020

I started 10:00 yesterday and I just finished it. On to the next one.

Vikash Prasad on May 25, 2020

Thanks Martin!! Great tutorial and i would love to see more tutorials like this.

I am back-end developer but this awesome tutorial gave to very good confident to try front end development as well :)

dec21raj on June 1, 2020

Awesome Tutorial!

Bill Sanderson on June 8, 2020

thanks for the overview…

mwong068 on June 17, 2020

Thanks so much for this tutorial Martin! You’re an amazing teacher and I do feel like error messages can be my friends now. 😊 This truly helped build on my knowledge of Python. Cheers!

himanipargaien on June 19, 2020

Great tutorial.

Mushiri on June 20, 2020

Hey there Martin! I have just completed your course, and I really liked it. I have a project to do for uni, and I had this idea but I wanted to take your suggestion if it was efficient or not. I want to create a Django project which has three apps. I want to have an Blog app, CV app, and a TO-DO app. The issue is, each will have a different HTML, so is that an efficient method?

aerojoe on June 21, 2020

Thanks Martin. Nice Course!

Martin Breuss RP Team on June 22, 2020

Thanks everyone for the nice words and glad you liked the course :)

@Mushiri: That’s definitely a good idea. You will want to have 1 Django project with 3 Django apps. They could each have their own base templates, or you could have them all inherit from a shared one. Read the comments in this discussion on more thoughts regarding that. Keep learning!

Mushiri on June 23, 2020

Thank you very much!

KoJans on June 30, 2020

Hi Martin,

Great tutorial! I just completed it;I think I’ll have to go over some parts again. But I can always use it as a reference.

Thanks!

jamescole2015 on June 30, 2020

Thanks Martin! I enjoyed the course!

richardacairns on July 15, 2020

Hi Martin, just finished the course. Thank you - I really enjoyed it.

Enrique Pelaez on July 18, 2020

I just finished the course, I was able to successfully create my portfolio! What I really liked was the debugging approach, at the beginning I have to confess that it was a little hard to grab for me, but as I made progress on the different modules it started not just to make sense, but to be very effective on quickly finding errors, actually the last 4 or 5 modules I tried first to find the error without watching the video and I can say that most of the time I did it :) … Thanks for the great experience Martin!

Martin Breuss RP Team on July 21, 2020

Hi @everyone, thanks for the nice words and glad the course had been helpful for you! 😄

It helps to go over the concepts again and again, it’ll take practice to make things really stick. I’ve worked with Django for a while and there’s still a lot of stuff I go and look up. So just keep at it and keep building out your ideas, and learn more on the way.

Think of it as going on some more trips with your error friends ;)

stephenwhite597 on July 24, 2020

Brilliant Introductory Course

After many years of been “The Server Guy” or running teams or companies that developed server based software I felt it was time, or rather I had the time to see how far the software world has progressed in Web Development and find out what exists in the Dark Side of the User Interface world.

Martins approach to this is brilliant, a clean , step by step approach reinforcing the learning all the way through the course to the very end when you have your own fully functional project that could easily be changed into many useful solutions.

No buzz words, I don’t remember the term MVC been referenced even once, I don’t even remember an If statement, so no logic either. This means that a non programmer could easily get through this course or even take this class right at the beginning of the learning path, some python syntax knowledge would be helpful but not essential.

As its summer time and I have been working hard I fancied doing an easy not too demanding course progressively throughout the week, this was perfect, kept coming back for half an hour here and there, sometimes rewinding because I had forgot exactly where I was but I enjoyed it thoroughly and may well fire off a couple of little mini projects every now and again to keep my hands in I can see me writing some nice debugging tools for some of the server side technology that I will no doubt continue to produce, I will certainly take the next course now and probably even move on and have a look at flask too.

I would say I have absorbed 99% of it a couple of places I may come back for reference as I thought at the time thats unusual but its a django thing not Martin, so don’t worry man!!

Keep up the brilliant Work!

Steve

Martin Breuss RP Team on July 24, 2020

😁 Thank you @stephenwhite597 for the kind words and great job getting through the course and planning to work on those side projects!

John Kinder on Sept. 8, 2020

While I am not new to Django, it has been a while since I worked with it, so this was excellent for refreshing my memory. It wasn’t too long and well worth the time. Thanks, Martin

Yvonne Wilmot on Sept. 15, 2020

Thanks Martin. Really enjoyed the course. Very clear and easy to understand. Love the ‘debugging’ mode as I know that’s where a lot of the time will be spent so good to know where to look.

Given me a bit of insight into web development as I’ve spent 30+ years developing on the mainframe and now need to re-skill and move on.

Going to look for the next course that I think will be helpful in getting ready for my new job of being the Python developer but more on the back-end side. :)

pavel0 on Sept. 20, 2020

Hi Martin, thank you, I really enjoy this course :)

Justice Douglas on Sept. 20, 2020

Thank you so much for constructing this course. There were certainly some learning curves, but I can now confidently put together a Django project. Really happy I stumbled across Real Python when my Python journey first began.

iwatts on Sept. 24, 2020

Hi Martin

That was an awesome tutorial - I really feel like I have learned a lot - about to start on the blog and build that out now. So much still to learn but feel confident now.

I have just one question that I hoped would be answered (and reading the comments above it might have been but would just like clarity) - at the moment if I go to the root of the site (127.0.0.1:8000) I get a page not displayed (which I understand, as we haven’t developed a url or template for it). My question though is do we develop a seperate app for that or would we create a views.py in the management app (portfolio) for a home page.

Thanks again

Ian

Martin Breuss RP Team on Sept. 24, 2020

Hi @ianwatts. Good question. It really depends and there’s no hard and clear answer to that. You can build a whole Django project only inside your management app, and many people do.

I prefer using separate apps because it makes the code more compartmentalized and potentially easier to share among different projects.

You could create a new app for your landing page, you could create a new view in your existing app that points to the empty path, or you could add the view and template right in your management app. It really depends on how you want to develop your project.

My Suggestions

  • App-Specific: If the landing page is part of the Django app you’re building, e.g., if your whole project is just about your portfolio, then add it into that specific app.
  • Signpost: If the landing page is a first hello that then allows visitors to choose to go to different pages that live in different apps of your project, then I would add it right in the management app.
  • Feature-Rich: And finally, if it is a large and involved landing page with different functionality that goes beyond just allowing visitors to find their way to different parts of your webapp, then I’d create a separate app for it.

Martin Breuss RP Team on Sept. 24, 2020

Thanks for all the nice feedback! Really glad you’re finding value in the course @John Kinder, @Yvonne Wilmot, @pavel0, @Justice Douglas and @ianwatts! :)

Become a Member to join the conversation.