Bhupesh-V / tutorialdb

A search 🔎 engine for programming/dev tutorials,
MIT License
124 stars 62 forks source link

Can't generate SECRET_KEY. #10

Closed Animesh-Ghosh closed 5 years ago

Animesh-Ghosh commented 5 years ago

In CONTRIBUTING.md it says to generate the SECRET_KEY from the django shell, but in fact, you can't run the shell itself unless your SECRET_KEY is set-up.

That's why I suggest to remove the environment variable and put a SECRET_KEY generated prior so that people can generate it on their machine and then use the python-dotenv library to keep their virtual environment variables in a .env file.

Edit:

Also, set Debug to True since it's the development code.

Edit 2:

README.md/CONTRIBUTING.md might have to be updated accordingly.

Animesh-Ghosh commented 5 years ago

Alright, so when I comment the SECRET_KEY in settings.py I still can't run the server but I CAN run the shell. Then I followed the CONTRIBUTING.md and was able to generate the SECRET_KEY.

Bhupesh-V commented 5 years ago

I guess now everything is clear. CONTRIBUTING can be updated now, These are the final steps:

  1. Create virtual environment (using virtualenv - prerequistie)
  2. Clone the repo.
  3. Install Dependencies
  4. Run the commands to generate the SECRET_KEY
  5. Create a .env file add the key to it.
  6. Create your feature branch .
  7. Make changes.
  8. Push Your changes.
  9. :tada:
Animesh-Ghosh commented 5 years ago

Will you be making changes to README.md and settings.py as well?

Bhupesh-V commented 5 years ago

I guess now everything is clear. CONTRIBUTING can be updated now, These are the final steps:

1. Create virtual environment (using virtualenv - prerequistie)

2. Clone the repo.

3. Install Dependencies

4. Run the commands to generate the `SECRET_KEY`

5. Create a `.env` file add the key to it.

6. Create your feature branch .

7. Make changes.

8. Push Your changes.

9. tada

are these steps clear ? I guess settings.py don't need any changes :thinking: I will udpate the README and CONTRIBUTING accordingly

Animesh-Ghosh commented 5 years ago

I guess now everything is clear. CONTRIBUTING can be updated now, These are the final steps:

1. Create virtual environment (using virtualenv - prerequistie)

2. Clone the repo.

3. Install Dependencies

4. Run the commands to generate the `SECRET_KEY`

5. Create a `.env` file add the key to it.

6. Create your feature branch .

7. Make changes.

8. Push Your changes.

9. 🎉

Maybe move some stuff from CONTRIBUTING to README? I feel as if a lot of README worthy stuff is in CONTRIBUTING. I suggest moving "About the Project" and "Getting Started" to the README and we can put the "Installation" heading in the README under "Getting Started" heading.

How about this for "Getting Started"?:

  1. Clone the repository.
  2. Create virtual environment.
  3. Install dependencies.
  4. Generate secret key from Django's shell.
  5. Create .env file and put the key and other virtual environment variables in.

Separate points 6 through 9 in the CONTRIBUTING section.

Bhupesh-V commented 5 years ago

This seems ok

Animesh-Ghosh commented 5 years ago

Shall I get started?

settings.py will need to be updated as well. Need to comment out the SECRET_KEY and LOCAL_HOST variables. Then mention uncommenting those out in the README as well.