Giter Club home page Giter Club logo

drf-images's Introduction

Django 4.2 Tasks Web App

Table of Contents

SetUp

Virtual environment

python -m venv venv

or install virtualenv and

virtualenv env

You can use pip to install the requirements.txt packages

pip install requirements.txt -r

In settings.py, you need a SECRET_KEY, you can get one with Django's

from django.core.management.utils import get_random_secret_key

You can delete "db.sqlite3" if you want to make a new one, to then make migrations

python manage.py makemigrations
python manage.py migrate

or connect your postgres/mysql here

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',   # change this "django.db.backends.postgresql"
        'NAME': BASE_DIR / 'db.sqlite3',          # change
        
#        "USER": "",
#        "PASSWORD": "",
#        "HOST": "",
#        "PORT": "",
    }
}

Create a superuser

python manage.py createsuperuser

In settings.py you can replace cloudinary for media files with your service of choice

# installed apps
    'cloudinary',
    'cloudinary_storage',
#    ...
CLOUDINARY_STORAGE = {
  "CLOUD_NAME": os.getenv('CN'),
  "API_KEY": os.getenv('AK'),
  "API_SECRET": os.getenv('AS'),
  "secure":True
}
CLOUDINARY_STORAGE = {
  "CLOUD_NAME": os.getenv('CN'),
  "API_KEY": os.getenv('AK'),
  "API_SECRET": os.getenv('AS'),
  "secure":True
}

MEDIA_URL = '/media/'
STORAGES = {
    "default": {
        "BACKEND": 
            # "django.core.files.storage.FileSystemStorage",
            "cloudinary_storage.storage.MediaCloudinaryStorage",
  },
    "staticfiles": {
        "BACKEND":
            "django.contrib.staticfiles.storage.StaticFilesStorage",
            # "whitenoise.storage.CompressedManifestStaticFilesStorage",
  }
}

send_mail configuration

EMAIL_HOST = 'smtp-mail.outlook.com'
EMAIL_PORT = '587'
EMAIL_HOST_USER = os.getenv('HOSTEMAIL')      #  credentials
EMAIL_HOST_PASSWORD = os.getenv('HOSTPASS')   #  credentials
EMAIL_USE_TLS = True
# EMAIL_USE_SSL = True

Introduction

  • Classic to do app, this time making use of the django rest framework, to create api endpoints for the CRUD features. Basic relationships between Task, Memberships and Team models, using foreign keys.
  • Django session authentication.

drf-images's People

Contributors

fraanab avatar

Stargazers

 avatar

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.