Giter Club home page Giter Club logo

djangoapp's Introduction

DjangoApp

Scaffold for Django application web framework (Python) on Windows. A few steps to start coding with VsCode or VSCodium.

Django is a high-level Python web framework that encourages rapid development and clean, pragmatic design. Built by experienced developers, it takes care of much of the hassle of web development, so you can focus on writing your app without needing to reinvent the wheel. It’s free and open source.

Powershell & Project Directory

pwsh --version
PowerShell 7.3.4

pwd
Path
----
C:\codes\PYTHON\pyRepos\djangoVsCode

Install VsCode or VSCodium

Install Python

Install virtualenv

Virtualenv is a tool to create isolated Python environments.

Install

Create venv

python -m venv C:\codes\PYTHON\pyRepos\djangoVsCode

Activate venv

c:/codes/PYTHON/pyRepos/djangoVsCode/Scripts/Activate.ps1

Python version

python --version
Python 3.11.1  

Deactivate

Just deactivate on exit code session

Install Django

pip install django
python -m django --version
4.2.1

Creation django app

django-admin startproject mysite

Configure VSCode to serve app

Step 1. Install following plugins

  • Python (by microsoft)
  • Live Server

Step 2. Set python version to your virtual env by following these steps in bullets in order

  1. Press CTRL+SHIFT+P This will open a command pallet in vscode.
  2. Set the python version by selecting if it is visible in the dropdowns or by typing it like Python > <path-to-venv>/bin/python
  3. create launch.json (normally it is automatically created when you press run button so first press run and see if it runs or not and then check or create launch.json)
  4. add this as contents of launch.json

thx: noobsnoob.blogspot.com

exemple:

{
  // Utilisez IntelliSense pour en savoir plus sur les attributs possibles.
  // Pointez pour afficher la description des attributs existants.
  // Pour plus d'informations, visitez : https://go.microsoft.com/fwlink/?linkid=830387
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Python : My Django",
      "type": "python",
      "request": "launch",
      "program": "${workspaceFolder}/mysite/manage.py",
            "args": [
                "runserver",
                "--noreload"
            ],
            "django": true,
            "justMyCode": true
    }
  ]
}

F5

Migrations

Ctrl + C and :

python manage.py migrate

Migrate

Migrate

F5 again :

It works

The install worked successfully! Congratulations!

Ctrl + C & make a requirements.txt

pip freeze > requirements.txt

type .\requirements.txt
asgiref==3.7.2
Django==4.2.1
sqlparse==0.4.4
tzdata==2023.3

Wanna just docs ?

Coding

If you want a .gitignore file


# Source file location (github .gitignore for python)
$source = 'https://raw.githubusercontent.com/github/gitignore/main/Python.gitignore'
# Destination to save the file (Your project)
$destination = 'C:\codes\PYTHON\pyRepos\djangoVsCode\.gitignore'
#Download the file
Invoke-WebRequest -Uri $source -OutFile $destination

... Hey wizards, do magic things now ;)

djangoapp's People

Watchers

rnek0 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.