Using Forward with Python and Django
Although the Forward CLI itself is written in Ruby (and installed via RubyGems), Forward is totally compatible with any HTTP webserver, including Django’s dev server as well as any other Python framework. You don’t need to modify your code at all to use Forward.
Forwarding a site
If you haven’t already, you’ll need to install Forward.
Once Forward is installed, you can start forwarding any of your Python projects. Forward works with Django, Flask, Pyramid, or anything else — if you can view it in the browser, Forward can give you a link to share it.
For an example, if you have your local Django dev server running at http://localhost:8000, go to that URL in your web browser, then click the Forward icon.
When Forward opens, click the ‘Start tunnel’ button.
Forward will start a tunnel and give you a shareable URL. Give this URL to a client or to other developers on your team and let them review the site before you even deploy to a staging server.
Read more about using Forward on the Getting Started page.
Forwarding a site
If you haven’t already, you’ll need to install Forward.
Once Forward is installed, you can start forwarding any of your Python projects. Forward works with Django, Flask, Pyramid, or anything else — if you can view it in the browser, Forward can give you a link to share it.
For instance, if you had a Django server on port 8000
, you could forward it with the following command:
forward 8000
Forward will then start a tunnel and give you a shareable URL. Give this URL to a client or to other developers on your team and let them review the site before you even deploy to a staging server.
Using a Forwardfile
to set defaults for your project
When you’re working on a project with a team, and your project is using some form of version control, it’s nice to be able to share settings for your Forward tunnels. You can do this with a Forwardfile
.
A Forwardfile
is a short YAML-formatted file that sits in each project folder and specifies all the options that you’d normally pass to the forward
command manually.
Once you’ve added a Forwardfile
all you need to do is run forward
and it’ll use the options you specified without having to pass anything in to the command itself.
Read more about using a Forwardfile
on the Getting Started page.