I'm new using django-postman and django and I just downloaded a copy of the django-postman package to use with my app. I added 'postman' to the INSTALLED_APPS settings.py of my project and url(r'^messages/',include('postman.urls',namespace='postman',app_name='postman')), in urls.py. However, I'm not sure where to put the downloaded package and integrated with my project. I think I added the app to my Python path with pip install django-postman==3.6.2, but when I use url(r'^messages/',include('postman.urls',namespace='postman',app_name='postman')) my django program says that there's not an app called 'postman'. How do I include the django-postman app to my project? Also since the app_name='postman' in urls.py is not longer valid for python 3.6 should I just take it out of the statment?
Related
Problem description
I have django standalone app named django_codeserver. It can be loaded from my private package registry as a pip-package.
My app contains about twenty sub-apps for example django_codeserver.headers, django_codeserver.genders etc.
Current behaviour
To register all models in my project which uses django_codeserver, I have to register all the sub applications in the parent project INSTALLED_APPS such as:
INSTALLED_APPS = [
...
'django_codeserver.headers',
'django_codeserver.genders'
...
]
Preferred behaviour
I would want all the sub apps being registred in the parent project when I only:
Install the standalone django app as pip-package (pip install django-codeserver)
Register only the parent app in parent project installed apps:
INSTALLED_APPS = [
'django_codeserver
]
After researching this problem, I couldn't find the exact solution. However we can kind of deal with this problem as pointed out here.
So we are not able to automatically install sub apps, but instead we can reuse application with all sub apps included without directly write all apps in the parent project INSTALLED_APPS.
In that way reusable app installation documentation not changing after adding a new sub app. Also the maintenance of included sub apps is moved from reusable app consumer to its provider.
I am trying to learn django and I have completed the official django 1.7 "polls" app and also the popular gswd. Now I am trying to understand the codebase of everyblock.com They provide the backend code for learning purposes. This is the README file on everyblock
==========
everyblock
==========
This package contains code/templates that are specific to EveryBlock.com. They
are released to fulfill the terms of the grant that funded EveryBlock's
development and are likely not of general use.
Overview
========
The package is split into these directories:
admin -- EveryBlock's internal admin application for managing its data
cities -- City-specific data-acquisition scripts (for 15 U.S. cities)
media -- CSS file for the admin
states -- State-specific data-acquisition scripts
staticmedia -- A Django template tag specific to EveryBlock.com media files
templates -- Templates for the admin
utils -- Various utilities used on EveryBlock.com
Quickstart
==========
0. Install PostgreSQL, PostGIS, Django, psycopg2.
1. Install the everyblock package by putting it on your Python path. Also
install the ebdata, ebpub and ebgeo packages.
2. Start a Django project.
3. Put the smorgasbord of eb-specific settings in your settings file. It's
probably easiest to just start with the file ebpub/settings.py and tweak
that (or import from it in your own settings file). The application won't
work until you set the following:
DATABASE_USER
DATABASE_NAME
DATABASE_HOST
DATABASE_PORT
SHORT_NAME
PASSWORD_CREATE_SALT
PASSWORD_RESET_SALT
METRO_LIST
EB_MEDIA_ROOT
EB_MEDIA_URL
See the documentation/comments in ebpub/settings.py for info on what the
various settings mean.
4. Run "django-admin.py syncdb" to create all of the database tables.
5. Run "django-admin.py runserver" and go to http://127.0.0.1:8000/ in your
Web browser to see the site in action.
I have downloaded ebdata and ebpub packages and unzipped. I can see the files. I have installed PostgreSQL, PostGIS, Django, psycopg2. How do I go ahead with the next steps. I don't get how the three Packages can be installed by putting them in python path, start a django project and get it running locally. Any help?
Depending on how you installed your dependencies, they may already be in your python path.
Run python from your terminal and see if you can import django. If you can it's already in your python path.
$ python
Python 2.7.9
>>> import django
>>>
If that works, you can create a new django project
django-admin startproject everyblock
then just copy all the files you unzipped into the project folder and modify the settings.py file to point to your database.
(NB: Everyblock was released in 2009. It won't run using the latest version of Django without making some changes. It's also not a trivial project to begin with, so you may want to start with a different project until you are a little more comfortable.)
Actually , I want to run the app which are not in the current project directory. Is it possible to run another app if i give a path to that folder.
Currently i have a project directory PROJECT, under it there is manage.py and PROJECT--->settings.py,urls.py.
And I have an another app running at other directory, for example plugins-->App1, App2.
What i want, when i start the server in PROJECT directory. I want to dynamically configured the settings.py and urls.py of the current project, so that i can run other apps. If some one know how to deal with this type of problem please help me.
Yes, you can. The path to your app in INSTALLED_APPS is any valid python path.
A tuple of strings designating all applications that are enabled in this Django installation. Each string should be a dotted Python path to:
an application configuration class, or a package containing a
application.
Docs: link
I've installed Django-registration succesfully (form this tutorial).
So now I have a Django project "loginSystem", with in this map urls.py, settings.py, manage.py and _init_.py, so there is no app created but it works. The registration-folder is installed in my python-packages folder.
No I want to give to each users a unique profile, so I'll do this manual for django-profiles. The profiles folder is also installed in my python-packages folder.
But what do I have to create now to follow and start this django-profiles manual?
Because they start speaking about a "/profiles/edit"-folder...
So do I have to work in the dist-packages/profiles folder, or in my project-folder (without app)?
Thanks a lot, it asked me already a lot of time without result...
I don't see there they are talking about a /profiles/edit/ folder. The only thing you have to do is creating a /profiles/ folder in your TEMPLATE_DIR and put an edit_profile.html template there. Then you still need to hock up the url configuration to serve the edit view of the profiles app (they suggest a url somewhere like /profiles/edit/) and then you are good to go. Its basically the same as for django-registration except django-registration already create the url configuration for you.
I have downloaded this project http://code.google.com/p/django-budget/
How can i install it. Do i need to execute some commands or just extract it to some folder.
DO i need to use syncdb.
I am newbie so don't know much
PS. It's been moved to https://github.com/toastdriven/django-budget for a while now.
There is information on the frontpage of the site:
Installation
Either copy/symlink the budget app
into your project or place it
somewhere on your PYTHONPATH.
Add the budget.categories,
budget.transactions and budget apps to
your INSTALLED_APPS.
Run ./manage.py syncdb.
Add (r'^budget/',
include('budgetproject.budget.urls')),
to your urls.py.
You need Python and Djano installed.