我对选择在哪一个上构建我的 django 项目感到非常沮丧......每个人的优缺点是什么,以便我可以选择一个。一方面有些网站建议使用 virtualenv ,而另一方面在 quora 上有些人建议使用 pipenv ,有些人说 pipenv 不是官方网站声称的好,而其他网站则说这是有史以来最好的构建方式你是 django 项目。你能帮我摆脱这种头痛吗?注意:我问这个问题的原因是......根据我在不同网站上的研究,它们中的任何一个都可能有一些优势,这可能会给网络应用程序的进一步开发带来麻烦。这是使用 pipenv 构建 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但是它们之间有很多差异,这让我担心应该使用哪一个。
添加回答
举报
0/150
提交
取消