Last active
February 8, 2017 10:18
-
-
Save SarasArya/fd4f897b9c20c711f36b1188d3688c95 to your computer and use it in GitHub Desktop.
How to get started with Django-Python-Pymongo on Pycharm Edu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The operating system used here is Ubuntu | |
Download and install Pycharm-edu | |
Open it and create a New Project | |
This will create a project folder and install all necessary base files | |
now inside that folder and create a virtual environment by typing `virtualenv -p /usr/bin/python3.4 <venv_name>` | |
Type `source <venv_name>/bin/activate` to activate that virtual environment. Node people consider this as your local node_modules folder. | |
Now install Django by typing `pip3 install Django` | |
This will create the django-admin.py file necessary to start a project. | |
Create your sub-app by typing `django-admin.py startproject <my_sub_app>` | |
This will create another folder with the name <sub_app> | |
cd into the folder and type `python manage.py migrate` | |
`python manage.py runserver` to serve the project. You can visualize this in your browser at 127.0.0.1/8000. | |
Optional : Create a requirements.txt file and save all the dependencies in it. Much like your package.json. One common pitfall of it is that pip install will fail if it cannot install even one of your dependencies. To mitigate that type `xargs -a requirements.txt -n 1 pip install` for debian/Ubuntu and `cat requirements.txt | xargs -n 1 pip install` for BSD/MacOSx |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment