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 35615
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T14:15:49+00:00 2026-05-10T14:15:49+00:00

Currently, I am writing up a bit of a product-based CMS as my first

  • 0

Currently, I am writing up a bit of a product-based CMS as my first project.

Here is my question. How can I add additional data (products) to my Product model?

I have added ‘/admin/products/add’ to my urls.py, but I don’t really know where to go from there. How would i build both my view and my template? Please keep in mind that I don’t really know all that much Python, and i am very new to Django

How can I do this all without using this existing django admin interface.

  • 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. 2026-05-10T14:15:50+00:00Added an answer on May 10, 2026 at 2:15 pm

    You will want to wire your URL to the Django create_object generic view, and pass it either ‘model’ (the model you want to create) or ‘form_class’ (a customized ModelForm class). There are a number of other arguments you can also pass to override default behaviors.

    Sample URLconf for the simplest case:

    from django.conf.urls.defaults import * from django.views.generic.create_update import create_object  from my_products_app.models import Product  urlpatterns = patterns('',     url(r'^admin/products/add/$', create_object, {'model': Product})) 

    Your template will get the context variable ‘form’, which you just need to wrap in a <form> tag and add a submit button. The simplest working template (by default should go in ‘my_products_app/product_form.html’):

    <form action='.' method='POST'>   {{ form }}   <input type='submit' name='submit' value='add'> </form> 

    Note that your Product model must have a get_absolute_url method, or else you must pass in the post_save_redirect parameter to the view. Otherwise it won’t know where to redirect to after save.

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

Sidebar

Ask A Question

Stats

  • Questions 73k
  • Answers 73k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer You could call an executable from Java to do the… May 11, 2026 at 2:10 pm
  • added an answer Edit: Yes, it is true that versions 5.n and 6.n… May 11, 2026 at 2:10 pm
  • added an answer I like setting a status_id and creating a lookup table… May 11, 2026 at 2:10 pm

Related Questions

I am writing a script which is likely to be modified by users. Currently
I am currently writing a simple, timer-based mini app in C# that performs an
I am currently writing a small calendar in ASP.Net C#. Currently to produce the
I am currently writing a little bootstrap code for a service that can be
I am writing a program that will draw a solid along the curve of
I am currently working on a project with which I need to program up
I'm writing my first app with ASP.NET MVP (attempting Supervisory Controller) and Unit Testing
I am writing a Firefox extension. I would like to search the current webpage

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.