Skip to main content

Python Snippet 01 - Requirements.txt

Recently i needed to get the requirements of my Django project so i could move it to a production server.
 So i researched the web and found REQUIREMENTS.TXT

Why requirements.txt?

Any application typically has a set of dependencies that are required for that application to work. The requirements file is a way to specify and install specific set of package dependencies at once.
Format for requirements file: 
Django ==0.10.1
djangorestframework ==1.2.0

Method 1:

$ pip freeze > requirements.txt
Use pip’s freeze command to generate a requirements.txt file for your project: If you save this in requirements.txt, then you can

$ pip install -r requirements.txt
to install all the requirements of your project.
NB: Use the pip freeze command in your virtualenv or else yuou will list all your dependencies

Comments

Popular posts from this blog

Tutorial 1 - How to Use uuid in Django

uuid is used when you need unique values from a model e.q (twitter with their status id) in the models.py id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) #if you dont want to use the uuid as the model id   use #unique_id = models.UUIDField(default=uuid.uuid4, editable = False,unique=True) in urls.py from django.conf.urls import url from . import views urlpatterns = [     url(r'^status/$', views.status, name='status'), ] and from views.py from django.shortcuts import render def status(request, uuid):     status = get_object_or_404(id=uuid)     return render(request, 'core/status.html', {'status': status})

How To Install Qt5.* AND QtCreator On UBUNTU 16.04

This tutorial was done with the following software versions: Ubuntu 16.04 LTS Qt Creator 3.5.1 Qt 5.5.1 Install Qt sudo apt-get install build-essential sudo apt-get install qt5-default   sudo apt-get install qtcreator Install documentation and examples If Qt Creator is installed thanks to the Ubuntu Software Center or thanks to the synaptic package manager, documentation for Qt Creator is not installed. Hitting the F1 key will show you the following message : "No documentation available". This can easily be solved by installing the Qt documentation: sudo apt-get install qt5-doc And eventually: sudo apt-get install qt5-doc-html qtbase5-doc-html If you the examples are also missing: sudo apt-get install qtbase5-examples Restart Qt Creator to make the documentation available.