This directory is a brief example and starter app for Django, ready to deploy on ZEIT Now.
To get started with this project yourself, use the following command from Now CLI:
$ now init python-djangoAlternatively, create a project, and Git repository, with this example template using the ZEIT dashboard.
Once initialized locally, you will see the file /app.py which is the entrypoint to the Django application.
The routes defined in the now.json file use a wildcard to match all incoming routes to the /app.py Lambda output.
To deploy this application, with Now installed, run the following from your terminal:
$ nowAlternatively, your new Django app can be automatically deployed and aliased using Now for GitHub or Now for GitLab. Pushing these files to a new repository with a now.json file in the root, and with either Now for GitHub or Now for GitLab configured for that repository, means your site will be automatically deployed for every push and pull/merge request, and aliased for every push to the default branch!
This starter project includes:
- A
app.pyfile that defines the Django app via Web Server Gateway Interface (WSGI) along with asettingsreference. - A
settings.pyfile that defines Django core settings. - A
urls.pyfile that defines Django url patterns. - A
views.pyfile that defines Django views. - A pre-defined
Pipfilefile that installs Django as a dependency and defines the Python runtime version. - A generated
Pipfile.lockfile that ensures exact versions of dependencies to avoid the risk of automatically upgrading packages that depend upon each other and breaking your project dependency tree. - A
css/style.cssfile that adds a few basic styles to the page. - A
now.jsonfile that defines builds and routes for the Now 2.0.
For more resources on how to configure your new Django app to do more with Now or to deploy any other kind of application, see the following:
- New to Now? Get a quick introduction
- Learn the basics of deployment on Now
- Learn how to configure your Now deployments
- Learn how to configure Now Routes for redirects, caching, and more
- Learn how to alias your deployment to a domain or other unique shareable URLs
For more information on Django itself, see their documentation.