Giter Club home page Giter Club logo

tutorial's Introduction

Django Girls Tutorial

~ 🖥 Source Code 🖥 ~

NOT intended for reading here. To read go to: 📖 tutorial.djangogirls.org 📖

Contribution QUICKSTART

  1. Fork this repo [fork]
  1. Small changes: you can now edit your fork on the github website, do this! Make a change, then create a pull request!
  1. Big changes: clone your fork locally.
  2. CLI run make dev in repo.
$ make dev
...
Serving book on http://localhost:4000

Note: we have many changes under way we maybe working on your request already! Refer to existing Pull requests.

How to contribute

The Django Girls Tutorial is licensed under a Creative Commons Attribution-ShareAlike 4.0 license. Everyone is free to add, edit and correct the tutorial.

Editing basics

The source code of the tutorial is hosted on GitHub. The GitHub Fork & Pull workflow is used to accept and review changes.

The tutorial uses the HonKit project for publishing its documentation. See more information about how HonKit works.

The tutorial is written in Markdown mark up language.

You can find any discussions about the contents of the tutorial on the GitHub issue tracker.

Crowdin platform is used to manage translations. If you want to join an existing translation team or launch a new translation, send an email to the translation managers or contact support team. If you want to propose some small changes or fix typos in existing translations, please create a Pull Request.

Getting started and prerequisites

For contributing to the tutorial the following is needed to get started:

Fork the repository

First fork the DjangoGirls/tutorial repository to your personal GitHub account:

Fork button

CLI for Development

This command line tool use make to create development environment. It is optional to use this tool. While building the document, it builds the document for every language. The build process can be limited to any one language using this tool and reduce build time considerably. Afterwards, the translation to other languages are done from crowdin localization process.

Usage instructions are available though make help command.

Try the command make dev to start development process.

Editing chapter content

Simple changes

For simple changes like typo corrections you can use the GitHub online editor:

  • Open your local fork page on GitHub,
  • go to README.md file in any chapter,
  • press the Edit icon (pen)

and you can edit the chapter directly on github.com.

Edit button

Markdown syntax is used to edit the individual pages of the tutorial.

GitHub editor

Save your changes and create a pull request as explained below.

New content and complex changes

For adding new chapters, writing longer snippets of text or adding images, you need to get a copy of the tutorial to your local computer.

Either use the GitHub app for your operating system (mentioned above) or git command line to get the repository locally. You get the repository address from the front page of your own GitHub repository fork:

git clone [email protected]:yourgithubusername/tutorial.git

Move to the folder containing the project, to run the following commands.

cd tutorial

Then, create a branch for your new changes to sit in. It helps to call the branch something related to the changes you are going to make.

git checkout -b contributing

Install the project's requirements using npm.

npm install

To preview and serve local files, with auto-reload capabilities, run HonKit using:

npx honkit serve

The local server will be available at http://localhost:4000. If auto-reload is slow, you can temporarily remove unwanted languages from LANGS.md, to speed up the process.

Then commit the changes using git and push the changes to your remote GitHub repository.

Example:

$ git status
On branch contributing
Untracked files:
  (use "git add <file>..." to include in what will be committed)

    contributing_and_editing_this_book/images/gitbook.png

$ git add contributing_and_editing_this_book/images/gitbook.png

$ git commit -m "Added gitbook editor screenshot"
[contributing fe36152] Added gitbook screenshot
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 contributing_and_editing_this_book/images/gitbook.png

$ git push
Counting objects: 11, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 266.37 KiB | 0 bytes/s, done.
Total 5 (delta 1), reused 0 (delta 0)
To [email protected]:miohtama/tutorial.git
   b37ca59..fe36152  contributing -> contributing

Making a pull request

After you have finished your changes you need to create a pull request on GitHub. DjangoGirls will get notified about the pull request, review your changes, suggest any corrections if needed and then pull your changes to the master version.

In your own repository on GitHub press do Compare & pull request

Compare & pull request

Fill in the information why this change is being made. The reviewer can see the details of the actual change, so you don't need repeat the content of the change.

Then press Create pull request.

GitHub emails will notify you for the follow up process.

Further information and help

GitHub has an excellent documentation. Check it out if you need help!

For further questions please contact DjangoGirls.

tutorial's People

Contributors

agatku avatar amakarudze avatar aniav avatar asendecka avatar baradrb avatar bcopy avatar bmispelon avatar cgl avatar citmusa avatar das-g avatar ekohl avatar helenst avatar hjwp avatar hpfn avatar jhodgdon-drp avatar kaizumaki avatar kieczkowska avatar kyzn avatar magul avatar mrsqd avatar nikhiljohn10 avatar normade avatar oinopion avatar olasitarska avatar patjouk avatar phalt avatar rapoulson avatar rsip22 avatar tricoder42 avatar wagyx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tutorial's Issues

Deploy chapter - heroku create

In the deploy chapter, we're using the command:

$ heroku create

This is fine, but it could be worth pointing out that it's possible to do:

$ heroku create {NAME}

where {NAME} is replaced with the desired app name (rather than using a default one generated by Heroku).

Improvements in HTML/Template chapters

