Skip to content

Commit

Permalink
Fix run command
Browse files Browse the repository at this point in the history
  • Loading branch information
radiac committed Oct 19, 2023
1 parent 12f9ecf commit 877e031
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 30 deletions.
33 changes: 5 additions & 28 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,36 +21,12 @@ it starts to get complicated.
Quickstart
==========

Write a Django app in the same style as you would a Flask app:

.. code-block:: python
from django_flasky import Django
app = Django()
@app.route("/")
def hello_world(request):
return "<p>Hello, World!</p>"
This is almost exactly a simplistic as Flask, but the ``request`` object is passed into
the view instead of being a global.

Just save the above file as ``hello_world.py`` and run it with:

.. code-block:: sh
django-flasky hello.py run
Your site will now be running on http://localhost:8000.
Install django-flasky::

pip install django-flasky

But I want a database
---------------------

No problem, this is Django, just not how you know it:
Write a Django app in the same style as you would a Flask app, but using models and other Django goodness:

.. code-block:: python
Expand Down Expand Up @@ -139,4 +115,5 @@ One day you will be able to run:
This will do its best to break up your ``hello_world.py`` into a proper Django project
under ``hello_world``.

Right now though, this is not implemented, so you'll just need to do it yourself.
Right now though, this is not implemented, so you'll just need to do it yourself - put
your models in your ``models.py``, your views in ``views.py`` and routes in ``urls.py``.
2 changes: 1 addition & 1 deletion django_flasky/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .app import Django # noqa


__version__ = "0.1.2"
__version__ = "0.1.3"
2 changes: 1 addition & 1 deletion django_flasky/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,5 @@ def run(self, args: list[str]):

if not args:
args = ["runserver", "0:8000"]
args = ["django_flasky"] + args
args = ["django_flasky"] + list(args)
execute_from_command_line(args)
37 changes: 37 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
=========
Changelog
=========

Changes
=======

0.1.3 - 2023-10-19
------------------

Fix:

* Python compatibility issue in run command



0.1.2 - 2022-11-25
------------------

Docs:

* Correct examples


0.1.1 - 2022-11-25
------------------

Docs:

* Correct packaging metadata



0.1.0 - 2022-11-25
------------------

Initial release
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ classifiers =
Environment :: Web Environment
Framework :: Django
Framework :: Django :: 3.2
Framework :: Django :: 4.2
Intended Audience :: Developers
License :: OSI Approved :: BSD License
Operating System :: OS Independent
Expand All @@ -20,6 +21,7 @@ classifiers =
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
url = https://radiac.net/projects/django-flasky/
project_urls =
Documentation = https://github.com/radiac/django-flasky
Expand Down

0 comments on commit 877e031

Please sign in to comment.