Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/mynul-islam-madhurjo/project-django-blog

Blog CMS Site with Django
https://github.com/mynul-islam-madhurjo/project-django-blog

Last synced: about 1 month ago
JSON representation

Blog CMS Site with Django

Awesome Lists containing this project

README

        

# My Django Project

This repository contains a Django project named "myblogsite."

## Prerequisites

- Python 3.9 installed on your system.

## Getting Started

1. Clone this repository to your local machine:

```
git clone
```

2. Create a virtual environment and activate it:

```
python -m venv myenv
source myenv/bin/activate # On macOS and Linux
source myenv/Scripts/activate # On Windows
```
3. Install Django:
```
pip install django==2.1.5
```
4. Navigate to the project directory:
```
cd myblogsite
```
5. Run the development server:
```
python manage.py runserver

```
## Other Useful Commands

6. Migrate Database:
```
python manage.py migrate

```
7. Create Superuser:
```
python manage.py createsuperuser

```

8. Create Component
```
python manage.py startapp componentName

```

9. New App migration
```
python manage.py makemigrations

```
## Create Model Objects Commands

10. Creating objects in shell
```
python manage.py shell
#shell
from products.models import Product
Product.objects.all()
Product.objects.create()

```

11. Get a data from database with id
```
python manage.py shell
#shell
from products.models import Product
Product.objects.get(id=1)

```

Access your project in a web browser at http://127.0.0.1:8000/.