

Let’s try out our new project by using Django’s lightweight built-in web server for local development purposes. The manage.py file is not part of django_project but is used to execute various Django commands such as running the local web server or creating a new app.

wsgi.py stands for Web Server Gateway Interface which helps Django serve our eventual web pages.urls.py tells Django which pages to build in response to a browser or URL request.settings.py controls our Django project’s overall settings.asgi.py allows for an optional Asynchronous Server Gateway Interface to be run.Without this file, we cannot import files from another directory which we will be doing a lot of in Django! _init_.py indicates that the files in the folder are part of a Python package.Within django_project are five new files: venv directory was created with our virtual environment but Django has added a django_project directory and a manage.py file. Once you are done, you can simply delete the directory myenv to remove the project-specific libs.The. Once you are done developing, you can freeze your install and replicate it on your testing environment. Now your project is setup to only use the virtualenv python. On the next screen, click the button to the right of the python interpreter, and browse to your virtual environment, and select the directory with the python.exe file. Give your project a name and select Django project from the Project type drop down Install django into this environment: pip install django, and any other libs you might need for this project. New python executable in myenv\Scripts\python.exe To do this, you need to first install setuptools and then install pip in your system python.įirst create your virtual environment, this will avoid polluting your base python install. You have to put the django libraries on your development machine for the code hinting and method signatures to work. I use P圜harm on Windows at work, and this process works for me (since P圜harm doesn't support virtual env in the project creation stage). Since I wrote this answer, P圜harm has greatly expanded their support for virtual environments and now you can create virtual environments when starting projects.įor more information, see P圜harm online documentation.
