Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fork, Commit, Merge - Easy Issue (Django) #887

Closed
nikohoffren opened this issue Oct 5, 2023 · 0 comments
Closed

Fork, Commit, Merge - Easy Issue (Django) #887

nikohoffren opened this issue Oct 5, 2023 · 0 comments

Comments

@nikohoffren
Copy link
Member

Fork, Commit, Merge - Easy Issue (Django)

Create a simple Django view that returns a "Hello, World!" message

Note: You don't have ask permission to start solving the issue or get assigned, since these issues are supposed to be always open for new contributors. The actions-user bot will reset the file back to previous state for the next contributor after your commit is merged. So you can just simply start working with the issue right away!

How to get started

Start by opening the tasks/django/easy directory from the root of the project.
Then open hello_world/hello_world/urls.py and hello_world/hello_world_app/views.py files and start working on your solution!
Notice that there are hello_world and hello_world_app directories inside of hello_world directory which can make it a bit confusing. Make sure you are working with right folders and files!

Description

Your task is to create a simple Django view that returns a "Hello, World!" message to the browser.

  • You have to implement /hello path in hello_world/hello_world/urls.py file similar as the /admin path is implemented.
  • Also, you have to add return statement inside hello_world/hello_world_app/views.py file, which will return the string "Hello, World!".

How to Run:

  • Make sure you are in tasks/django/easy/hello_world directory in your Terminal.
  • Run the development server: python manage.py runserver
  • Navigate to http://127.0.0.1:8000/hello/ in your web browser.
  • You should see "Hello, World!" displayed on the screen.

Before making a Pull request:

  • Delete the SECRET_KEY in the tasks/django/easy/hello_world/hello_world/settings.py file. Otherwise when making the pull request, security checks will notice the secret and fail, which is not crucial because it can still be merged, but it just makes the Pull request experience a bit more enjoyable.
  • Normally these kind of projects would use something like .env file for storing secret keys and passwords etc in environment variables. In this project there is no need for that, since this is supposed to be just for educational purposes.
  • Remember, in real life projects, never expose the API keys, secret keys, any passwords or other environment variables to the public repository.

To work with this issue, you need to have Python and Django installed to your local machine.
Check out README.md for more instructions of installing Python and Django. You can also find there instructions of how to make a pull request.

Feel free to ask any questions here if you have some problems!

Also, kindly give this project a star to enhance its visibility for new developers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant