Skip to content

Commit 9065f70

Browse files
authored
Merge pull request #15 from Animesh-Ghosh/windows-branch
Updated README and CONTRIBUTING.
2 parents a15b2e4 + ba2e151 commit 9065f70

4 files changed

Lines changed: 112 additions & 121 deletions

File tree

CONTRIBUTING.md

Lines changed: 16 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -5,65 +5,28 @@
55
The following is a set of guidelines for contributing to tutorialdb. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request.
66

77
## Table of Contents
8-
1. [About the Project](#about-the-project)
9-
2. [Getting Started](#getting-started)
10-
3. [Submitting Pull Request](#submitting-pull-request)
118

12-
# About the Project
13-
- **tutorialdb** is a small scale search engine for programming/dev tutorials, it is meant to help anyone who is getting started to learn a new technology.
14-
- The sole purpose of tutorialdb is to help people get to resoures which might help them learn new things for e.g sometimes there are tutorials on personal blogs which do not get indexed in google easily.
15-
- All the content (tutorials) is owned by the respective authors/sites.
16-
- tutorialdb maintains its own database saving the links to tutorials and some meta info.
9+
1. [Getting Started](#getting-started)
10+
2. [Submitting Pull Requests](#submitting-pull-requests)
1711

1812
# Getting Started
19-
- Make sure you communicate using github issues while submitting a PR or reporting bugs.
20-
- Feel free while asking doubts, just open an [issue](https://github.com/Bhupesh-V/tutorialdb/issues/new).
21-
22-
# Submitting Pull Request
23-
Follow below steps while submitting a PR.
24-
25-
1. Create your own branch(never commit to master).
26-
2. Follow the below steps to setup development environment.
27-
- Create virtual environment.
2813

29-
**Linux/macOS**
30-
```bash
31-
virtualenv -p python3 venv && cd venv && source bin/activate
32-
```
33-
34-
**Windows:**
35-
```batch
36-
python -m venv venv && venv\Scripts\activate.bat
37-
```
14+
- Make sure you communicate using GitHub issues while submitting a PR or reporting bugs.
15+
- You can use an appropriate label to label the issue.
16+
- Feel free while asking doubts, just open an [issue](https://github.com/Bhupesh-V/tutorialdb/issues/new).
3817

39-
- Clone the repository.
40-
```bash
41-
git clone https://github.com/Bhupesh-V/tutorialdb.git
42-
```
18+
# Submitting Pull Requests
4319

44-
- Install dependencies.
45-
```bash
46-
pip install -r requirements.txt
47-
```
20+
Follow the steps below while submitting a PR.
4821

49-
- Migrate tables.
50-
```bash
51-
python manage.py migrate
52-
```
22+
1. Create your own branch (never commit to master).
23+
2. Setup the development environment by following the [Installation](README.md#installation-) instructions.
24+
3. Run the development server.
5325

54-
- Set up `SECRET_KEY`
55-
1. Run `python manage.py shell`
56-
2. Do
57-
```python
58-
>>> from django.core.management.utils import get_random_secret_key
59-
>>> get_random_secret_key()
60-
'[GENERATED KEY]'
61-
```
62-
3. Set this key in your Virtual Environment Variables.
26+
```bash
27+
python manage.py runserver
28+
```
6329

64-
- Run server.
65-
```bash
66-
python manage.py runserver
67-
```
68-
3. Make your changes
69-
4. Push your changes to the branch.
30+
4. Make your changes.
31+
5. Push your changes to your branch.
32+
6. Create a Pull Request against the master branch.

README.md

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,22 @@
11
# tutorialdb
2+
23
> A search engine for programming/dev tutorials.
34
45
[![CodeFactor](https://www.codefactor.io/repository/github/bhupesh-v/tutorialdb/badge)](https://www.codefactor.io/repository/github/bhupesh-v/tutorialdb)
56

6-
## Installation 🔮
7+
## Table of Contents
8+
9+
1. [About the Project](#about-the-project)
10+
2. [Installation](#installation-)
11+
12+
# About the Project
13+
14+
- **tutorialdb** is a small scale search engine for programming/dev tutorials, it is meant to help anyone who is getting started to learn a new technology.
15+
- The sole purpose of tutorialdb is to help people get to resoures which might help them learn new things for e.g sometimes there are tutorials on personal blogs which do not get indexed by Google easily.
16+
- All the content (tutorials) is owned by the respective authors/sites.
17+
- tutorialdb maintains its own database saving the links to tutorials and some meta info.
18+
19+
# Installation 🔮
720

821
1. Create virtual environment.
922

@@ -29,30 +42,44 @@ git clone https://github.com/Bhupesh-V/tutorialdb.git
2942
pip install -r requirements.txt
3043
```
3144

45+
4. Set-up virtual environment variables.
46+
47+
1. Run `python manage.py shell`
48+
2. Do
49+
```python
50+
>>> from django.core.management.utils import get_random_secret_key
51+
>>> get_random_secret_key()
52+
'[GENERATED KEY]'
53+
```
54+
3. Create a file named only `.env` in the same directory as `settings.py` and put the `[GENERATED_KEY]` as your `SECRET_KEY`.
55+
4. You may also put your local machine's IP address as the `LOCAL_HOST` in the `.env` file.
56+
5. Uncomment the appropriate variables in the `settings.py` file.
57+
58+
__Note:__ Put both the virtual environment variables as strings (ie within quotes).
59+
3260
4. Migrate tables.
3361

3462
```bash
3563
python manage.py migrate
3664
```
3765

38-
5. Run server.
66+
5. Run the development server.
3967

4068
```bash
4169
python manage.py runserver
4270
```
4371

44-
45-
## 📝 License
72+
# 📝 License
4673

4774
This project is licensed under the MIT License. See the [LICENSE.md](LICENSE) file for details.
4875

49-
## Author
76+
# Author
5077

5178
👥 **Bhupesh Varshney**
5279

5380
- Twitter: [@bhupeshimself](https://twitter.com/bhupeshimself)
5481
- Github: [@Bhupesh-V](https://github.com/Bhupesh-V)
5582

56-
## 👋 Contributing
83+
# 👋 Contributing
5784

58-
Please read the [CONTRIBUTING](CONTRIBUTING.md) for the process for submitting pull requests to us.
85+
Please read the [CONTRIBUTING.md](CONTRIBUTING.md) file for the process of submitting pull requests to us.

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
Django==2.2.3
22
requests==2.18.4
33
beautifulsoup4==4.7.1
4+
lxml==4.4.0
45
djangorestframework==3.10.0
56
python-dotenv==0.10.3

tutorialdb/settings.py

Lines changed: 61 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -5,70 +5,70 @@
55
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
66
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
77

8-
SECRET_KEY = os.environ['SECRET_KEY']
8+
# SECRET_KEY = os.environ['SECRET_KEY']
99

1010
DEBUG = True
1111

1212
ALLOWED_HOSTS = [
13-
'127.0.0.1',
14-
os.environ['LOCAL_HOST'], # your local IP to test the site on your network,
15-
'tutorialdb.pythonanywhere.com',
16-
]
13+
'127.0.0.1',
14+
# os.environ['LOCAL_HOST'], # your local IP to test the site on your network,
15+
'tutorialdb.pythonanywhere.com',
16+
]
1717

1818
# Application definition
1919

2020
INSTALLED_APPS = [
21-
'django.contrib.admin',
22-
'django.contrib.auth',
23-
'django.contrib.contenttypes',
24-
'django.contrib.sessions',
25-
'django.contrib.messages',
26-
'django.contrib.staticfiles',
27-
'rest_framework',
28-
'app',
29-
'api',
30-
'taggie',
21+
'django.contrib.admin',
22+
'django.contrib.auth',
23+
'django.contrib.contenttypes',
24+
'django.contrib.sessions',
25+
'django.contrib.messages',
26+
'django.contrib.staticfiles',
27+
'rest_framework',
28+
'app',
29+
'api',
30+
'taggie',
3131
]
3232

3333
REST_FRAMEWORK = {
34-
'DEFAULT_THROTTLE_CLASSES': [
35-
'rest_framework.throttling.AnonRateThrottle',
36-
'rest_framework.throttling.UserRateThrottle'
37-
],
38-
'DEFAULT_THROTTLE_RATES': {
39-
'anon': '100/day',
40-
'user': '100/day'
41-
},
42-
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination',
43-
'PAGE_SIZE': 10
34+
'DEFAULT_THROTTLE_CLASSES': [
35+
'rest_framework.throttling.AnonRateThrottle',
36+
'rest_framework.throttling.UserRateThrottle'
37+
],
38+
'DEFAULT_THROTTLE_RATES': {
39+
'anon': '100/day',
40+
'user': '100/day'
41+
},
42+
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination',
43+
'PAGE_SIZE': 10
4444
}
4545

4646
MIDDLEWARE = [
47-
'django.middleware.security.SecurityMiddleware',
48-
'django.contrib.sessions.middleware.SessionMiddleware',
49-
'django.middleware.common.CommonMiddleware',
50-
'django.middleware.csrf.CsrfViewMiddleware',
51-
'django.contrib.auth.middleware.AuthenticationMiddleware',
52-
'django.contrib.messages.middleware.MessageMiddleware',
53-
'django.middleware.clickjacking.XFrameOptionsMiddleware',
47+
'django.middleware.security.SecurityMiddleware',
48+
'django.contrib.sessions.middleware.SessionMiddleware',
49+
'django.middleware.common.CommonMiddleware',
50+
'django.middleware.csrf.CsrfViewMiddleware',
51+
'django.contrib.auth.middleware.AuthenticationMiddleware',
52+
'django.contrib.messages.middleware.MessageMiddleware',
53+
'django.middleware.clickjacking.XFrameOptionsMiddleware',
5454
]
5555

5656
ROOT_URLCONF = 'tutorialdb.urls'
5757

5858
TEMPLATES = [
59-
{
60-
'BACKEND': 'django.template.backends.django.DjangoTemplates',
61-
'DIRS': [os.path.join(BASE_DIR, 'templates')],
62-
'APP_DIRS': True,
63-
'OPTIONS': {
64-
'context_processors': [
65-
'django.template.context_processors.debug',
66-
'django.template.context_processors.request',
67-
'django.contrib.auth.context_processors.auth',
68-
'django.contrib.messages.context_processors.messages',
69-
],
70-
},
71-
},
59+
{
60+
'BACKEND': 'django.template.backends.django.DjangoTemplates',
61+
'DIRS': [os.path.join(BASE_DIR, 'templates')],
62+
'APP_DIRS': True,
63+
'OPTIONS': {
64+
'context_processors': [
65+
'django.template.context_processors.debug',
66+
'django.template.context_processors.request',
67+
'django.contrib.auth.context_processors.auth',
68+
'django.contrib.messages.context_processors.messages',
69+
],
70+
},
71+
},
7272
]
7373

7474
WSGI_APPLICATION = 'tutorialdb.wsgi.application'
@@ -77,28 +77,28 @@
7777
# https://docs.djangoproject.com/en/2.2/ref/settings/#databases
7878

7979
DATABASES = {
80-
'default': {
81-
'ENGINE': 'django.db.backends.sqlite3',
82-
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
83-
}
80+
'default': {
81+
'ENGINE': 'django.db.backends.sqlite3',
82+
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
83+
}
8484
}
8585

8686
# Password validation
8787
# https://docs.djangoproject.com/en/2.2/ref/settings/#auth-password-validators
8888

8989
AUTH_PASSWORD_VALIDATORS = [
90-
{
91-
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
92-
},
93-
{
94-
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
95-
},
96-
{
97-
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
98-
},
99-
{
100-
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
101-
},
90+
{
91+
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
92+
},
93+
{
94+
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
95+
},
96+
{
97+
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
98+
},
99+
{
100+
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
101+
},
102102
]
103103

104104
# Internationalization

0 commit comments

Comments
 (0)