Django App Prerequisites for AWS Elastic Beanstalk: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
|||
| (9 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
== Create a virtual Python environment for the Django project == | |||
== Create a virtual Python environment for the | |||
Install `virtualenv` if needed: | Install `virtualenv` if needed: | ||
| Line 36: | Line 11: | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
$ virtualenv -p python3.4 | $ virtualenv -p python3.4 /path/to/project_venv | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Where ` | Where `/path/to/project_env` is a path unique to the project. | ||
Start the virtual environment: | Start the virtual environment: | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
$ | $ . /path/to/project_venv/bin/activate | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| Line 59: | Line 34: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== | == Create a Django application locally == | ||
* Install all prerequisites necessary for the Django app, e.g. Python, pip, Django, etc. | |||
* See [[Working With Django Projects, The Basics]] | |||
* Run and test the Django application locally, e.g. with `python manage.py runserver`. | |||
Django | |||
[[ | |||
== Install AWS Elastic Beanstalk CLI <ref> [http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python-common-steps.html#python-common-installing-ebcli Installing the AWS Elastic Beanstalk CLI] (AWS documentation)</ref> == | == Install AWS Elastic Beanstalk CLI <ref> [http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python-common-steps.html#python-common-installing-ebcli Installing the AWS Elastic Beanstalk CLI] (AWS documentation)</ref> == | ||
Install the AWS Elastic Beanstalk cli: | |||
''N.B. | ''N.B. See [[Troubleshooting_Deploying_a_Django_Application_With_Elastic_Beanstalk#Errors_installing_awsebcli_on_Mac_OS_for_Python_2.7|the Troubleshooting article]] for issues installing `awsebcli` on Mac OS X.'' | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
| Line 93: | Line 52: | ||
Confirm the installation with `eb --version` | Confirm the installation with `eb --version` | ||
At this point the directory is ready to have an Elastic Beanstalk application created with `eb init`. See [[Deploying a Django app on AWS]]. | |||
== Notes == | == Notes == | ||
| Line 119: | Line 60: | ||
* [http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python-common-steps.html Common Steps for Deploying Python Applications] - AWS Elastic Beanstalk documentation | * [http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python-common-steps.html Common Steps for Deploying Python Applications] - AWS Elastic Beanstalk documentation | ||
* [http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/installing-python.html Installing Python] - AWS Elastic Beanstalk documentation | * [http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/installing-python.html Installing Python] - AWS Elastic Beanstalk documentation | ||
* [[Deploying a Django app on AWS]] | |||
=== References === | === References === | ||
<references /> | <references /> | ||
[[Category:Django]][[Category:AWS]][[Category:Elastic Beanstalk]][[Category:Web Development]] | |||
Latest revision as of 04:35, 1 June 2020
Create a virtual Python environment for the Django project[edit]
Install virtualenv if needed:
$ which virtualenv $ pip install virtualenv
Create the virtual Python Environment[1]
$ virtualenv -p python3.4 /path/to/project_venv
Where /path/to/project_env is a path unique to the project.
Start the virtual environment:
$ . /path/to/project_venv/bin/activate
Confirm the Python version:
$ python --version
Leave the virtual environment:
$ deactivate
Create a Django application locally[edit]
- Install all prerequisites necessary for the Django app, e.g. Python, pip, Django, etc.
- See Working With Django Projects, The Basics
- Run and test the Django application locally, e.g. with
python manage.py runserver.
Install AWS Elastic Beanstalk CLI [2][edit]
Install the AWS Elastic Beanstalk cli:
N.B. See the Troubleshooting article for issues installing awsebcli on Mac OS X.
$ pip install awsebcli
Confirm the installation with eb --version
At this point the directory is ready to have an Elastic Beanstalk application created with eb init. See Deploying a Django app on AWS.
Notes[edit]
See also[edit]
- Common Steps for Deploying Python Applications - AWS Elastic Beanstalk documentation
- Installing Python - AWS Elastic Beanstalk documentation
- Deploying a Django app on AWS
References[edit]
- ↑ Setting up a virtual Python environment (AWS documentation)
- ↑ Installing the AWS Elastic Beanstalk CLI (AWS documentation)