Django with Microsoft Visual Studio : No module named ‘.apps.PollsConfig’; ‘.polls.apps’ is not a package

   
 

No module named ‘.apps.PollsConfig’; ‘.polls.apps’ is not a package

This is a very common error when using Django with Microsoft visual studio. This issue is due to different Django version. My default MVS uses Django 1.8 and the definition for including urls.py file in settings.py is different.

   
 

For testing Django with MVS use only Django user documentation guide 1.8

https://docs.djangoproject.com/en/1.8/intro/tutorial01/

https://docs.djangoproject.com/en/1.8/intro/tutorial01/#activating-models

For Django

   
 

version 1.8 specify only the app name.

   
 

INSTALLED_APPS = (

‘django.contrib.admin’,

‘django.contrib.auth’,

‘django.contrib.contenttypes’,

‘django.contrib.sessions’,

‘django.contrib.messages’,

‘django.contrib.staticfiles’,

‘polls’,

)

   
 

version 1.9

   
 

INSTALLED_APPS = [

 
 

                    'polls.apps.PollsConfig',
						

                    'django.contrib.admin',

                    'django.contrib.auth',

                    'django.contrib.contenttypes',

                    'django.contrib.sessions',

                    'django.contrib.messages',

                    'django.contrib.staticfiles',

]

 
 

 
 

Reference Document


https://stackoverflow.com/questions/35484263/no-module-named-polls-apps-pollsconfigdjango-django-project-tutorial-2
			

 

 

                

Advertisements

Learning Django using Python Anywhere

Python Anywhere website is an excellent online tool for learning and deploying python applications.

Web Site : www.pythonanywhere.com

In this blog i am delving into the steps for creating development environment for python with Django.

  1. create an account an trial account using pythonanywhere.com.
  2. I assume that starting point for any Django beginner is the Django official guide.  https://docs.djangoproject.com/en/1.11/intro/tutorial01/
  3. Before following the step mentioned in the official guide Python anywhere environment is to be setup. Please meticulously follow the steps mentioned in the following link.    https://help.pythonanywhere.com/pages/FollowingTheDjangoTutorial/
  4. Please make sure that
    1. virtual environment path setting
    2. Allowed_Hosts
    3. wsgfile setting are maintained properly.

Basics of Stock Trading

Terminologies

Market Order : Security is executed at market price.

Limit Order : Security is executed with price specified as Limit Price.

Stop Loss

A stop loss is an order to buy (or sell) a security once the price of the security climbed above (or dropped below) a specified stop price. When the specified stop price is reached, the stop order is entered as a market order (no limit) or a limit order (fixed or pre-determined price).

Stop Loss – Limit order

Stop loss limit order is an combination of stop loss order and limit order.

 

Explanation with examples.

Stop loss is used when the market is trending in opposite direction.

Eg 1: Selling of Stock

when a stock is sold a higher price is always expected. Which is controlled by the limit price . But lets assume that the market is trending in the opposite direction , in this case the limit value is not reached. In order to minimize the loss you may decide to sell the stock at a lower price which is controlled by the Stop Loss. Stop loss limit order decides the band in which the stock can be sold.

Expected Selling Price ( Limit Price) : 150

Current Stock Price : 100

Stop Loss Price : 75

Stop loss limit price : 70

 

Eg 2 : Buying of stock

Stock is always bought at a lower price. This can be achieved using a limit order.

In case if the stock is to be bought in a upward trending market a stop order is placed , which can be a market or a limit order.

Expected Buying Price ( Limit Price) : 150

Current Stock Price : 200

Stop Loss Price : 210

Stop loss limit price : 220

 

Conclusion:

Sell Limit Price is used when stock is to be sold at a price higher than the current market price.

Buy Limit price is used when the stock is to be bought at a price lower than the current market price.

Sell Stop price is used when stock needs to be sold in a trending market in the opposite direction. Stop loss sell price is less than the current market price.

Buy stop price is used when stock needs to be bought in a trending market in the opposite direction. Stop loss buy price is always greater than market price.

Stop loss price should be between the current market price and the limit price.

 

 

Reference Documents:

https://www.youtube.com/watch?v=jPIL8ncYb6Y

http://www.tradingpicks.com/stop_loss.htm

 

Understanding Non Valuated Material Type

Non valuated material type UNBW is used for tracking quantity and the value is consumed. Which makes it obvious that account assignment is mandatory for the PO.

Assumptions : Since account assignment is used in the PO , do not assume that the item is posted as consumption (No quantity).

But this would be the case for other material types which have quantity and value update indicator set. Eg : Material type : SPARES , when PO is created without account assignment the item is posted to inventory and when account assignments used the item is posted to consumption.

In case of Non valuated material types (esp : material with only quantity update) the the item is always posted to stock and the PO should always have a account assignment.

image

Tcode : OMS2

Conclusion 

  1. Material type with only Quantity update will be post the quantity to inventory and value will be consumed as per the account assignment maintained in the PO.
  2. Material type with Quantity and value update : IF PO is created with account assignment quantity / value is consumed.  if PO is created without account assignment the items are posted to stock.
  3. Material types without Quantity and Value update : (NLAG) used only for reporting purposes. Quantity and value consumed.

Reference:

https://archive.sap.com/discussions/thread/1608016

Handling Storage Unit Types : Internal Whse Movements

LT10 is a very generic transaction which can be used for internal Whse movements like

1. Transfer of material one storage Bin to another storage bin

image

image

2. Change Storage Unit Type

Storage unit type can be changed while

–   moving to another bin or

–    moving to transfer bin and then transferring the items back from the transfer bin to the actual bin.

Changes to WMS material properties  like storage unit type cannot be achieved using a single bin i.e using the same storage bin as the source and destination. There should be a bin transfer for property changes.

image