An open API service indexing awesome lists of open source software.

https://github.com/drklrd/django-cbvs

Django Class Based Views(CBV) tryouts
https://github.com/drklrd/django-cbvs

Last synced: 24 days ago
JSON representation

Django Class Based Views(CBV) tryouts

Awesome Lists containing this project

README

          

# Django Class Based Views(CBV) tryouts.

### Create project

```
django-admin startproject djangotryout
```

### Create app

```
python manage.py startapp firstapp
```

### Register models changes to your application

```
python manage.py makemigrations first_app
```

### Run migration

```
python manage.py migrate
```

#### Run Shell

```
python manage.py shell
```

```
Python 3.5.2 (default, Nov 17 2016, 17:05:23)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from first_app.models import Topic
>>> print(Topics.objects.all())
Traceback (most recent call last):
File "", line 1, in
NameError: name 'Topics' is not defined
>>> print(Topic.objects.all())

>>> t = Topic(top_name="Adventure")
>>> t.save()
>>> print(Topic.objects.all())
]>
>>>

```

#### Create super user
```
python manage.py createsuperuser
```

#### Install Faker

```
pip install Faker
```

#### Install bcrypt

```
pip install bcrypt
pip install 'django[argon2]'
```

#### Install pillow (for image)

```
pip install pillow
```