I have an existing Django application. I want to start developing it in Pycharm, instead of sublime text and command line. I have opened my existing directory (cloned from my git repo) into Pycharm but I can not for the life of me figure out how to set it as a django project. All the examples I see are new projects from scratch or existing pycharm projects, neither of which applies to me. I'm running on a brand new mac, if that helps (I'm coming from Ubuntu)
You need to enable Django Support in the project settings under Project Settings -> Django. You also would need to set up the project root, path to settings.py and manage.py.
Related
Maybe this is a silly question, but I'm new to all of this and I could use some help. I recently just started a new django project using pinax. Specifically, it's the pinax accounts project for user sign-ins. When I look at my project folder, it doesn't include any apps. I've noticed that all of my apps are stored in virtualenv/Lib/site-packages...
Why is it that the apps for my project are stored here? Does it make more sense to move them into my actual project folder instead of working out of the virtual machine folder? So I guess my question is: when working in a virtual machine, are all apps, etc stored in the virtual machine folder as apposed to the project folder? And why?
So I got advice in another question and they started talking about paths and .exe and that I should not put my projects in the scripts. So I added
C:python27\scripts to my path and nothing seemed to change except when I created a new project, and went into the GUI to look for the folder and found it, it just says Manage instead of manage.py. It says its a python folder.
I then took ..\scripts out of the path and created the project again and still got the same thing.
Whenever I did it the first time without changing anything, I did see a manage.py file.
So the tutorial I am working that introduces me to Django asked me to open the manage.py file, and when I try to of course it tells me it can't open the file because it does exist. So what do I do?
If I'm understanding you correctly, you're simply trying to create a django project. Since you didn't mention which tutorial you're using, I'll link this resource and recommend following it page for page. It's a great walk-through for learning how to create apps and it's broken into sessions you can do over a period of time:
To answer your question: when you create a django project with django-admin startproject mysite it will install the manage.py into the mysite directory. If that doesn't answer your question, try describing the precise steps you're taking to create a Django project including all commands you're using (if any).
It's also helpful to know if you're using a virtual environment.
I have 3 standalone python applications in python Virtual env in mog_wsgi modein same server. I installed newrelic in 1st application python virtual environment and its showing fine in newrelic GUI page.
when i followed and installed same thing for 2nd and 3rd application in respective python Virtual env. but these 2 applications are not showing in Newrelic GUI application page.
For all 3 applications log file is not updating from starting.
Please help me out to configure and integrate multiple python apps which are hosted in a single server python env.
below are steps that i have followed.
centos OS
Install the New Relic Python agent in apps virtual env
source <virtual path>
pip install newrelic
pip freeze
Generate config file:
cd /etc/newrelic/
newrelic-admin generate-config <Licence Key> newrelic.ini
Validate the conf file:
newrelic-admin validate-config newrelic.ini
Configure the variables in conf file
logfile = log file name
loglevel=info
app_name = name
Integrate the appliactions mod_wsgi file with NewRelic:
Adding below in wsgi.py file
vi wsgi.py
import newrelic.agent
newrelic.agent.initialize('/etc/newrelic/newrelic.ini')
installed newrelic version is "newrelic==2.12.0.10"
Please help me.
Thank you,
subhani466#gmail.com
I know that you have posted this a while ago, but the solution I've found was to install newrelic pip install newrelic outside of virtual envs.
Anyone that is facing this issue just install new relic outside the virtual envs.
I'm a little unclear on your setup. If you have all three Python apps in the same virtual environment and you're using newrelic.ini for all three, then all three applications will report to the same UI listing. You need to either name the config files differently (newrelic.ini, newrelic2.ini, newrelic3.ini) and reference them likewise, or split the applications into separate virtual environments.
As for the log files not writing, it sounds like you don't have user rights to that directory. You can read more about this in the New Relic docs, here: https://docs.newrelic.com/docs/python/python-agent-logging
The path provided for 'log_file' should be writable to the user that
your application runs as. If using Apache/mod_wsgi that would usually
be the Apache user which has restricted access to the filesystem. You
might therefore need to create a special directory into which the log
file can be placed which is writable to the Apache user. Because the
current working directory of an application could be anything, it is
recommended that an absolute path and not a relative path be used.
If you need more help, please open a ticket with us at http://support.newrelic.com
It looks like you are using one config file for three applications.
They all have the same app_name.
Therefore, you have one APM displayed in the UI.
Remove the app_name line from newrelic.ini and pass a unique variable NEW_RELIC_APP_NAME to each app.
I've managed to deploy to a production site, running on Apache + mod_wsgi, python3.3 + pyramid 1.4.
Right now, it's showing the pyramid default page.
I was messing around with the myapp folder, even when I removed __init__.py, restart apache, it is still showing the default pyramid page. Why is this so?
For some reason which I don't understand, when using install over develop, there's another
folder ( build ) being created, I've tried editing the template.pt file in build as well as
the one in the template folder, restart apache, it is still showing the default pyramid page that comes with when setting up a new project.
I don't know if this is the right way of doing it but it works for me. Instead of using install as detailed in http://docs.pylonsproject.org/projects/pyramid/en/latest/tutorials/modwsgi/index.html, step 6:
$ ../bin/python setup.py install
I used develop, edited the template.pt in the template folder, restart apache, and the site is
reflecting the changes.
install bundles your app, and will not include static files unless you have a proper MANIFEST. develop is usually a better way to deploy unless you're trying to make your app redistributable as an open project.
I keep getting this error every time i create a new django project using titanium (eclipse) with pydev.
Actually, it did create the file settings.py
I wonder what make this error and how to fix it?
It's really a PyDev issue with Django 1.4. A new release (2.5.0) will be done later this week properly supporting the layout changes in Django 1.4.
You can still use the project created this way, but you have to do some manual things:
Move the contents inside of the folder that was created to your module (this was the structural change done in django 1.4)
The settings.py won't have the details you entered in the wizard (i.e.: manually edit the settings.py)
In the project django's properties (right click project > properties and check the django properties page), you have to put the proper settings to the settings module and manage.py.
I updated my pydev today to the last version and now it seems to be working beautifully...