Git Product home page Git Product logo

yeazin / multi-authors-advanced-django-blog Goto Github PK

View Code? Open in Web Editor NEW
35.0 2.0 16.0 57.67 MB

MultiAuthor Web Application. This project is made by the popular python web framework Django. Feel free to give reviews. Cheers !!!

Home Page: http://yeazin.github.io/Multi-Authors-advanced-Django-Blog

License: MIT License

Python 4.78% CSS 40.61% HTML 43.35% JavaScript 11.27%
django-multi-author-blog multi-author-blog python-django yeazin frontend-login register-user-frontend multi-authors mundana-bootstrap-blog django-blog django-advanced-blog-github

multi-authors-advanced-django-blog's Introduction

GitHub WidgetBox

LinkedIn Gmail Facebook Discord Twitter

Hi I am Yeasin ๐Ÿ’‡โ€โ™‚๏ธ , a passoniate Fullstack deveolper from Bangladesh.I am a Self-taught software Developer. I have a profound knowledge in Django, Javascript & Rest Framework. I love to work with new Technologies and like to learn new things everytime .

Github stats

Top Langs

Technologies I like to work with โค๏ธ

python django css javascript React bootstrap css vscode docker
pycahrm git bash linux sql debian Posql wordpress html5

Yeasin`s github activity graph

My Projects ๐Ÿ“



Let's colab ๐Ÿš€

๐ŸŒŸ I'm always open to collaborating on exciting projects and ideas. If you share similar interests or have a project you'd like to work on together, feel free to reach out on the socials below!

E-mail WhatsApp LinkedIn


multi-authors-advanced-django-blog's People

Contributors

rahulsust avatar shaishguni avatar yeazin 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

Watchers

 avatar  avatar

multi-authors-advanced-django-blog's Issues

ImportError: cannot import name 'url' from 'django.conf.urls'

Description of the bug
After upgrading Django to version 4.2.1, an import error occurs when running the server. The error message states:
File "Multi-Authors-advanced-Django-Blog/src/urls.py", line 4, in <module> from django.conf.urls import url ImportError: cannot import name 'url' from 'django.conf.urls' (/home/username/blog/.env/lib/python3.11/site-packages/django/conf/urls/__init__.py)

To Reproduce
Steps to reproduce the behavior:

  1. Upgrade Django to the latest version (django==4.2.1).
  2. Run the server.
  3. Observe the import error.

Expected behavior
The server should run successfully without any import errors after upgrading Django to version 4.2.1.

solution
In Django 4.0 and above, the url function has been deprecated and replaced with the path function. To resolve the import error, you need to update the code in the Multi-Authors-advanced-Django-Blog/src/urls.py file.

Replace the line from django.conf.urls import url with the following line:

from django.urls import path

since the above line is already imported all you need is to remove this line
from django.conf.urls import url

Make sure to update any URLs defined using the old url function to use path instead. This change is necessary due to the deprecation of the url function in Django 4.0 and above.

Warning: Auto-created primary key used without defining a primary key type in Django models

Warning description
When running the project, the following warning messages are displayed:

WARNINGS: blog.Blog: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'. HINT: Configure the DEFAULT_AUTO_FIELD setting or the BlogConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'. blog.Category: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'. HINT: Configure the DEFAULT_AUTO_FIELD setting or the BlogConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'. blog.Comment: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'. HINT: Configure the DEFAULT_AUTO_FIELD setting or the BlogConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'. ...

To Reproduce
Steps to reproduce the behavior:

  1. Run the project.
  2. Observe the warning messages mentioned above.

Expected behavior
The project should not display any warning messages regarding the auto-created primary key.

Solution
To address these warnings, you can add the following line to your settings.py file:

DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'

This configuration specifies the default auto field type as BigAutoField, which is a subclass of AutoField. By setting this value, you indicate that you want to use BigAutoField as the primary key type for the affected models (e.g., Blog, Category, Comment, etc.).

Adding this line to your settings.py file should resolve the warnings related to the auto-created primary key.

NoReverseMatch at / Reverse for 'single_blog' with arguments '(16,)' not found. 1 pattern(s) tried: ['blog/<int:id>/']

I have two bugs with NoReverseMatch at / Reverse for 'single_blog' with arguments '(16,)' not found errors for templates header.html and index.html.

<a href="{% url 'single_blog' first.id %}" class="btn btn-dark">Read More</a>

{% for cat in catagory %}
                    
                    <li class="nav-item">
                    <a class="nav-link" href="{% url 'catagory' cat.slug %}">{{ cat }}</a>
                    </li>
                    
                {% endfor %}

and index.html at line 17. Can you please help with this?

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.