Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8872377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:12:28+00:00 2026-06-14T18:12:28+00:00

I am making a blog with django. I have an entry class, with title,

  • 0

I am making a blog with django. I have an entry class, with title, content, publish date, etc.

The date field should save the date when the entry was created. But it changes if I edit the entry(If i changes the content or the title)

This is the code of the model:

class Entry(models.Model):
    title = models.CharField(max_length=70)
    content = models.TextField()
    pub_date = models.DateTimeField(auto_now=True)
    image = models.TextField()
    tags = models.ManyToManyField(Tag)

    def __unicode__(self):
        return self.title

    class Admin:
        pass

    class Meta:
        ordering = ['-pub_date',]
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T18:12:29+00:00Added an answer on June 14, 2026 at 6:12 pm

    Change auto_now to auto_now_add.

    From django docs:

    DateField.auto_now

    Automatically set the field to now every time the object is saved.
    Useful for “last-modified” timestamps. Note that the current date is
    always used; it’s not just a default value that you can override.

    DateField.auto_now_add

    Automatically set the field to now when the object is first created.
    Useful for creation of timestamps. Note that the current date is
    always used; it’s not just a default value that you can override.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm making a weblog site in Django. I have a Blog model like this:
I dive into Django making blog. The problem is that after rendering view there
I am making a blog and store the publishing date of a blog post
I am making a daily counter for a blog and I have problem with
I'm making a php website that should be able to post to wordpress blog
I am playing with making a blog. I would like to have several types
Let's say we're making a blog. Usually, the models look like this: class User
So I have been using blog in blog on my localhost before making it
I have created a random blog post link on my site and the code
I'm considering making something similar to Failblog using Django. That is, a blog where

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.