Welcome to my full tutorial series about how to build a website! I asked our instagram followers what they wanted to see from our channel in the next month and the overwhelming response was “we want to see how to make a website using Django and Python”. In this episode, we’ll talk about how to create a virtualenv for our Python dependencies and bootstrap a Django app.

This tutorial will be several parts long. I’ll go in-depth on how to create a Django server with Python, setup a database, create web pages/style them with css, and even deploy the application to the cloud.

We’re going to use four different technologies in this tutorial:
1. Django – for our web server
2. Postgres – for our database
3. Docker – to package the application
4. Kubernetes – to manage deployment in the cloud

All of the code for this project will be available on our Patreon page:
https://www.patreon.com/posts/python-django-38642815

I hope. you guys enjoy!

source

21 Comments

  1. This is a great tutorial. Not sure how you get VS to recognize the django modules in the syntax checking. Is there specific VS extension that you are using for django definitions? The one I have installed does not map the modules to a source.

  2. sooo, pyenv virtualenvs doesn't work anymore, and I cannot find an equivalent of that command for pyenv, only for conda but it's not the same… Help, anyone?

  3. Traceback (most recent call last):

    File "C:UsersMezaaDesktopmezaa_websiteenvlibsite-packagesdjangoappsconfig.py", line 244, in create

    app_module = import_module(app_name)

    File "c:usersmezaaappdatalocalprogramspythonpython37libimportlib__init__.py", line 127, in import_module

    return _bootstrap._gcd_import(name[level:], package, level)

    File "<frozen importlib._bootstrap>", line 1006, in _gcd_import

    File "<frozen importlib._bootstrap>", line 983, in _find_and_load

    File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked

    ModuleNotFoundError: No module named 'accounts'

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):

    File "manage.py", line 22, in <module>

    main()

    File "manage.py", line 18, in main

    execute_from_command_line(sys.argv)

    File "C:UsersMezaaDesktopmezaa_websiteenvlibsite-packagesdjangocoremanagement__init__.py", line 419, in execute_from_command_line

    utility.execute()

    File "C:UsersMezaaDesktopmezaa_websiteenvlibsite-packagesdjangocoremanagement__init__.py", line 395, in execute

    django.setup()

    File "C:UsersMezaaDesktopmezaa_websiteenvlibsite-packagesdjango__init__.py", line 24, in setup

    apps.populate(settings.INSTALLED_APPS)

    File "C:UsersMezaaDesktopmezaa_websiteenvlibsite-packagesdjangoappsregistry.py", line 91, in populate

    app_config = AppConfig.create(entry)

    File "C:UsersMezaaDesktopmezaa_websiteenvlibsite-packagesdjangoappsconfig.py", line 250, in create

    app_config_class.__qualname__,

    django.core.exceptions.ImproperlyConfigured: Cannot import 'accounts'. Check that 'mezaa_website.apps.accounts.apps.AccountsConfig.name' is correct.

  4. How do I delete virtualenvs created this way? I accidentally used the wrong version. I have been googling for literally 2 hours and cannot find an answer. I want to remove every virtualenv I created and start from scratch. please help

  5. What I am curious about is why do all this when you can use HTML and PHP and JavaScript and do literally NO configuration? There is so much work just to get to the point where you can start coding a website with these techs. You have to learn command line just to get started. Even Node.js is easier to get started with. So what is the benefit other than a semantic language?

Leave A Reply

Please enter your comment!
Please enter your name here