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 views. 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.2.tar.gz
.
File metadata
- Download URL: django-startcbv-0.2.2.tar.gz
- Upload date:
- Size: 13.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 62b7276d2e8d117230cf9ee5873d467430044d9946be28b0a43fc3aaec0ff568 |
|
MD5 | ceeed680858f7de41dc8b01d9f9303d2 |
|
BLAKE2b-256 | 36e45cefa5dcda66bf2a1c0df49f2f40506c620c46448f65d3afb232ba949bf5 |
File details
Details for the file django-startcbv-0.2.2.macosx-10.7-x86_64.exe
.
File metadata
- Download URL: django-startcbv-0.2.2.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 | 6127c7118110b69de8449b2ec37391944bca52ffb76b8a6184593e8e2d081e46 |
|
MD5 | a01c02cce968938401e83505faa6ef70 |
|
BLAKE2b-256 | 3a397e508cab35cad8c42c4835933ecb3970563c3e449718a3a94f124bf95a4b |