Management command to start an app with class-based views.
Project description
Installation
Add django-startcbv==0.1 to requirements.txt, then just:
pip install -r requirements.txt
Usage
Create a base.html template in templates/base.html. It should contain a title and a content block, like this:
<html> <head> <title> {% block title %}{% endblock %} </title> <body> {% block content %}{% endblock %} </body> </html>
Add the “startcbv” app to INSTALLED_APPS in settings.py:
INSTALLED_APPS = ( ... 'startcbv', )
For all of the following steps, replace “things” with the name of the app that you wish to create:
python manage.py startcbv things
If you’re done using startcbv, you can remove it from INSTALLED_APPS now; otherwise, leave it in to create more class-based view apps. Add your “things” app to INSTALLED_APPS in settings.py.:
INSTALLED_APPS = ( ... 'things', )
Add your “things” app URL pattern to urls.py:
url(r'^things/', include('things.urls')),
Then:
python manage.py syncdb python manage.py runserver
License
This code is licensed under the MIT License.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file django-startcbv-0.2.3.tar.gz
.
File metadata
- Download URL: django-startcbv-0.2.3.tar.gz
- Upload date:
- Size: 13.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d8acfce67b774ea6078ac68d47b034aaf3e12b2d2c40b53ac118c444043f1d6 |
|
MD5 | 92afbae4da04b85491789f3c80d89779 |
|
BLAKE2b-256 | f5507197962072df76e2b2d6b7d5a766f8afd4650ca8c3b85cd67d2980ff44cc |
File details
Details for the file django-startcbv-0.2.3.macosx-10.7-x86_64.exe
.
File metadata
- Download URL: django-startcbv-0.2.3.macosx-10.7-x86_64.exe
- Upload date:
- Size: 73.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 69de38539057376287e9b8a2bc5b116679dcb5482b5214aaf844fd6aa09b2969 |
|
MD5 | 7d62c648e5effe96902f78f319299a5c |
|
BLAKE2b-256 | b22a2562e9ded29cf7e7481738fff07fd34adf45a574de370f5f8562a477a598 |