Package: tesla-web
tesla-webUnder construction! Not ready for use yet! Currently experimenting and planning!Developed by Jafar Idris.Examples of How To Use (Buggy Alpha Version)Creating a projecttesla startprojectit will prompt you to enter your project name, a folder will be created with that name navigate to the project folder.project structure[project_name]

     - core

         - settings.py

         - urls.py

     - manage.pysettings.pyfromtesla.staticimportstaticfilesfromteslaimportTeslaAppfromtesla.admin.modelsimportUserfromtesla.adminimportabs_path,register_collectionsimportosfrompathlibimportPathasPa# Build paths inside the project like this: BASE_DIR / 'subdir'.BASE_DIR=Pa(__file__).resolve().parent.parentTeslaApp.middlewares.set_middlewares([])TeslaApp.auth_model=UserTeslaApp.templates_folders=[os.path.join(abs_path,'templates'),os.path.join(BASE_DIR,'templates')]# Register models to Admin panelregister_collections(User)staticfiles.paths=[os.path.join(BASE_DIR,'static'),os.path.join(abs_path,'statics')]urls.pyfromtesla.router.urlimportMountfromtesla.admin.urlsimportpatternsasadmin_urls# map admin urls with the projectMount('/admin/',admin_urls,app_name='admin')Start serverto start Tesla web server, open your command prompt and run Belo codetesla serve [port]port = 8000 by defaultopen your browser and navigate to the address display on your command line, you will see a 404 page because no route is specifiedCreating an Applicationtesla startappit will prompt you to enter your Application name, a folder will be created with that name navigate to the Application folder.Application structure[app_name]

    - models.py

    - urls.py

    - views.pymodels.pyfromtesla.auth.modalimportUserBaseModalfromtesla.modalimportModel,CharField,ListField,TextField,EmailField,PasswordField,DateFieldfromdataclassesimportdataclassclassUser(UserBaseModal):username=CharField(min=4,max=10)email=EmailField(required=True)password=PasswordField(min=8,max=16,required=True)dob=DateField()bio=TextField()@classmethoddef__meta__(self):return('id','username','email')urls.pyfromtesla.routerimportPathfrom.importviews# your urls path should be herepatterns=[Path('',views.index,name='index'),Path('login',views.login,name='login'),Path('logout',views.logout,name='logout'),Path('register',views.register,name='register'),Path('reset-password',views.reset_password,name='reset-password'),Path('collections',views.collections,name='collections'),Path('collections/{collection}/',views.collection,name='collection'),Path('collections/{collection}/new/',views.collection_new,name='collection_new'),Path('collections/{collection}/delete/',views.collection_del_all,name='collection_del_all'),Path('collections/{collection}/json/',views.collection_download,name='collection_download'),Path('collections/{collection}/{lookup}/',views.collection_obj,name='collection_obj'),Path('collections/{collection}/{lookup}/delete/',views.collection_del,name='collection_del')]views.pya view is a function that return instance of Responseexampledeflogin(request):ifrequest.method=='POST':u=request.post.get('username')p=request.post.get('password')user=User.get(username=u,password=p)ifisinstance(user,User):user_login(request,user)returnRedirect(request,'admin:index')returnRender(request,'admin/login.html')What Tesla Web will consistbuild-in Admin panelbuild-in API provider ( for registered models )build-in Authentication mechanismDocumentation websitecommunity