A friend (Andrew Nesbitt) just went through our tutorial as a Python newbie and sent me his feedback. There are two things we can improve on, so I am just adding it here because I will forget it :)

  1. When first adding the templates in http://tutorial.djangogirls.org/html/README.html I had to restart the server to get it to find the new templates, you mention about restarting the server in a later stage in the tutorial but not in that one.
  2. I couldn't get http://tutorial.djangogirls.org/template_extending/README.html to work using just the content on the page, kept getting the TemplateDoesNotExists error, even after restarting, I ended up adding the following code to get it to work: https://github.com/andrew/django-girls-tutorial/blob/master/mysite/settings.py#L90-L92

Improvements to deploy chapter

  • moving it earlier in the process so we can deploy more often
  • slowing things down a little bit - a lot of new things happen there very fast

Newly added part on dictionaries (Intro to Python chapter)

Just went looking at the newly added part in the intro chapter (dictionaries, see #77) to check for mistakes and wanted to ask: does anyone mind if I replace the example (django "dolls") with something else?

I was actually a little confused at first - I thought "dolls" (which is sometimes used a little condescendingly) was used instead of "girls" so as not to be too repetitive - but even now that I've realised that it refers indeed to toy dolls, it seems a little... off, especially considering that the tutorial isn't aimed at little girls but adult women mostly.

Env setup instructions not sufficient for Ubuntu 14.04

Following the tutorial instructions will not work cleanly on Ubuntu 14.04; I encountered issues with both the virtual environment and the PostgreSQL setup instructions:

Virtualenv:

$ python3 -m venv venv
Error: Command '['/home/eddie/Slask/tmp/venv/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1

PostgreSQL:

$ psql
psql: FATAL:  role "eddie" does not exist

I managed to solve the problems with some googling, but since this is supposed to be a very n00b-friendly guide, that should not be required.

The virtualenv-issue can be solved by installing python-virtualenv and then using the virtualenv-command instead of the command supplied in the tutorial. A fix for the problem is submitted upstream but I have no idea when it will trickle down to Trusty Tahr.

From what I can determine, the psql issue is due to the fact that, by default, only the user postgres has access to the PostgreSQL server by default. I solved it by adding myself as a PostgreSQL superuser, and editing some config files.

I can update the documentation to include the solutions to these issues. Would you like a pull request?

Please have a teacher make a deep review of the course

As a teacher I have to say that this course is not very well designed in terms of learning curve. The golden rule of all good handbooks is to make solid grounds - explain and excercise easy things and then gradually introduce more complex topics. I found that just at the very beginning of "Introduction to Python" the reader is bashed with methods and dot notation in VERY confusing way that almost stops them from further reading. It's supposed to be introduction for newbies! Let them play with numbers and strings, give them lists and dictionaries. And then introduce objects with their attributes and methods.

Having said all that I urge you to hand this course to at least a couple of CS teachers and note their comments. I will help as much as I can but unfortunatelly I don't have that much time.

Make a glossary

Gitbook has a nice feature of making glossaries and it automatically links the words to their explanations. We need to add GLOSSARY.md file in the main directory and the structure of the file is really simple:

# Keyword
Explanation

# Keyword
Explanation

Treats should not only be unhealthy food

"Grab yourself a cupcake and go to the next chapter :)"
"Works like a charm? We're proud! Treat yourself something sweet, you have earned it :)"

Puts a pretty cliche picture on women, don't you think? What about changing these two lines and pictures to:

"Well done so far! Celebrate by doing something good for you - taking a short walk, go have a little chat with someone, watch your favorite youtube video or do anything else you would like to do right now."

"Works like a charm? We're proud! Treat yourself with something special, you have earned it :)"

Static files on Heroku

Setting DEBUG = False breaks static files on Heroku. The simple solution would be to switch DEBUG on again but that's not the best solution in terms of security...

Better explanation of Models

During after-workshop coaches meeting someone suggested that explaining Models as tables (and comparing to spreadsheet) is a much better idea than our current one.

Is there someone who is against this?

Add LICENSE and appropriate credit

Currently the tutorial does not contain a LICENSE. This means all content can't be changed, used and published by others without explicit allowance by the original authors. This is even true for all people that contributed so far.

Because I believe that this is not the intention of the original authors a LICENSE file should be added to the repository.

Parts of the tutorial use content from other tutorials. One of them is my Django tutorial django-marcador. It is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. In my opinion there are two things that need to be changed to meet the requirements of the license:

  1. The way credit is given does not match the terms of the CC-BY-SA 4.0 license. it says that a user must "provide the name of the creator and attribution parties, a copyright notice, a license notice, a disclaimer notice, and a link to the material".
  2. Because the license is a "ShareAlike" license the Django Girls tutorial must also be licensed under a CC-BY-SA 4.0 license.

License and proper credits could look like this:

# License

This work is licensed under the Creative Commons Attribution-ShareAlike 4.0
International License. To view a copy of this license, visit
http://creativecommons.org/licenses/by-sa/4.0/ or send a letter to Creative
Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.

## Authors

- Ola Sitarska
- Ola Sendecka
- Baptiste Mispelon
- ...

## Credits

Parts of this work are based on the [django-marcador
tutorial](http://django-marcador.keimlink.de/) licensed under Creative Commons
Attribution-ShareAlike 4.0 International License. The django-marcador tutorial
is copyrighted by Markus Zapke-Gründemann et al.

Of course you can split the authors section into main authors and contributors if you want to.

Resolve PostgreSQL issues

Possibly doing a sqlite setup on local and using Postgres only for Heroku as suggested by @lukaszb and few others would be a much (much, much!) better way.

Command Line chapter more interactive

I think that it's good that command line chapter was added, but I think we should try to make it more interactive. Not only list and explain commands, but let people try them and see how they work.

Tutorial Chapter 10 "Bug"

In my environment there is no initial user created, when arriving at this passage in the tutorial (section 10 Django ORM (Querysets)):

What users do we have in our database? Try this:

>>> User.objects.all()
[<User: ola>]

I simply ran the following, to get a dummyuser to use:

>>> User.objects.create(username='myuser')

What about adding this command to the tutorial section?

Advanced Tutorial on Authentication

Current state when the blog is finished is that there is no authentication on authoring stuff. So anyone can add/edit posts on any of the created blogs. Not good...

There should be an advanced tutorial on adding authentication and authorization. I might even volunteer to start that now...

Problems with heroku-push

  1. Looks like heroku-push ignores the .gitignore file, and pushes local-settings.py.
    We solved this by putting all the settings in settings.py and got rid of local-settings.py.
  2. It doesn't trigger the creation of a Postgres database on Heroku. We had to do this manually.

Querysets

After adding models it'd be cool to go to shell and have a little fun with Querysets to show what models can do.

RFC: Re-order the tutorial

A beer-driven idea from Tomek and me: What if the tutorial is reordered?

Currently the deployment happens near the end of the day (with a version that is working but insecure...), what if deployment to a public space was moved more in front after the step where one can see first results. So after the step where blog-posts are added via admin-interface and displayed on the front-page, it would be a good point to deploy to heroku and be proud of it.

Proposal to move Deploy section to the end of tutorial

During the workshop Deployment section took us quite some time so we decided to skip it and finish it at the end if time persists. Other mentors did the same thing after number of different minor errors.

I'd propose to move it at the end of tutorial.

Check everything for style

  • consistent style for talking to reader ("you", "us", etc)
  • reward readers for progress with "congrats", and "keep up the good work!" a lot
  • add some cupcakes, illustrations and jokes :)
  • easy explanations for hard terms

Add "real" README

The README is currently the first page of the book. But in my opinion it would be better if the README would explain the purpose of the project and how to create, edit and contribute to it.

For example it is not obvious for someone who has no experience with gitbook how to install it and serve the book locally.

The "Installation" book should not include "What is Django?" chapter

I hope this is the right place for this issue, I couldn't find anything better!

I'm just going through the Installation book that was linked in the recent email to teams and coaches. I've notices that the "What is Django?" chapter seems a little out of place. Could we remove it from there (it should still stay in the main tutorial ofcourse!) and maybe add the one about the Code Editor instead?

Thanks!

Decide on one, either localhost or 127.0.0.1

It is mixed right now, we should stick to one notation. Argument for 127.0.0.1: when you use runserver it says you should go to 127.0.0.1:8000. Argument for locahost: it's easier to write :).

Heroku static files

There were some problems with static files on Heroku (when you change DEBUG to False). @jezdez had a solution for that, can you remind us what it was?

Creating blog entries while not logged in results in an ugly error

The current tutorial plays around with the admin-interface first and thus a user is logged in and everything is working fine.

But once people play around and redo their database, the authenticated user is lost. When you then try to save a new blog-post, everything blows up as it tries to set the anonymous user as author.

Inconsistent terminology

As the code is OS agnostic and focuses on CLI not GUI the tutorial starts off making directories and later switches between folder/directory terminology.

Visit your application - what's process type and dyno running?

In the Deploy chapter, in the Visit your application section, there are two paragraphs there are not clear for me:

You’ve deployed your code to Heroku, and specified the process types in a Procfile. You can now instruct Heroku to execute a process type.

Let’s ensure we have one dyno running the web process type:

You lost me there.

Can anyone maybe add a sentence or two to explain what's process type and dyno? Or maybe to phrase it differently so it's easier to understand?

Thanks a lot for anyone that will! :)

Proofreading

If you're a native English speaker (or just know English well!), have some time on your hands and want to help, we would really appreciate if you could help proof read this tutorial!

You can see preview here: http://book.djangogirls.org/.

How to do it?

  • comment this thread with the names of chapter you want to proofread. Make sure that anyone else is not reading them already. If all the chapters are "taken", just read from the beginning to see if there is something others didn't catch.
  • fork this repository, change and pull request
  • receive a 👍 and 😍 from DjangoGirls! :)

Already corrected chapters:

In progress:

TO DO:

  • Django ORM
  • Django templates
  • CSS
  • Template extending
  • Extend your application
  • Deploy!
  • Django Forms
  • Domain
  • Homework

I'll be updating this post.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.