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

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

<p>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</p>

<p>How can I do this all without using this existing django admin interface.</p>

[{'answer_id': 36818, 'author': 'Matthew Watson', 'author_id': 3839, 'author_profile': 'https://Stackoverflow.com/users/3839', 'pm_score': -1, 'selected': False, 'text': '<p>Follow the Django tutorial for setting up the "admin" part of an application. This will allow you to modify your database.</p>\n\n<p><a href="https://docs.djangoproject.com/en/dev/intro/tutorial02/" rel="nofollow noreferrer">Django Admin Setup</a></p>\n\n<p>Alternatively, you can just connect directly to the database using the standard tools for whatever database type you are using.</p>\n'}, {'answer_id': 36827, 'author': 'Dmitry Mukhin', 'author_id': 3448, 'author_profile': 'https://Stackoverflow.com/users/3448', 'pm_score': -1, 'selected': False, 'text': '<p>This topic is covered in <a href="https://code.djangoproject.com/wiki/Tutorials" rel="nofollow noreferrer">Django tutorials</a>.</p>\n'}, {'answer_id': 36935, 'author': 'Carl Meyer', 'author_id': 3207, 'author_profile': 'https://Stackoverflow.com/users/3207', 'pm_score': 4, 'selected': True, 'text': '<p>You will want to wire your URL to the Django <a href="https://docs.djangoproject.com/en/1.4/ref/generic-views/#django-views-generic-create-update-create-object" rel="nofollow noreferrer">create_object generic view</a>, and pass it either "model" (the model you want to create) or "form_class" (a customized <a href="https://docs.djangoproject.com/en/1.1/topics/forms/modelforms/#topics-forms-modelforms" rel="nofollow noreferrer">ModelForm</a> class).  There are a number of <a href="https://docs.djangoproject.com/en/1.4/ref/generic-views/#django-views-generic-create-update-create-object" rel="nofollow noreferrer">other arguments</a> you can also pass to override default behaviors.</p>\n\n<p>Sample URLconf for the simplest case:</p>\n\n<pre><code>from django.conf.urls.defaults import *\nfrom django.views.generic.create_update import create_object\n\nfrom my_products_app.models import Product\n\nurlpatterns = patterns(\'\',\n    url(r\'^admin/products/add/$\', create_object, {\'model\': Product}))\n</code></pre>\n\n<p>Your template will get the context variable "form", which you just need to wrap in a &lt;form> tag and add a submit button.  The simplest working template (by default should go in "my_products_app/product_form.html"):</p>\n\n<pre><code>&lt;form action="." method="POST"&gt;\n  {{ form }}\n  &lt;input type="submit" name="submit" value="add"&gt;\n&lt;/form&gt;\n</code></pre>\n\n<p>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.</p>\n'}]
['https://Stackoverflow.com/questions/36812', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2592/']