GithubHelp home page GithubHelp logo

skan90 / alura-space-django Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 5.75 MB

Repository containing the code for for the Alura course: Django - Templates and Good Practices

License: MIT License

Python 2.78% CSS 45.43% JavaScript 46.98% HTML 4.81%

alura-space-django's Introduction

Alura Space Django Course

Welcome to my personal repository for the Alura course on Django - Templates and Good Practices. Here, I've documented the code and resources related to the course for my reference.

Course Overview

In this Python web course, I will:

  • Learn practical aspects of how Django works.
  • Create environment variables efficiently using Python.
  • Understand the concepts of Templates and page rendering in Django.
  • Maintain good programming practices in Django projects.
  • Build my own web applications using the Python language.

Course Content

Getting Started

  • Introduction to Django 4, its history, and key framework aspects.
  • Setting up a virtual development environment with virtualenv.
  • Creating a Django project using the django-admin startproject setup command.
  • Launching the development server with the python manage.py runserver command.
  • Configuring project timezone and language in the settings.py file.
  • Enhancing project security by protecting the SECRET_KEY and using the python-dotenv package with a .env file.
  • Uploading the project to a remote GitHub repository and creating a .gitignore file to exclude sensitive data.

Building My First App

  • Understanding the difference between projects and apps in Django.
  • Creating my first app using the python manage.py startapp gallery command.
  • Creating a custom web page by configuring routes in the views.py and urls.py files.
  • Implementing the best practice of creating a separate urls.py file for each app.
  • Isolating the template for the gallery app by creating a new folder called templates and reconfiguring settings.py.

Organizing Static Files and Improving UI

  • Organizing static files better by creating indicator folders for each app within the templates folder.
  • Using embedded Python code within HTML files with Jinja2.
  • Implementing a new custom HTML template along with various static files to improve my site's appearance.

Embracing the DRY Principle

  • Learning about the DRY (Don't Repeat Yourself) principle and applying it by creating a base.html file to avoid code repetition in multiple templates.
  • Using Partial templates to further follow the DRY principle, reducing code duplication.

Getting Started

To get started clone this repository to your local machine, make sure you have Python installed on your system. Any other requirements (including Django) can be installed using the requirements.txt in the root directory from this project with the command:

pip install -r requirements.txt

After all requirements are installed, you can run the project server from the root directory with the command:

python manage.py runserver

License

This code is provided under the MIT License. Feel free to use it for your learning and development purposes. Happy learning!

alura-space-django's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.