Issue
I am really frustrated by choosing which one to build my django projects on... what are the cons and pros of each so that i can choose one.
on one hand some websites suggest using virtualenv , while on the other hand on quora some people suggest to use pipenv , some people say pipenv is not what the official site claims to be good, while other sites say this is the best ever way to build you'r django projects.
could you please help me get out of this headache ?
NOTE:The reason why I am asking this question is because...there might be some advantages in either of them , that may make troubles in further development of web-apps according to my researches on different websites.
This is the process of building a django project with pipenv :
pipenv install django==2.1
pipenv shell
django-admin startproject project .
python mange.py runserver # check wether all things are alright or not.
#Ctrl+c #go out of the server
python mange.py startapp app #creat an app in your project
# Add your app in settings.py at project folder by finding Installed_apps
variable containing a list
of installed apps like this and add another app url like
this===>'app.apps.AppConfig'
#Then go to views.py in your project's app folder and do this
from django.http import HttpResponse
def homePageView(request):
return HttpResponse('Hello, World!')
#then make a urls.py in your project's app folder and type this in it
from django.urls import path
from .views import homePageView
urlpatterns = [
path('', homePageView, name = 'home')
]
#The come to urls.py in project folder and add include to the imported
functions
from django.contrib import admin
from django.urls import path, include#<== I mean this one
#Then add another path to urlpatterns containing a list
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('shipping.urls'))#<==I mean this one
]
This is the process for virtualenv:
python -m venv ll_env
ll_env\Scripts\activate
pip install django
django-admin startproject learning_log .
ython manage.py startapp learning_logs
but there is quite a many difference between them that makes me worry which one should be used.
Solution
As written here, python packing manager themself recommand using pipenv
Use Pipenv to manage library dependencies when developing Python applications. See Managing Application Dependencies for more details on using pipenv.
Consider other tools such as pip when pipenv does not meet your use case.
Answered By - Reznik