Coder Social home page Coder Social logo

gilly7 / djangofilmscrud Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fabricius1/djangofilmscrud

0.0 0.0 0.0 10 KB

Companion GitHub Repository for my Medium article "Build a Django CRUD App by Using Class-Based Views"

License: Other

Python 58.65% HTML 41.35%

djangofilmscrud's Introduction

DJANGO FILMS CRUD TUTORIAL COMPANION CODE


Author: Fabrício Barbacena



Project Description


This repository has the final version of the code I developed in my article/tutorial Build a Django CRUD App by Using Class-Based Views.

I'm putting together this present repository so that it can be used as starter code for future projects of mine. People can also find here the templates code I mentioned in my article.


How to Install the Project


  1. You need to have Python installed in your machine (3.8 or higher is recommended);

  2. Create a new folder in your machine, go inside it and clone this repository.

  3. Create a virtual environment with venv. I called mine .myenv, but you can choose another name you prefer:

python -m venv .myenv

  1. Activate the virtual environment. Below is the command for most Linux OS:

source .myenv/bin/activate

Check this Python documentation page if you have doubts about the command to start your virtual environment.

  1. Install the required Python modules (django and django-extensions):

pip install -r requirements.txt

IMPORTANT NOTE: The file settings.py is using a secret key setup with the configparser builtin Python module. So:

  1. Change the name of config_file_starter.ini to config_file.ini

  2. activate the Django shell:

python manage.py shell

  1. In the Django shell, execute the following code to generate a new secret key for your project:

from django.core.management.utils import get_random_secret_key print(get_random_secret_key())

  1. Copy the new secret key and paste it inside your config_file.ini file, replacing the PutYourSecretKeyHereWithoutQuotationMarks information. Don't use quotation marks here.

  2. Run python manage.py makemigrations and python manage.py migrate to create the necessary tables in the database;

  3. If you want your films app to be populated with a list of Pixar movies, you can also run this command:

python manage.py runscript load_pixar


How to Use the Project


  1. Start the local server with python manage.py runserver. 8000 is the default port used by Django;

  2. On your browser, access the address http://localhost:8000;

  3. Explore the Films CRUD funcionalities:

  • list all films;
  • list details from one film;
  • create a new film;
  • update and delete a film.

Licence


This project is distributed under the MIT licence (see the LICENCE document).

djangofilmscrud's People

Contributors

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