Giter Site home page Giter Site logo

packtpublishing / django-3-web-development-cookbook-fourth-edition Goto Github PK

View Code? Open in Web Editor NEW
174.0 19.0 98.0 788 KB

Django 3 Web Development Cookbook Published by Packt

License: MIT License

Shell 1.42% Dockerfile 0.12% Python 71.66% HTML 14.00% JavaScript 5.28% CSS 1.15% Makefile 0.68% Batchfile 0.53% Jinja 5.15%

django-3-web-development-cookbook-fourth-edition's Introduction

Django-3-Web-Development-Cookbook

Django 3 Web Development Cookbook Published by Packt

Download a free PDF

If you have already purchased a print or Kindle version of this book, you can get a DRM-free PDF version at no cost.
Simply click on the link to claim your free PDF.

https://packt.link/free-ebook/9781838987428

django-3-web-development-cookbook-fourth-edition's People

Contributors

archatas avatar dependabot[bot] avatar mjwhittemore avatar packt-itservice avatar packtutkarshr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-3-web-development-cookbook-fourth-edition's Issues

static files blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).

When I run this project Chapter 8 on localhost on login page I get this type of error on loading static files in browser. Any suggestion how to solve this ?

The resource from “http://localhost:8000/static/admin/css/base.css” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
The resource from “http://localhost:8000/static/admin/css/responsive.css” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
The resource from “http://localhost:8000/static/admin/css/dashboard.css” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).

AttributeError: 'NoneType' object has no attribute 'replace', chapter 2

Hi,
I'm running into some errors when I try to run chapter 2, on Ubuntu 20.10:

File "/home/[user_name]/DjangoProjects/ch03/myproject_virtualenv/src/django-myproject/myproject/apps/search/multilingual_whoosh_backend.py", line 31, in __init__
    lang_code_underscored = translation.get_language().replace("-", "_")

I simply don't know what's going on... Does Django changes so much on each newer release?

MultilingualField and MultilingualCharField

Hi,

Implementing MultilingualField and MultilingualCharField as abstract base classes and using them as mixins for various models is really very useful, thank you very much for this insight in the book. Yet, a small trick would be even more fruitful; right now is there the default language set in the settings is "en", and if there are two languages of application defined as "en" and "de" and if we name the model field as "title", what the method does is producing "title_en" and "title_de" fields into the DB. Instead, if we create only the marginal languages on top of the default one, it will be super helpful in many places throughout the application. What I mean is the following:

LANGUAGE_CODE = "en"

LANGUAGES = [
("en", "English"),
("de", "German"),

Model field name = "title"

-> Create the following fields in the DB: "title" and "title_de". No, "title_en" as it is the name given for the primary language anyway.

Unfortunately I've found the relevant django classes used in the book very complicated and could not do this by myself.

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.