我對選擇在哪一個上構(gòu)建我的 django 項目感到非常沮喪......每個人的優(yōu)缺點是什么,以便我可以選擇一個。一方面有些網(wǎng)站建議使用 virtualenv ,而另一方面在 quora 上有些人建議使用 pipenv ,有些人說 pipenv 不是官方網(wǎng)站聲稱的好,而其他網(wǎng)站則說這是有史以來最好的構(gòu)建方式你是 django 項目。你能幫我擺脫這種頭痛嗎?注意:我問這個問題的原因是......根據(jù)我在不同網(wǎng)站上的研究,它們中的任何一個都可能有一些優(yōu)勢,這可能會給網(wǎng)絡應用程序的進一步開發(fā)帶來麻煩。這是使用 pipenv 構(gòu)建 django 項目的過程:pipenv install django==2.1pipenv shelldjango-admin startproject project .python mange.py runserver # check wether all things are alright or not.#Ctrl+c #go out of the serverpython 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 listof 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 thisfrom django.http import HttpResponsedef homePageView(request):return HttpResponse('Hello, World!')#then make a urls.py in your project's app folder and type this in itfrom django.urls import pathfrom .views import homePageViewurlpatterns = [ path('', homePageView, name = 'home') ]#The come to urls.py in project folder and add include to the imported functionsfrom django.contrib import adminfrom django.urls import path, include#<== I mean this one#Then add another path to urlpatterns containing a listurlpatterns = [path('admin/', admin.site.urls),path('', include('shipping.urls'))#<==I mean this one ]這是 virtualenv 的過程:python -m venv ll_envll_env\Scripts\activatepip install djangodjango-admin startproject learning_log .ython manage.py startapp learning_logs但是它們之間有很多差異,這讓我擔心應該使用哪一個。
pipenv 或 virtualenv ,哪個更好用?
慕無忌1623718
2022-06-22 17:53:35