diff options
Diffstat (limited to 'pydis_site')
58 files changed, 659 insertions, 48 deletions
diff --git a/pydis_site/apps/api/tests/base.py b/pydis_site/apps/api/tests/base.py index 37459f70..b779256e 100644 --- a/pydis_site/apps/api/tests/base.py +++ b/pydis_site/apps/api/tests/base.py @@ -5,7 +5,7 @@ from rest_framework.test import APITestCase test_user, _created = User.objects.get_or_create( username='test', email='[email protected]', - password='testpass', # noqa: S106 + password='testpass', # noqa is_superuser=True, is_staff=True ) diff --git a/pydis_site/apps/home/resources/books/_category_info.yaml b/pydis_site/apps/home/resources/books/_category_info.yaml new file mode 100644 index 00000000..e3b89ad3 --- /dev/null +++ b/pydis_site/apps/home/resources/books/_category_info.yaml @@ -0,0 +1,2 @@ +description: The best books for learning Python or Python Frameworks +name: Books diff --git a/pydis_site/apps/home/resources/books/automate_the_boring_stuff.yaml b/pydis_site/apps/home/resources/books/automate_the_boring_stuff.yaml new file mode 100644 index 00000000..3a9045a5 --- /dev/null +++ b/pydis_site/apps/home/resources/books/automate_the_boring_stuff.yaml @@ -0,0 +1,16 @@ +description: One of the best books out there for Python beginners. This book will + teach you the basics of Python, while also teaching invaluable automation tools + and techniques for solving common problems. You'll learn how to go about scraping + the web, manipulating files and automating keyboard and mouse input. Ideal for an + office worker who wants to make himself more useful. +name: Automate the Boring Stuff with Python +payment: optional +payment_description: A free e-book is available on the website, but you can buy it + on Amazon if you want to support the author. +urls: +- icon: regular/link + title: E-book + url: https://automatetheboringstuff.com/ +- icon: branding/amazon + title: Amazon + url: https://www.amazon.com/Automate-Boring-Stuff-Python-Programming/dp/1593275994/ diff --git a/pydis_site/apps/home/resources/books/byte_of_python.yaml b/pydis_site/apps/home/resources/books/byte_of_python.yaml new file mode 100644 index 00000000..f3eca902 --- /dev/null +++ b/pydis_site/apps/home/resources/books/byte_of_python.yaml @@ -0,0 +1,17 @@ +description: A free book on programming using the Python language. It serves as a + tutorial or guide to the Python language for a beginner audience. If all you know + about computers is how to save text files, then this is the book for you. +name: A Byte of Python +payment: optional +payment_description: A free e-book is available online, a paper version can be bought + from lulu.com. +urls: +- icon: regular/link + title: E-book + url: https://python.swaroopch.com/ +- icon: regular/book + title: Buy the book + url: http://www.lulu.com/shop/swaroop-c-h/a-byte-of-python/paperback/product-21142968.html +- icon: regular/tablet-alt + title: Kindle edition + url: https://www.amazon.com/Byte-Python-Swaroop-C-H-ebook/dp/B00FJ7S2JU/ diff --git a/pydis_site/apps/home/resources/books/effective_python.yaml b/pydis_site/apps/home/resources/books/effective_python.yaml new file mode 100644 index 00000000..ab782704 --- /dev/null +++ b/pydis_site/apps/home/resources/books/effective_python.yaml @@ -0,0 +1,14 @@ +description: A book that gives 59 best practices for writing excellent Python. Great + for intermediates. +name: Effective Python +payment: paid +urls: +- icon: regular/link + title: Website + url: https://effectivepython.com/ +- icon: branding/amazon + title: Amazon + url: https://www.amazon.com/Effective-Python-Specific-Software-Development/dp/0134034287 +- icon: branding/github + title: GitHub + url: https://github.com/bslatkin/effectivepython diff --git a/pydis_site/apps/home/resources/books/flask_web_development.yaml b/pydis_site/apps/home/resources/books/flask_web_development.yaml new file mode 100644 index 00000000..613e0e50 --- /dev/null +++ b/pydis_site/apps/home/resources/books/flask_web_development.yaml @@ -0,0 +1,14 @@ +description: A comprehensive Flask walkthrough that has you building a complete social + blogging application from scratch. +name: Flask Web Development +payment: paid +urls: +- icon: regular/link + title: Website + url: http://shop.oreilly.com/product/0636920031116.do +- icon: branding/amazon + title: Amazon + url: https://www.amazon.com/Flask-Web-Development-Developing-Applications/dp/1449372627 +- icon: branding/github + title: GitHub + url: https://github.com/miguelgrinberg/flasky diff --git a/pydis_site/apps/home/resources/books/fluent_python.yaml b/pydis_site/apps/home/resources/books/fluent_python.yaml new file mode 100644 index 00000000..ebfd5f91 --- /dev/null +++ b/pydis_site/apps/home/resources/books/fluent_python.yaml @@ -0,0 +1,14 @@ +description: A veritable tome of intermediate and advanced Python information. A must-read + for any Python professional. +name: Fluent Python +payment: paid +urls: +- icon: regular/link + title: Website + url: https://www.oreilly.com/library/view/fluent-python/9781491946237/ +- icon: branding/amazon + title: Amazon + url: https://www.amazon.com/Fluent-Python-Concise-Effective-Programming/dp/1491946008 +- icon: branding/github + title: GitHub + url: https://github.com/fluentpython diff --git a/pydis_site/apps/home/resources/books/mission_python.yaml b/pydis_site/apps/home/resources/books/mission_python.yaml new file mode 100644 index 00000000..8cd91979 --- /dev/null +++ b/pydis_site/apps/home/resources/books/mission_python.yaml @@ -0,0 +1,13 @@ +description: Learn programming and Python while building a complete and awesome space-themed + game using cutting-edge Python 3.6 and Pygame Zero. Extensive use of code examples, + images, and walk-throughs make this a pleasure to both read and follow along. Excellent + book for beginners. +name: Mission Python +payment: paid +urls: +- icon: regular/link + title: Website + url: https://www.sean.co.uk/books/mission-python/index.shtm +- icon: branding/amazon + title: Amazon + url: https://www.amazon.com/Mission-Python-Code-Space-Adventure/dp/1593278578 diff --git a/pydis_site/apps/home/resources/books/python_cookbook.yaml b/pydis_site/apps/home/resources/books/python_cookbook.yaml new file mode 100644 index 00000000..9fab8e48 --- /dev/null +++ b/pydis_site/apps/home/resources/books/python_cookbook.yaml @@ -0,0 +1,14 @@ +description: Complete with 'recipes' for various Python topics, including moving from + Python 2 to Python 3.3 +name: Python Cookbook +payment: paid +urls: +- icon: regular/link + title: Website + url: http://shop.oreilly.com/product/0636920027072.do +- icon: branding/amazon + title: Amazon + url: https://www.amazon.com/Python-Cookbook-Third-David-Beazley/dp/1449340377 +- icon: branding/github + title: GitHub + url: https://github.com/dabeaz/python-cookbook diff --git a/pydis_site/apps/home/resources/books/python_tricks.yaml b/pydis_site/apps/home/resources/books/python_tricks.yaml new file mode 100644 index 00000000..0638058c --- /dev/null +++ b/pydis_site/apps/home/resources/books/python_tricks.yaml @@ -0,0 +1,12 @@ +description: Full of useful Python tips, tricks and features. Get this if you have + a good grasp of the basics and want to take your Python skills to the next level, + or are a experienced programmer looking to add to your toolbelt. +name: Python Tricks +payment: paid +urls: +- icon: regular/link + title: Website + url: https://realpython.com/products/python-tricks-book/ +- icon: branding/amazon + title: Amazon + url: https://www.amazon.com/Python-Tricks-Buffet-Awesome-Features/dp/1775093301 diff --git a/pydis_site/apps/home/resources/books/two_scoops_of_django.yaml b/pydis_site/apps/home/resources/books/two_scoops_of_django.yaml new file mode 100644 index 00000000..85cfa0fc --- /dev/null +++ b/pydis_site/apps/home/resources/books/two_scoops_of_django.yaml @@ -0,0 +1,14 @@ +description: This book is chock-full of material that will help you with your Django + projects. +name: Two Scoops of Django +payment: paid +urls: +- icon: regular/link + title: Website + url: https://twoscoopspress.com/products/two-scoops-of-django-1-11 +- icon: branding/amazon + title: Amazon + url: https://www.amazon.com/Two-Scoops-Django-Best-Practices/dp/0981467342 +- icon: branding/github + title: GitHub + url: https://github.com/twoscoops/two-scoops-of-django-2.0-code-examples diff --git a/pydis_site/apps/home/resources/communities/_category_info.yaml b/pydis_site/apps/home/resources/communities/_category_info.yaml new file mode 100644 index 00000000..eccb8b80 --- /dev/null +++ b/pydis_site/apps/home/resources/communities/_category_info.yaml @@ -0,0 +1,2 @@ +description: Partnered communities that share part of our mission +name: Communities diff --git a/pydis_site/apps/home/resources/communities/adafruit.yaml b/pydis_site/apps/home/resources/communities/adafruit.yaml new file mode 100644 index 00000000..193f7364 --- /dev/null +++ b/pydis_site/apps/home/resources/communities/adafruit.yaml @@ -0,0 +1,14 @@ +description: 'Adafruit is an open-source electronics manufacturer that makes all the + components you need to start your own Python-powered hardware projects. + + + Their official community host regular show-and-tells, provide help with your projects, + and the Adafruit devs do all the CircuitPython development right out in the open. + Join the Maker Revolution today!' +name: 'Discord: Adafruit' +payment: free +payment_description: null +urls: +- icon: branding/discord + title: Adafruit Discord + url: https://discord.gg/adafruit diff --git a/pydis_site/apps/home/resources/communities/functional_programming.yaml b/pydis_site/apps/home/resources/communities/functional_programming.yaml new file mode 100644 index 00000000..ab99f264 --- /dev/null +++ b/pydis_site/apps/home/resources/communities/functional_programming.yaml @@ -0,0 +1,10 @@ +description: Functional Programming is a server for discussing functional languages + like Haskell, Idris, Elixir and Lisp as well as related academic fields such as + type theory, category theory, proof assistants, and more! +name: 'Discord: Functional Programming' +payment: free +payment_description: null +urls: +- icon: branding/discord + title: Functional Programming Discord + url: https://discord.gg/kWJYurV diff --git a/pydis_site/apps/home/resources/communities/pallets.yaml b/pydis_site/apps/home/resources/communities/pallets.yaml new file mode 100644 index 00000000..e5a18983 --- /dev/null +++ b/pydis_site/apps/home/resources/communities/pallets.yaml @@ -0,0 +1,10 @@ +description: The Pallets Projects develop Python libraries such as the Flask web framework, + the Jinja templating library, and the Click command line toolkit. Join to discuss + and get help from the Pallets community. +name: 'Discord: The Pallets Project' +payment: free +payment_description: null +urls: +- icon: branding/discord + title: The Pallets Project Discord + url: https://discord.gg/t6rrQZH diff --git a/pydis_site/apps/home/resources/communities/rlbot.yaml b/pydis_site/apps/home/resources/communities/rlbot.yaml new file mode 100644 index 00000000..c62e0260 --- /dev/null +++ b/pydis_site/apps/home/resources/communities/rlbot.yaml @@ -0,0 +1,11 @@ +description: RLBot is a community of programmers making awesome Rocket League bots. + They've created a framework that you can use to write bots in a number of languages + (including Python), and they host regular tournaments where botmakers can pit their + creations against each other. +name: 'Discord: RLBot' +payment: free +payment_description: null +urls: +- icon: branding/discord + title: RLBot Discord + url: https://discord.gg/4JJdJKb diff --git a/pydis_site/apps/home/resources/communities/subreddit.yaml b/pydis_site/apps/home/resources/communities/subreddit.yaml new file mode 100644 index 00000000..217a84ac --- /dev/null +++ b/pydis_site/apps/home/resources/communities/subreddit.yaml @@ -0,0 +1,8 @@ +description: News about the Python programming language, and language-related discussion +name: 'Subreddit: r/Python' +payment: free +payment_description: null +urls: +- icon: branding/reddit-alien + title: r/Python on Reddit + url: https://www.reddit.com/r/Python/ diff --git a/pydis_site/apps/home/resources/editors/_category_info.yaml b/pydis_site/apps/home/resources/editors/_category_info.yaml new file mode 100644 index 00000000..f8dc1413 --- /dev/null +++ b/pydis_site/apps/home/resources/editors/_category_info.yaml @@ -0,0 +1,2 @@ +description: Lightweight code editors supporting Python +name: Editors diff --git a/pydis_site/apps/home/resources/editors/atom.yaml b/pydis_site/apps/home/resources/editors/atom.yaml new file mode 100644 index 00000000..f05e45a3 --- /dev/null +++ b/pydis_site/apps/home/resources/editors/atom.yaml @@ -0,0 +1,12 @@ +description: A free Electron-based editor, a "hackable text editor for the 21st century", maintained + by the GitHub team. +name: Atom +payment: free +payment_description: null +urls: +- icon: regular/link + title: Website + url: https://atom.io/ +- icon: branding/github + title: GitHub + url: https://github.com/atom/atom diff --git a/pydis_site/apps/home/resources/editors/mu_editor.yaml b/pydis_site/apps/home/resources/editors/mu_editor.yaml new file mode 100644 index 00000000..cb44d750 --- /dev/null +++ b/pydis_site/apps/home/resources/editors/mu_editor.yaml @@ -0,0 +1,12 @@ +description: An editor aimed at beginners for the purpose of learning how to code + without the distractions more advanced editors sometimes cause. +name: Mu-Editor +payment: free +payment_description: null +urls: +- icon: regular/link + title: Website + url: https://codewith.mu/en/ +- icon: branding/github + title: GitHub + url: https://github.com/mu-editor/mu/ diff --git a/pydis_site/apps/home/resources/editors/sublime_text.yaml b/pydis_site/apps/home/resources/editors/sublime_text.yaml new file mode 100644 index 00000000..97952d35 --- /dev/null +++ b/pydis_site/apps/home/resources/editors/sublime_text.yaml @@ -0,0 +1,9 @@ +description: A powerful Python-backed editor with great community support and a wealth + of extensions. +name: Sublime Text +payment: optional +payment_description: Nagware; will ask you to buy the full version after every X saves +urls: +- icon: regular/link + title: Website + url: https://www.sublimetext.com/ diff --git a/pydis_site/apps/home/resources/editors/visual_studio_code.yaml b/pydis_site/apps/home/resources/editors/visual_studio_code.yaml new file mode 100644 index 00000000..4e1f946f --- /dev/null +++ b/pydis_site/apps/home/resources/editors/visual_studio_code.yaml @@ -0,0 +1,11 @@ +description: A fully-featured editor based on Electron, extendable with plugins. +name: Visual Studio Code +payment: free +payment_description: null +urls: +- icon: regular/link + title: Website + url: https://code.visualstudio.com/ +- icon: branding/github + title: GitHub + url: https://github.com/Microsoft/vscode diff --git a/pydis_site/apps/home/resources/ides/_category_info.yaml b/pydis_site/apps/home/resources/ides/_category_info.yaml new file mode 100644 index 00000000..d331c95d --- /dev/null +++ b/pydis_site/apps/home/resources/ides/_category_info.yaml @@ -0,0 +1,2 @@ +description: Fully-integrated development environments for serious Python work +name: IDEs diff --git a/pydis_site/apps/home/resources/ides/pycharm.yaml b/pydis_site/apps/home/resources/ides/pycharm.yaml new file mode 100644 index 00000000..4624cb41 --- /dev/null +++ b/pydis_site/apps/home/resources/ides/pycharm.yaml @@ -0,0 +1,10 @@ +description: The very best Python IDE, with a wealth of advanced features and convenience + functions. +name: PyCharm +payment: optional +payment_description: There's a free Community Edition and a paid-for Professional + Edition with more features available +urls: +- icon: regular/link + title: Website + url: https://www.jetbrains.com/pycharm/ diff --git a/pydis_site/apps/home/resources/ides/spyder.yaml b/pydis_site/apps/home/resources/ides/spyder.yaml new file mode 100644 index 00000000..146b3549 --- /dev/null +++ b/pydis_site/apps/home/resources/ides/spyder.yaml @@ -0,0 +1,12 @@ +description: The Scientific PYthon Development EnviRonment. Simpler and lighter than + PyCharm, but still packs a punch. +name: Spyder +payment: free +payment_description: null +urls: +- icon: regular/link + title: Website + url: https://www.spyder-ide.org/ +- icon: branding/github + title: GitHub + url: https://github.com/spyder-ide/spyder diff --git a/pydis_site/apps/home/resources/ides/thonny.yaml b/pydis_site/apps/home/resources/ides/thonny.yaml new file mode 100644 index 00000000..d660094b --- /dev/null +++ b/pydis_site/apps/home/resources/ides/thonny.yaml @@ -0,0 +1,12 @@ +description: A Python IDE specifially aimed at learning programming. Has a lot of + helpful features to help you understand your code. +name: Thonny +payment: free +payment_description: null +urls: +- icon: regular/link + title: Website + url: https://thonny.org/ +- icon: branding/github + title: GitHub + url: https://github.com/thonny/thonny/ diff --git a/pydis_site/apps/home/resources/interactive_learning_tools/_category_info.yaml b/pydis_site/apps/home/resources/interactive_learning_tools/_category_info.yaml new file mode 100644 index 00000000..08501627 --- /dev/null +++ b/pydis_site/apps/home/resources/interactive_learning_tools/_category_info.yaml @@ -0,0 +1,3 @@ +description: Learn Python with interactive content like courses, games and programming + challenges. +name: Interactive Learning Tools diff --git a/pydis_site/apps/home/resources/interactive_learning_tools/automate_the_boring_stuff.yaml b/pydis_site/apps/home/resources/interactive_learning_tools/automate_the_boring_stuff.yaml new file mode 100644 index 00000000..02d76b3b --- /dev/null +++ b/pydis_site/apps/home/resources/interactive_learning_tools/automate_the_boring_stuff.yaml @@ -0,0 +1,11 @@ +description: The interactive course version of Al Sweigart's excellent book for beginners, + taught by the author himself. This link has a discounted version of the course which + will always cost 10 dollars. Thanks, Al! +name: Automate the Boring Stuff with Python +payment: paid +payment_description: Paid course with a certificate of completion. Some sample videos + are available for free. +urls: +- icon: regular/graduation-cap + title: Udemy Course + url: https://www.udemy.com/automate/?couponCode=FOR_LIKE_10_BUCKS diff --git a/pydis_site/apps/home/resources/interactive_learning_tools/code_combat.yaml b/pydis_site/apps/home/resources/interactive_learning_tools/code_combat.yaml new file mode 100644 index 00000000..39c25f0d --- /dev/null +++ b/pydis_site/apps/home/resources/interactive_learning_tools/code_combat.yaml @@ -0,0 +1,13 @@ +description: Learn Python while gaming - an open-source project with thousands of + contributors, which teaches you Python through a deep, top-down RPG. +name: Code Combat +payment: optional +payment_description: A wealth of free content is available, but you can also pay for + more +urls: +- icon: regular/link + title: Website + url: https://codecombat.com/ +- icon: branding/github + title: GitHub + url: https://github.com/codecombat/codecombat diff --git a/pydis_site/apps/home/resources/interactive_learning_tools/exercism.yaml b/pydis_site/apps/home/resources/interactive_learning_tools/exercism.yaml new file mode 100644 index 00000000..3adb4138 --- /dev/null +++ b/pydis_site/apps/home/resources/interactive_learning_tools/exercism.yaml @@ -0,0 +1,14 @@ +description: Level up your programming skills with more than 2600 exercises across + 47 programming languages, Python included. The website provides a mentored mode, + where you can get your code reviewed for each solution you submit. The mentors will + give you insightful advice to make you a better programmer. +name: exercism.io +payment: free +payment_description: null +urls: +- icon: regular/link + title: Website + url: https://exercism.io/ +- icon: branding/github + title: GitHub + url: https://github.com/exercism/python diff --git a/pydis_site/apps/home/resources/interactive_learning_tools/learn_to_program.yaml b/pydis_site/apps/home/resources/interactive_learning_tools/learn_to_program.yaml new file mode 100644 index 00000000..265f1644 --- /dev/null +++ b/pydis_site/apps/home/resources/interactive_learning_tools/learn_to_program.yaml @@ -0,0 +1,13 @@ +description: A 2-part course that teaches Python. Primarily intended for high school + students and first-year university students who want to learn programming. +name: 'University of Toronto: Learn to Program' +payment: optional +payment_description: You can pay to enroll for a graded certificate, or choose to + audit for free. +urls: +- icon: regular/graduation-cap + title: 'Part 1: The Fundamentals' + url: https://www.coursera.org/learn/learn-to-program +- icon: regular/graduation-cap + title: 'Part 2: Crafting Quality Code' + url: https://www.coursera.org/learn/program-code diff --git a/pydis_site/apps/home/resources/interactive_learning_tools/mit_python.yaml b/pydis_site/apps/home/resources/interactive_learning_tools/mit_python.yaml new file mode 100644 index 00000000..464b8d4a --- /dev/null +++ b/pydis_site/apps/home/resources/interactive_learning_tools/mit_python.yaml @@ -0,0 +1,10 @@ +description: This MITx offering teaches computer science with Python. It covers computational + thinking, algorithms, data structures and the Python programming language itself. +name: 'MIT: Introduction to Computer Science and Programming Using Python' +payment: optional +payment_description: You can pay to enroll for a graded certificate, or choose to + take the full course for free. +urls: +- icon: regular/graduation-cap + title: edX Course + url: https://www.edx.org/course/introduction-computer-science-mitx-6-00-1x-11 diff --git a/pydis_site/apps/home/resources/interactive_learning_tools/programming_for_everybody.yaml b/pydis_site/apps/home/resources/interactive_learning_tools/programming_for_everybody.yaml new file mode 100644 index 00000000..a6d7abe1 --- /dev/null +++ b/pydis_site/apps/home/resources/interactive_learning_tools/programming_for_everybody.yaml @@ -0,0 +1,10 @@ +description: A 5-part specialization course that teaches Python from scratch. The + course has no pre-requisites and avoids all but the simplest mathematics. +name: 'University of Michigan: Programming for Everybody' +payment: optional +payment_description: You can pay to enroll for a graded certificate and a capstone + project, or choose to audit for free. +urls: +- icon: regular/graduation-cap + title: Python for Everyone Specialization + url: https://www.coursera.org/learn/python diff --git a/pydis_site/apps/home/resources/interactive_learning_tools/python_morsels.yaml b/pydis_site/apps/home/resources/interactive_learning_tools/python_morsels.yaml new file mode 100644 index 00000000..f883f8b7 --- /dev/null +++ b/pydis_site/apps/home/resources/interactive_learning_tools/python_morsels.yaml @@ -0,0 +1,15 @@ +description: 'Learn to write more idiomatic Python code with deliberate practice! + + + Sign up for this service and receive one short Python exercise every week. After + you attempt to work through the exercise, you''ll receive a number of solutions + to the exercise with explanations of each one. Each exercise will include automated + tests and some may include bonuses for a little more of a challenge!' +name: Python Morsels +payment: paid +payment_description: Paid service with monthly and annual plans. A 4 week free trial + is available without needing to enter payment information. +urls: +- icon: regular/link + title: Website + url: https://www.pythonmorsels.com/ diff --git a/pydis_site/apps/home/resources/misc/_category_info.yaml b/pydis_site/apps/home/resources/misc/_category_info.yaml new file mode 100644 index 00000000..4fdc4bf7 --- /dev/null +++ b/pydis_site/apps/home/resources/misc/_category_info.yaml @@ -0,0 +1,2 @@ +description: Resources which do not fit into the other categories +name: Miscellaneous diff --git a/pydis_site/apps/home/resources/misc/good_first_issue_tag.yaml b/pydis_site/apps/home/resources/misc/good_first_issue_tag.yaml new file mode 100644 index 00000000..35d7a8a4 --- /dev/null +++ b/pydis_site/apps/home/resources/misc/good_first_issue_tag.yaml @@ -0,0 +1,10 @@ +description: Searching for opportunities to contribute to a Python project? GitHub + repository maintainers often mark issues appropriate for novice users with the 'Good + First Issue' tag. These issues can be explored directly on GitHub. +name: GitHub's 'Good First Issue' Tag +payment: free +payment_description: null +urls: +- icon: branding/github + title: GitHub + url: https://github.com/search?utf8=%E2%9C%93&q=label%3A%22good+first+issue%22+language%3APython+state%3Aopen&type=Issues&ref=advsearch&l=Python&l= diff --git a/pydis_site/apps/home/resources/misc/python_cheat_sheet.yaml b/pydis_site/apps/home/resources/misc/python_cheat_sheet.yaml new file mode 100644 index 00000000..8c82a5a9 --- /dev/null +++ b/pydis_site/apps/home/resources/misc/python_cheat_sheet.yaml @@ -0,0 +1,9 @@ +description: A Python 3 cheat sheet with useful information and tips, as well as common + pitfalls for beginners. This is a PDF. +name: Python Cheat Sheet +payment: free +payment_description: null +urls: +- icon: regular/link + title: Website + url: https://perso.limsi.fr/pointal/_media/python:cours:mementopython3-english.pdf diff --git a/pydis_site/apps/home/resources/podcasts/_category_info.yaml b/pydis_site/apps/home/resources/podcasts/_category_info.yaml new file mode 100644 index 00000000..a0f9025c --- /dev/null +++ b/pydis_site/apps/home/resources/podcasts/_category_info.yaml @@ -0,0 +1,2 @@ +description: Notable podcasts about the Python ecosystem +name: Podcasts diff --git a/pydis_site/apps/home/resources/podcasts/podcast_dunder_init.yaml b/pydis_site/apps/home/resources/podcasts/podcast_dunder_init.yaml new file mode 100644 index 00000000..8f0cac8b --- /dev/null +++ b/pydis_site/apps/home/resources/podcasts/podcast_dunder_init.yaml @@ -0,0 +1,9 @@ +description: The podcast about Python and the people who make it great. Weekly long-form + interviews with the creators of notable Python packages. +name: Podcast.__init__ +payment: free +payment_description: null +urls: +- icon: regular/link + title: Website + url: https://www.podcastinit.com/ diff --git a/pydis_site/apps/home/resources/podcasts/python_bytes.yaml b/pydis_site/apps/home/resources/podcasts/python_bytes.yaml new file mode 100644 index 00000000..a3368d23 --- /dev/null +++ b/pydis_site/apps/home/resources/podcasts/python_bytes.yaml @@ -0,0 +1,9 @@ +description: A byte-sized podcast where Michael Kennedy and Brian Okken work through + this week's notable Python headlines. +name: Python Bytes +payment: free +payment_description: null +urls: +- icon: regular/link + title: Website + url: https://pythonbytes.fm/ diff --git a/pydis_site/apps/home/resources/podcasts/talk_python_to_me.yaml b/pydis_site/apps/home/resources/podcasts/talk_python_to_me.yaml new file mode 100644 index 00000000..5ed101c4 --- /dev/null +++ b/pydis_site/apps/home/resources/podcasts/talk_python_to_me.yaml @@ -0,0 +1,9 @@ +description: The essential weekly Python podcast. Michael Kennedy and a prominent + name within the Python community dive into a topic that relates to their experience. +name: Talk Python To Me +payment: free +payment_description: null +urls: +- icon: regular/link + title: Website + url: https://talkpython.fm/ diff --git a/pydis_site/apps/home/resources/tutorials/_category_info.yaml b/pydis_site/apps/home/resources/tutorials/_category_info.yaml new file mode 100644 index 00000000..a9adc106 --- /dev/null +++ b/pydis_site/apps/home/resources/tutorials/_category_info.yaml @@ -0,0 +1,3 @@ +description: Tutorials and references for those that are just getting started with + python +name: Tutorials diff --git a/pydis_site/apps/home/resources/tutorials/corey_schafer.yaml b/pydis_site/apps/home/resources/tutorials/corey_schafer.yaml new file mode 100644 index 00000000..9fff4bbf --- /dev/null +++ b/pydis_site/apps/home/resources/tutorials/corey_schafer.yaml @@ -0,0 +1,7 @@ +description: An in-depth look at the Python programming language, from one of + YouTube's most popular Python tutors. +payment: free +urls: + - icon: branding/youtube, + title: YouTube, + url: https://www.youtube.com/playlist?list=PL-osiE80TeTt2d9bfVyTiXJA-UTHn6WwU diff --git a/pydis_site/apps/home/resources/tutorials/get_started_with_flask.yaml b/pydis_site/apps/home/resources/tutorials/get_started_with_flask.yaml new file mode 100644 index 00000000..11dd2a4d --- /dev/null +++ b/pydis_site/apps/home/resources/tutorials/get_started_with_flask.yaml @@ -0,0 +1,9 @@ +description: A fully featured mega-tutorial for learning how to create web applications + with the Flask framework. +name: Get Started with Flask Web Development +payment: free +payment_description: null +urls: +- icon: regular/link + title: Website + url: https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world diff --git a/pydis_site/apps/home/resources/tutorials/getting_started_with_python.yaml b/pydis_site/apps/home/resources/tutorials/getting_started_with_python.yaml new file mode 100644 index 00000000..777f2fe3 --- /dev/null +++ b/pydis_site/apps/home/resources/tutorials/getting_started_with_python.yaml @@ -0,0 +1,12 @@ +description: The list of resources for programmers and non-programmers from Python's + official beginners' guide +name: Getting Started with Python +payment: free +payment_description: null +urls: +- icon: regular/link + title: Beginners Guide for Non-Programmers + url: https://wiki.python.org/moin/BeginnersGuide/NonProgrammers +- icon: regular/link + title: Beginners Guide for Programmers + url: https://wiki.python.org/moin/BeginnersGuide/Programmers diff --git a/pydis_site/apps/home/resources/tutorials/hitchhikers_guide_to_python.yaml b/pydis_site/apps/home/resources/tutorials/hitchhikers_guide_to_python.yaml new file mode 100644 index 00000000..38eebb56 --- /dev/null +++ b/pydis_site/apps/home/resources/tutorials/hitchhikers_guide_to_python.yaml @@ -0,0 +1,10 @@ +description: This opinionated guide exists to provide both novice and expert Python + developers a best practice handbook to the installation, configuration, and usage + of Python on a daily basis. +name: The Hitchhiker's Guide to Python +payment: free +payment_description: null +urls: +- icon: regular/link + title: Website + url: https://python-guide.org/ diff --git a/pydis_site/apps/home/resources/tutorials/sentdex.yaml b/pydis_site/apps/home/resources/tutorials/sentdex.yaml new file mode 100644 index 00000000..cae2695b --- /dev/null +++ b/pydis_site/apps/home/resources/tutorials/sentdex.yaml @@ -0,0 +1,8 @@ +description: A Python basics tutorial based around Python 3.7. +name: Python Tutorials by Sentdex on YouTube +payment: free +payment_description: null +urls: +- icon: branding/youtube + title: YouTube + url: https://www.youtube.com/playlist?list=PLQVvvaa0QuDeAams7fkdcwOGBpGdHpXln diff --git a/pydis_site/apps/home/resources/tutorials/simple_guide_to_git.yaml b/pydis_site/apps/home/resources/tutorials/simple_guide_to_git.yaml new file mode 100644 index 00000000..acf76efe --- /dev/null +++ b/pydis_site/apps/home/resources/tutorials/simple_guide_to_git.yaml @@ -0,0 +1,8 @@ +description: A simple, no-nonsense guide to the basics of using Git. +name: A Simple Guide to Git +payment: free +payment_description: null +urls: +- icon: regular/link + title: Website + url: http://rogerdudler.github.io/git-guide/ diff --git a/pydis_site/apps/home/urls.py b/pydis_site/apps/home/urls.py index b22508d9..e65abea4 100644 --- a/pydis_site/apps/home/urls.py +++ b/pydis_site/apps/home/urls.py @@ -8,7 +8,7 @@ from .views import HomeView app_name = 'home' urlpatterns = [ path('', HomeView.as_view(), name='home'), + path('pages/', include('wiki.urls')), path('admin/', admin.site.urls), path('notifications/', include('django_nyt.urls')), - path('wiki/', include('wiki.urls')), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) diff --git a/pydis_site/settings.py b/pydis_site/settings.py index d6c7ed96..2050c6ab 100644 --- a/pydis_site/settings.py +++ b/pydis_site/settings.py @@ -11,6 +11,7 @@ https://docs.djangoproject.com/en/2.1/ref/settings/ """ import os +import secrets import sys import environ @@ -20,11 +21,8 @@ env = environ.Env( DEBUG=(bool, False) ) - # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) - - DEBUG = env('DEBUG') # Quick-start development settings - unsuitable for production @@ -39,11 +37,11 @@ if DEBUG: 'staff.pythondiscord.local', 'wiki.pythondiscord.local', ] - SECRET_KEY = "+_x00w3e94##2-qm-v(5&-x_@*l3t9zlir1etu+7$@4%!it2##" + SECRET_KEY = secrets.token_urlsafe(32) elif 'CI' in os.environ: ALLOWED_HOSTS = ['*'] - SECRET_KEY = "{©ø¬½.Þ7&Ñ`Q^Kº*~¢j<wxß¾±ðÛJ@q" + SECRET_KEY = secrets.token_urlsafe(32) else: ALLOWED_HOSTS = env.list( @@ -53,7 +51,8 @@ else: 'admin.pythondiscord.com', 'api.pythondiscord.com', 'staff.pythondiscord.local', - 'wiki.pythondiscord.local' + 'wiki.pythondiscord.local', + 'django.pythondiscord.com', ] ) SECRET_KEY = env('SECRET_KEY') @@ -98,6 +97,7 @@ MIDDLEWARE = [ 'django_hosts.middleware.HostsRequestMiddleware', 'django.middleware.security.SecurityMiddleware', + 'whitenoise.middleware.WhiteNoiseMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', @@ -135,7 +135,6 @@ TEMPLATES = [ WSGI_APPLICATION = 'pydis_site.wsgi.application' - # Database # https://docs.djangoproject.com/en/2.1/ref/settings/#databases @@ -143,7 +142,6 @@ DATABASES = { 'default': env.db() } - # Password validation # https://docs.djangoproject.com/en/2.1/ref/settings/#auth-password-validators @@ -162,30 +160,23 @@ AUTH_PASSWORD_VALIDATORS = [ }, ] - # Internationalization # https://docs.djangoproject.com/en/2.1/topics/i18n/ - LANGUAGE_CODE = 'en-us' - TIME_ZONE = 'UTC' - USE_I18N = True - USE_L10N = True - USE_TZ = True - # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/2.1/howto/static-files/ STATIC_URL = '/static/' STATICFILES_DIRS = [os.path.join(BASE_DIR, 'pydis_site', 'static')] -STATIC_ROOT = env('STATIC_ROOT', default='staticfiles') +STATIC_ROOT = env('STATIC_ROOT', default='/app/staticfiles') MEDIA_URL = '/media/' -MEDIA_ROOT = env('MEDIA_ROOT', default='media') +MEDIA_ROOT = env('MEDIA_ROOT', default='/app/media') STATICFILES_FINDERS = [ 'django.contrib.staticfiles.finders.FileSystemFinder', @@ -207,7 +198,7 @@ if DEBUG: else: ALLOWED_HOSTS.append(PARENT_HOST) else: - PARENT_HOST = env('PARENT_HOST', default='pythondiscord.com') + PARENT_HOST = env('PARENT_HOST', default='django.pythondiscord.com') # Django REST framework # http://www.django-rest-framework.org @@ -221,7 +212,6 @@ REST_FRAMEWORK = { 'TEST_REQUEST_DEFAULT_FORMAT': 'json' } - # Logging # https://docs.djangoproject.com/en/2.1/topics/logging/ LOGGING = { @@ -288,7 +278,7 @@ BULMA_SETTINGS = { } # Required for the wiki -LOGIN_URL = "/admin/login" # TODO: Update this when the real login system is in place +LOGIN_URL = "/admin/login" # Update this when the real login system is in place SITE_ID = 1 WIKI_ACCOUNT_HANDLING = False @@ -326,3 +316,22 @@ WIKI_MESSAGE_TAG_CSS_CLASS = { messages.SUCCESS: "is-success", messages.WARNING: "is-warning", } + +WIKI_MARKDOWN_HTML_STYLES = [ + 'max-width', + 'min-width', + 'margin', + 'padding', + 'width', + 'height', +] + +WIKI_MARKDOWN_HTML_ATTRIBUTES = { + 'img': ['class', 'id', 'src', 'alt', 'width', 'height'], + 'section': ['class', 'id'], + 'article': ['class', 'id'], +} + +WIKI_MARKDOWN_HTML_WHITELIST = [ + 'article', 'section', 'button' +] diff --git a/pydis_site/static/css/base/base.css b/pydis_site/static/css/base/base.css index 84af21f2..ce1503a3 100644 --- a/pydis_site/static/css/base/base.css +++ b/pydis_site/static/css/base/base.css @@ -42,6 +42,14 @@ div.card.has-equal-height { margin-left: 3rem; } +#navbar-banner { + background-color: transparent; +} + +#navbar-banner img { + max-height: 3rem; +} + #django-logo { padding-bottom: 2px; background: url(https://static.djangoproject.com/img/logos/django-logo-negative.png) no-repeat center; diff --git a/pydis_site/static/css/home/index.css b/pydis_site/static/css/home/index.css index 3bcd39ab..a90a60d7 100644 --- a/pydis_site/static/css/home/index.css +++ b/pydis_site/static/css/home/index.css @@ -57,16 +57,12 @@ span.repo-language-dot.css { background-color: #563d7c; } -#repo-footer-item { - margin-left: 1.2rem; -} - -#navbar-banner { - background-color: transparent; +span.repo-language-dot.javascript { + background-color: #f1e05a; } -#navbar-banner img { - max-height: 3rem; +#repo-footer-item { + margin-left: 1.2rem; } #sponsors-hero { diff --git a/pydis_site/static/css/wiki/style.css b/pydis_site/static/css/wiki/style.css index db6b4050..9d619e8b 100644 --- a/pydis_site/static/css/wiki/style.css +++ b/pydis_site/static/css/wiki/style.css @@ -1,5 +1,6 @@ #wikiNavbar { min-height: 3rem; + z-index: 1; } #wikiNavbar .container { @@ -31,3 +32,58 @@ ul.pagination-list li + li { margin-top: 0.5rem; margin-bottom: 0.5rem; } + +/* FA icons used in wiki articles */ +i.is-orangered { + color: #FE640A; +} + +i.is-orangered:hover { + color: #fe9840; +} + +i.is-blurple { + color: #7289DA; +} + +i.is-blurple:hover { + color: #93a8da; +} + +i.is-black { + color: #000000; +} + +i.is-black:hover { + color: #191919; +} + +i.is-youtube-red { + color: #BB0000; +} + +i.is-youtube-red:hover { + color: #f80000; +} + +i.is-amazon-orange { + color: #FF9900; +} + +i.is-amazon-orange:hover { + color: #ffb71a; +} + +i.is-teal { + color: #95DBE5; +} + +i.is-teal:hover { + color: #a9f5ff; +} + + + +i.has-icon-padding { + padding: 0 10px 25px 0; +} diff --git a/pydis_site/templates/base/base.html b/pydis_site/templates/base/base.html index d7e764a2..a419521c 100644 --- a/pydis_site/templates/base/base.html +++ b/pydis_site/templates/base/base.html @@ -16,11 +16,7 @@ {% bulma %} {# Font-awesome here is defined explicitly so that we can have Pro #} - <link rel="stylesheet" - href="https://pro.fontawesome.com/releases/v5.7.2/css/all.css" - integrity="sha384-6jHF7Z3XI3fF4XZixAuSu0gGKrXwoX/w3uFPxC56OtjChio7wtTGJWRW53Nhx6Ev" - crossorigin="anonymous" - > + <script src="https://kit.fontawesome.com/ae6a3152d8.js"></script> <link rel="stylesheet" href="{% static "css/base/base.css" %}"> {% block head %}{% endblock %} diff --git a/pydis_site/templates/base/navbar.html b/pydis_site/templates/base/navbar.html index bee503ee..17edd60d 100644 --- a/pydis_site/templates/base/navbar.html +++ b/pydis_site/templates/base/navbar.html @@ -61,20 +61,23 @@ More </a> <div class="navbar-dropdown"> - <a class="navbar-item"> - Resources + <a class="navbar-item" href="{% url 'wiki:get' path="resources/" %}"> + Learning Resources </a> - <a class="navbar-item"> + <a class="navbar-item" href="{% url 'wiki:get' path="tools/" %}"> + Tools + </a> + <a class="navbar-item" href="{% url 'wiki:get' path="frequently-asked-questions/" %}"> FAQ </a> - <a class="navbar-item"> + <a class="navbar-item" href="{% url 'wiki:get' path="rules/" %}"> Rules </a> - <a class="navbar-item"> + <a class="navbar-item" href="{% url 'wiki:get' path="privacy/" %}"> Privacy </a> <hr class="navbar-divider"> - <a class="navbar-item"> + <a class="navbar-item" href="{% url 'wiki:get' path="code-jams/" %}"> Code Jams </a> </div> diff --git a/pydis_site/templates/wiki/base.html b/pydis_site/templates/wiki/base.html index 192c25f6..36349758 100644 --- a/pydis_site/templates/wiki/base.html +++ b/pydis_site/templates/wiki/base.html @@ -2,9 +2,7 @@ {% load static %} {% load wiki_tags %} -{% block title %} - Wiki | {% block wiki_pagetitle %}{% endblock %}{% block wiki_site_title %}{% endblock %} -{% endblock %} +{% block title %}{% block wiki_pagetitle %}{% endblock %}{% block wiki_site_title %}{% endblock %}{% endblock %} {% block head %} {{ block.super }} diff --git a/pydis_site/templates/wiki/create_root.html b/pydis_site/templates/wiki/create_root.html index 330fea33..2d09089d 100644 --- a/pydis_site/templates/wiki/create_root.html +++ b/pydis_site/templates/wiki/create_root.html @@ -32,11 +32,7 @@ <form method="POST" class="form-horizontal"> {% wiki_form form %} - <div class="field is-horizontal"> - <div class="field-label"> - {# Empty for spacing #} - </div> <div class="field-body"> <div class="control"> <button type="submit" class="button is-primary" name="save_changes"> diff --git a/pydis_site/utils/resources.py b/pydis_site/utils/resources.py new file mode 100644 index 00000000..ab0df9d7 --- /dev/null +++ b/pydis_site/utils/resources.py @@ -0,0 +1,86 @@ +from __future__ import annotations + +import glob +import typing +from dataclasses import dataclass + +import yaml + + +@dataclass +class URL: + """A class representing a link to a resource""" + icon: str + title: str + url: str + + +class Resource: + """A class representing a resource on the resource page""" + description: str + name: str + payment: str + payment_description: typing.Optional[str] + urls: typing.List[URL] + + def __repr__(self): + """Return a representation of the resource""" + return f"<Resource name={self.name}>" + + @classmethod + def construct_from_yaml(cls, yaml_data: str) -> Resource: # noqa + resource = cls() + + loaded = yaml.safe_load(yaml_data) + + resource.__dict__.update(loaded) + + resource.__dict__["urls"] = [] + + for url in loaded["urls"]: + resource.__dict__["urls"].append(URL(**url)) + + return resource + + +class Category: + """A class representing a resource on the resources page""" + resources: typing.List[Resource] + name: str + description: str + + def __repr__(self): + """Return a representation of the category""" + return f"<Category name={self.name}>" + + @classmethod + def construct_from_directory(cls, directory: str) -> Category: # noqa + category = cls() + + with open(f"{directory}/_category_info.yaml") as category_info: + category_data = yaml.safe_load(category_info) + + category.__dict__.update(category_data) + + category.resources = [] + + for resource in glob.glob(f"{directory}/*.yaml"): + if resource == f"{directory}/_category_info.yaml": + continue + + with open(resource) as res_file: + category.resources.append( + Resource.construct_from_yaml(res_file) + ) + + return category + + +def load_categories(order: typing.List[str]) -> typing.List[Category]: + """Load the categories specified in the order list and return them""" + categories = [] + for cat in order: + direc = "pydis_site/apps/home/resources/" + cat + categories.append(Category.construct_from_directory(direc)) + + return categories |